summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/contexts.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/contexts.cc')
-rw-r--r--deps/v8/src/objects/contexts.cc40
1 files changed, 16 insertions, 24 deletions
diff --git a/deps/v8/src/objects/contexts.cc b/deps/v8/src/objects/contexts.cc
index cddbcb98c0..861e06d87f 100644
--- a/deps/v8/src/objects/contexts.cc
+++ b/deps/v8/src/objects/contexts.cc
@@ -44,7 +44,7 @@ bool ScriptContextTable::Lookup(Isolate* isolate, ScriptContextTable table,
DCHECK(context.IsScriptContext());
int slot_index = ScopeInfo::ContextSlotIndex(
context.scope_info(), name, &result->mode, &result->init_flag,
- &result->maybe_assigned_flag);
+ &result->maybe_assigned_flag, &result->requires_brand_check);
if (slot_index >= 0) {
result->context_index = i;
@@ -105,12 +105,12 @@ ScopeInfo Context::scope_info() {
return ScopeInfo::cast(get(SCOPE_INFO_INDEX));
}
-Module Context::module() {
+SourceTextModule Context::module() {
Context current = *this;
while (!current.IsModuleContext()) {
current = current.previous();
}
- return Module::cast(current.extension());
+ return SourceTextModule::cast(current.extension());
}
JSGlobalObject Context::global_object() {
@@ -287,8 +287,10 @@ Handle<Object> Context::Lookup(Handle<Context> context, Handle<String> name,
VariableMode mode;
InitializationFlag flag;
MaybeAssignedFlag maybe_assigned_flag;
+ RequiresBrandCheckFlag requires_brand_check;
int slot_index = ScopeInfo::ContextSlotIndex(scope_info, *name, &mode,
- &flag, &maybe_assigned_flag);
+ &flag, &maybe_assigned_flag,
+ &requires_brand_check);
DCHECK(slot_index < 0 || slot_index >= MIN_CONTEXT_SLOTS);
if (slot_index >= 0) {
if (FLAG_trace_contexts) {
@@ -338,8 +340,8 @@ Handle<Object> Context::Lookup(Handle<Context> context, Handle<String> name,
*index = cell_index;
*variable_mode = mode;
*init_flag = flag;
- *attributes = ModuleDescriptor::GetCellIndexKind(cell_index) ==
- ModuleDescriptor::kExport
+ *attributes = SourceTextModuleDescriptor::GetCellIndexKind(
+ cell_index) == SourceTextModuleDescriptor::kExport
? GetAttributesForMode(mode)
: READ_ONLY;
return handle(context->module(), isolate);
@@ -394,31 +396,26 @@ Handle<Object> Context::Lookup(Handle<Context> context, Handle<String> name,
return Handle<Object>::null();
}
-void Context::AddOptimizedCode(Code code) {
- DCHECK(IsNativeContext());
+void NativeContext::AddOptimizedCode(Code code) {
DCHECK(code.kind() == Code::OPTIMIZED_FUNCTION);
DCHECK(code.next_code_link().IsUndefined());
code.set_next_code_link(get(OPTIMIZED_CODE_LIST));
set(OPTIMIZED_CODE_LIST, code, UPDATE_WEAK_WRITE_BARRIER);
}
-void Context::SetOptimizedCodeListHead(Object head) {
- DCHECK(IsNativeContext());
+void NativeContext::SetOptimizedCodeListHead(Object head) {
set(OPTIMIZED_CODE_LIST, head, UPDATE_WEAK_WRITE_BARRIER);
}
-Object Context::OptimizedCodeListHead() {
- DCHECK(IsNativeContext());
+Object NativeContext::OptimizedCodeListHead() {
return get(OPTIMIZED_CODE_LIST);
}
-void Context::SetDeoptimizedCodeListHead(Object head) {
- DCHECK(IsNativeContext());
+void NativeContext::SetDeoptimizedCodeListHead(Object head) {
set(DEOPTIMIZED_CODE_LIST, head, UPDATE_WEAK_WRITE_BARRIER);
}
-Object Context::DeoptimizedCodeListHead() {
- DCHECK(IsNativeContext());
+Object NativeContext::DeoptimizedCodeListHead() {
return get(DEOPTIMIZED_CODE_LIST);
}
@@ -474,19 +471,14 @@ bool Context::IsBootstrappingOrValidParentContext(Object object,
#endif
-void Context::ResetErrorsThrown() {
- DCHECK(IsNativeContext());
- set_errors_thrown(Smi::FromInt(0));
-}
-
-void Context::IncrementErrorsThrown() {
- DCHECK(IsNativeContext());
+void NativeContext::ResetErrorsThrown() { set_errors_thrown(Smi::FromInt(0)); }
+void NativeContext::IncrementErrorsThrown() {
int previous_value = errors_thrown().value();
set_errors_thrown(Smi::FromInt(previous_value + 1));
}
-int Context::GetErrorsThrown() { return errors_thrown().value(); }
+int NativeContext::GetErrorsThrown() { return errors_thrown().value(); }
STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 4);
STATIC_ASSERT(NativeContext::kScopeInfoOffset ==