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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2457393003: Thread decls-list through Declaration (Closed)
Patch Set: rebase Created 4 years, 1 month 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/interpreter/bytecode-generator.h ('k') | src/parsing/parser.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 "src/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-info.h" 10 #include "src/compilation-info.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 ->LoadLiteral(Smi::FromInt(entry->module_request)) 900 ->LoadLiteral(Smi::FromInt(entry->module_request))
901 .StoreAccumulatorInRegister(module_request) 901 .StoreAccumulatorInRegister(module_request)
902 .CallRuntime(Runtime::kGetModuleNamespace, module_request); 902 .CallRuntime(Runtime::kGetModuleNamespace, module_request);
903 Variable* var = scope()->LookupLocal(entry->local_name); 903 Variable* var = scope()->LookupLocal(entry->local_name);
904 DCHECK_NOT_NULL(var); 904 DCHECK_NOT_NULL(var);
905 BuildVariableAssignment(var, Token::INIT, FeedbackVectorSlot::Invalid(), 905 BuildVariableAssignment(var, Token::INIT, FeedbackVectorSlot::Invalid(),
906 HoleCheckMode::kElided); 906 HoleCheckMode::kElided);
907 } 907 }
908 } 908 }
909 909
910 void BytecodeGenerator::VisitDeclarations( 910 void BytecodeGenerator::VisitDeclarations(Declaration::List* declarations) {
911 ZoneList<Declaration*>* declarations) {
912 RegisterAllocationScope register_scope(this); 911 RegisterAllocationScope register_scope(this);
913 DCHECK(globals_builder()->empty()); 912 DCHECK(globals_builder()->empty());
914 for (int i = 0; i < declarations->length(); i++) { 913 for (Declaration* decl : *declarations) {
915 RegisterAllocationScope register_scope(this); 914 RegisterAllocationScope register_scope(this);
916 Visit(declarations->at(i)); 915 Visit(decl);
917 } 916 }
918 if (globals_builder()->empty()) return; 917 if (globals_builder()->empty()) return;
919 918
920 globals_builder()->set_constant_pool_entry( 919 globals_builder()->set_constant_pool_entry(
921 builder()->AllocateConstantPoolEntry()); 920 builder()->AllocateConstantPoolEntry());
922 int encoded_flags = info()->GetDeclareGlobalsFlags(); 921 int encoded_flags = info()->GetDeclareGlobalsFlags();
923 922
924 // Emit code to declare globals. 923 // Emit code to declare globals.
925 RegisterList args = register_allocator()->NewRegisterList(3); 924 RegisterList args = register_allocator()->NewRegisterList(3);
926 builder() 925 builder()
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 } 3216 }
3218 3217
3219 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3218 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3220 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3219 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3221 : Runtime::kStoreKeyedToSuper_Sloppy; 3220 : Runtime::kStoreKeyedToSuper_Sloppy;
3222 } 3221 }
3223 3222
3224 } // namespace interpreter 3223 } // namespace interpreter
3225 } // namespace internal 3224 } // namespace internal
3226 } // namespace v8 3225 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698