| Index: src/ast/scopeinfo.cc
|
| diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
|
| index cb7409a9d2c3f7cc38067791b616625cf62b805c..8532237821aa996e88af0664398ec9029e16677e 100644
|
| --- a/src/ast/scopeinfo.cc
|
| +++ b/src/ast/scopeinfo.cc
|
| @@ -241,16 +241,15 @@ Handle<ScopeInfo> ScopeInfo::CreateGlobalThisBinding(Isolate* isolate) {
|
| Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length);
|
|
|
| // Encode the flags.
|
| - int flags = ScopeTypeField::encode(SCRIPT_SCOPE) |
|
| - CallsEvalField::encode(false) |
|
| - LanguageModeField::encode(SLOPPY) |
|
| - DeclarationScopeField::encode(true) |
|
| - ReceiverVariableField::encode(receiver_info) |
|
| - FunctionVariableField::encode(function_name_info) |
|
| - FunctionVariableMode::encode(function_variable_mode) |
|
| - AsmModuleField::encode(false) | AsmFunctionField::encode(false) |
|
| - HasSimpleParametersField::encode(has_simple_parameters) |
|
| - FunctionKindField::encode(FunctionKind::kNormalFunction);
|
| + int flags =
|
| + ScopeTypeField::encode(SCRIPT_SCOPE) | CallsEvalField::encode(false) |
|
| + LanguageModeField::encode(SLOPPY) | DeclarationScopeField::encode(true) |
|
| + ReceiverVariableField::encode(receiver_info) |
|
| + FunctionVariableField::encode(function_name_info) |
|
| + FunctionVariableMode::encode(function_variable_mode) |
|
| + AsmModuleField::encode(false) | AsmFunctionField::encode(false) |
|
| + HasSimpleParametersField::encode(has_simple_parameters) |
|
| + FunctionKindField::encode(FunctionKind::kNormalFunction);
|
| scope_info->SetFlags(flags);
|
| scope_info->SetParameterCount(parameter_count);
|
| scope_info->SetStackLocalCount(stack_local_count);
|
| @@ -317,9 +316,7 @@ bool ScopeInfo::is_declaration_scope() {
|
| }
|
|
|
|
|
| -int ScopeInfo::LocalCount() {
|
| - return StackLocalCount() + ContextLocalCount();
|
| -}
|
| +int ScopeInfo::LocalCount() { return StackLocalCount() + ContextLocalCount(); }
|
|
|
|
|
| int ScopeInfo::StackSlotCount() {
|
| @@ -342,7 +339,7 @@ int ScopeInfo::ContextLength() {
|
| function_name_context_slot ||
|
| scope_type() == WITH_SCOPE ||
|
| (scope_type() == BLOCK_SCOPE && CallsSloppyEval() &&
|
| - is_declaration_scope()) ||
|
| + is_declaration_scope()) ||
|
| (scope_type() == FUNCTION_SCOPE && CallsSloppyEval()) ||
|
| scope_type() == MODULE_SCOPE;
|
|
|
| @@ -392,9 +389,7 @@ bool ScopeInfo::HasHeapAllocatedLocals() {
|
| }
|
|
|
|
|
| -bool ScopeInfo::HasContext() {
|
| - return ContextLength() > 0;
|
| -}
|
| +bool ScopeInfo::HasContext() { return ContextLength() > 0; }
|
|
|
|
|
| String* ScopeInfo::FunctionName() {
|
| @@ -739,15 +734,16 @@ void ContextSlotCache::Update(Handle<Object> data, Handle<String> name,
|
| DisallowHeapAllocation no_gc;
|
| Handle<String> internalized_name;
|
| DCHECK(slot_index > kNotFound);
|
| - if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name).
|
| - ToHandle(&internalized_name)) {
|
| + if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name)
|
| + .ToHandle(&internalized_name)) {
|
| int index = Hash(*data, *internalized_name);
|
| Key& key = keys_[index];
|
| key.data = *data;
|
| key.name = *internalized_name;
|
| // Please note value only takes a uint as index.
|
| - values_[index] = Value(mode, init_flag, maybe_assigned_flag,
|
| - slot_index - kNotFound).raw();
|
| + values_[index] =
|
| + Value(mode, init_flag, maybe_assigned_flag, slot_index - kNotFound)
|
| + .raw();
|
| #ifdef DEBUG
|
| ValidateEntry(data, name, mode, init_flag, maybe_assigned_flag, slot_index);
|
| #endif
|
| @@ -769,8 +765,8 @@ void ContextSlotCache::ValidateEntry(Handle<Object> data, Handle<String> name,
|
| int slot_index) {
|
| DisallowHeapAllocation no_gc;
|
| Handle<String> internalized_name;
|
| - if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name).
|
| - ToHandle(&internalized_name)) {
|
| + if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name)
|
| + .ToHandle(&internalized_name)) {
|
| int index = Hash(*data, *name);
|
| Key& key = keys_[index];
|
| DCHECK(key.data == *data);
|
| @@ -784,15 +780,12 @@ void ContextSlotCache::ValidateEntry(Handle<Object> data, Handle<String> name,
|
| }
|
|
|
|
|
| -static void PrintList(const char* list_name,
|
| - int nof_internal_slots,
|
| - int start,
|
| - int end,
|
| - ScopeInfo* scope_info) {
|
| +static void PrintList(const char* list_name, int nof_internal_slots, int start,
|
| + int end, ScopeInfo* scope_info) {
|
| if (start < end) {
|
| PrintF("\n // %s\n", list_name);
|
| if (nof_internal_slots > 0) {
|
| - PrintF(" %2d - %2d [internal slots]\n", 0 , nof_internal_slots - 1);
|
| + PrintF(" %2d - %2d [internal slots]\n", 0, nof_internal_slots - 1);
|
| }
|
| for (int i = nof_internal_slots; start < end; ++i, ++start) {
|
| PrintF(" %2d ", i);
|
|
|