Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/scopeinfo.cc

Issue 1219993002: Remove unused is_class_scope bit from Scope and ScopeInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | src/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/scopeinfo.h" 10 #include "src/scopeinfo.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // Encode the flags. 82 // Encode the flags.
83 int flags = ScopeTypeField::encode(scope->scope_type()) | 83 int flags = ScopeTypeField::encode(scope->scope_type()) |
84 CallsEvalField::encode(scope->calls_eval()) | 84 CallsEvalField::encode(scope->calls_eval()) |
85 LanguageModeField::encode(scope->language_mode()) | 85 LanguageModeField::encode(scope->language_mode()) |
86 ReceiverVariableField::encode(receiver_info) | 86 ReceiverVariableField::encode(receiver_info) |
87 FunctionVariableField::encode(function_name_info) | 87 FunctionVariableField::encode(function_name_info) |
88 FunctionVariableMode::encode(function_variable_mode) | 88 FunctionVariableMode::encode(function_variable_mode) |
89 AsmModuleField::encode(scope->asm_module()) | 89 AsmModuleField::encode(scope->asm_module()) |
90 AsmFunctionField::encode(scope->asm_function()) | 90 AsmFunctionField::encode(scope->asm_function()) |
91 IsSimpleParameterListField::encode(simple_parameter_list) | 91 IsSimpleParameterListField::encode(simple_parameter_list) |
92 BlockScopeIsClassScopeField::encode(scope->is_class_scope()) |
93 FunctionKindField::encode(scope->function_kind()); 92 FunctionKindField::encode(scope->function_kind());
94 scope_info->SetFlags(flags); 93 scope_info->SetFlags(flags);
95 scope_info->SetParameterCount(parameter_count); 94 scope_info->SetParameterCount(parameter_count);
96 scope_info->SetStackLocalCount(stack_local_count); 95 scope_info->SetStackLocalCount(stack_local_count);
97 scope_info->SetContextLocalCount(context_local_count); 96 scope_info->SetContextLocalCount(context_local_count);
98 scope_info->SetStrongModeFreeVariableCount(strong_mode_free_variable_count); 97 scope_info->SetStrongModeFreeVariableCount(strong_mode_free_variable_count);
99 98
100 int index = kVariablePartIndex; 99 int index = kVariablePartIndex;
101 // Add parameters. 100 // Add parameters.
102 DCHECK(index == scope_info->ParameterEntriesIndex()); 101 DCHECK(index == scope_info->ParameterEntriesIndex());
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 215
217 // Encode the flags. 216 // Encode the flags.
218 int flags = ScopeTypeField::encode(SCRIPT_SCOPE) | 217 int flags = ScopeTypeField::encode(SCRIPT_SCOPE) |
219 CallsEvalField::encode(false) | 218 CallsEvalField::encode(false) |
220 LanguageModeField::encode(SLOPPY) | 219 LanguageModeField::encode(SLOPPY) |
221 ReceiverVariableField::encode(receiver_info) | 220 ReceiverVariableField::encode(receiver_info) |
222 FunctionVariableField::encode(function_name_info) | 221 FunctionVariableField::encode(function_name_info) |
223 FunctionVariableMode::encode(function_variable_mode) | 222 FunctionVariableMode::encode(function_variable_mode) |
224 AsmModuleField::encode(false) | AsmFunctionField::encode(false) | 223 AsmModuleField::encode(false) | AsmFunctionField::encode(false) |
225 IsSimpleParameterListField::encode(simple_parameter_list) | 224 IsSimpleParameterListField::encode(simple_parameter_list) |
226 BlockScopeIsClassScopeField::encode(false) |
227 FunctionKindField::encode(FunctionKind::kNormalFunction); 225 FunctionKindField::encode(FunctionKind::kNormalFunction);
228 scope_info->SetFlags(flags); 226 scope_info->SetFlags(flags);
229 scope_info->SetParameterCount(parameter_count); 227 scope_info->SetParameterCount(parameter_count);
230 scope_info->SetStackLocalCount(stack_local_count); 228 scope_info->SetStackLocalCount(stack_local_count);
231 scope_info->SetContextLocalCount(context_local_count); 229 scope_info->SetContextLocalCount(context_local_count);
232 scope_info->SetStrongModeFreeVariableCount(strong_mode_free_variable_count); 230 scope_info->SetStrongModeFreeVariableCount(strong_mode_free_variable_count);
233 231
234 int index = kVariablePartIndex; 232 int index = kVariablePartIndex;
235 const int first_slot_index = 0; 233 const int first_slot_index = 0;
236 DCHECK(index == scope_info->StackLocalFirstSlotIndex()); 234 DCHECK(index == scope_info->StackLocalFirstSlotIndex());
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if (FunctionVariableField::decode(Flags()) == CONTEXT && 558 if (FunctionVariableField::decode(Flags()) == CONTEXT &&
561 FunctionName() == name) { 559 FunctionName() == name) {
562 *mode = FunctionVariableMode::decode(Flags()); 560 *mode = FunctionVariableMode::decode(Flags());
563 return Smi::cast(get(FunctionNameEntryIndex() + 1))->value(); 561 return Smi::cast(get(FunctionNameEntryIndex() + 1))->value();
564 } 562 }
565 } 563 }
566 return -1; 564 return -1;
567 } 565 }
568 566
569 567
570 bool ScopeInfo::block_scope_is_class_scope() {
571 return BlockScopeIsClassScopeField::decode(Flags());
572 }
573
574
575 FunctionKind ScopeInfo::function_kind() { 568 FunctionKind ScopeInfo::function_kind() {
576 return FunctionKindField::decode(Flags()); 569 return FunctionKindField::decode(Flags());
577 } 570 }
578 571
579 572
580 void ScopeInfo::CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info, 573 void ScopeInfo::CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info,
581 Handle<Context> context, 574 Handle<Context> context,
582 Handle<JSObject> scope_object) { 575 Handle<JSObject> scope_object) {
583 Isolate* isolate = scope_info->GetIsolate(); 576 Isolate* isolate = scope_info->GetIsolate();
584 int local_count = scope_info->ContextLocalCount(); 577 int local_count = scope_info->ContextLocalCount();
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 info->set_mode(i, var->mode()); 782 info->set_mode(i, var->mode());
790 DCHECK(var->index() >= 0); 783 DCHECK(var->index() >= 0);
791 info->set_index(i, var->index()); 784 info->set_index(i, var->index());
792 } 785 }
793 DCHECK(i == info->length()); 786 DCHECK(i == info->length());
794 return info; 787 return info;
795 } 788 }
796 789
797 } // namespace internal 790 } // namespace internal
798 } // namespace v8 791 } // namespace v8
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698