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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 2199283002: [modules] Introduce new VariableLocation for module imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 4 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/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 case VariableLocation::LOOKUP: { 796 case VariableLocation::LOOKUP: {
797 Comment cmnt(masm_, "[ VariableDeclaration"); 797 Comment cmnt(masm_, "[ VariableDeclaration");
798 DCHECK_EQ(VAR, variable->mode()); 798 DCHECK_EQ(VAR, variable->mode());
799 DCHECK(!variable->binding_needs_init()); 799 DCHECK(!variable->binding_needs_init());
800 __ mov(r2, Operand(variable->name())); 800 __ mov(r2, Operand(variable->name()));
801 __ Push(r2); 801 __ Push(r2);
802 __ CallRuntime(Runtime::kDeclareEvalVar); 802 __ CallRuntime(Runtime::kDeclareEvalVar);
803 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 803 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
804 break; 804 break;
805 } 805 }
806
807 case VariableLocation::MODULE:
808 UNREACHABLE();
806 } 809 }
807 } 810 }
808 811
809 812
810 void FullCodeGenerator::VisitFunctionDeclaration( 813 void FullCodeGenerator::VisitFunctionDeclaration(
811 FunctionDeclaration* declaration) { 814 FunctionDeclaration* declaration) {
812 VariableProxy* proxy = declaration->proxy(); 815 VariableProxy* proxy = declaration->proxy();
813 Variable* variable = proxy->var(); 816 Variable* variable = proxy->var();
814 switch (variable->location()) { 817 switch (variable->location()) {
815 case VariableLocation::GLOBAL: 818 case VariableLocation::GLOBAL:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 case VariableLocation::LOOKUP: { 858 case VariableLocation::LOOKUP: {
856 Comment cmnt(masm_, "[ FunctionDeclaration"); 859 Comment cmnt(masm_, "[ FunctionDeclaration");
857 __ mov(r2, Operand(variable->name())); 860 __ mov(r2, Operand(variable->name()));
858 PushOperand(r2); 861 PushOperand(r2);
859 // Push initial value for function declaration. 862 // Push initial value for function declaration.
860 VisitForStackValue(declaration->fun()); 863 VisitForStackValue(declaration->fun());
861 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); 864 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction);
862 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 865 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
863 break; 866 break;
864 } 867 }
868
869 case VariableLocation::MODULE:
870 UNREACHABLE();
865 } 871 }
866 } 872 }
867 873
868 874
869 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 875 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
870 // Call the runtime to declare the globals. 876 // Call the runtime to declare the globals.
871 __ mov(r1, Operand(pairs)); 877 __ mov(r1, Operand(pairs));
872 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); 878 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
873 __ EmitLoadTypeFeedbackVector(r2); 879 __ EmitLoadTypeFeedbackVector(r2);
874 __ Push(r1, r0, r2); 880 __ Push(r1, r0, r2);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); 1349 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done);
1344 __ bind(&slow); 1350 __ bind(&slow);
1345 __ Push(var->name()); 1351 __ Push(var->name());
1346 Runtime::FunctionId function_id = 1352 Runtime::FunctionId function_id =
1347 typeof_mode == NOT_INSIDE_TYPEOF 1353 typeof_mode == NOT_INSIDE_TYPEOF
1348 ? Runtime::kLoadLookupSlot 1354 ? Runtime::kLoadLookupSlot
1349 : Runtime::kLoadLookupSlotInsideTypeof; 1355 : Runtime::kLoadLookupSlotInsideTypeof;
1350 __ CallRuntime(function_id); 1356 __ CallRuntime(function_id);
1351 __ bind(&done); 1357 __ bind(&done);
1352 context()->Plug(r0); 1358 context()->Plug(r0);
1359 break;
1353 } 1360 }
1361
1362 case VariableLocation::MODULE:
1363 UNREACHABLE();
1354 } 1364 }
1355 } 1365 }
1356 1366
1357 1367
1358 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { 1368 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) {
1359 Expression* expression = (property == NULL) ? NULL : property->value(); 1369 Expression* expression = (property == NULL) ? NULL : property->value();
1360 if (expression == NULL) { 1370 if (expression == NULL) {
1361 __ LoadRoot(r1, Heap::kNullValueRootIndex); 1371 __ LoadRoot(r1, Heap::kNullValueRootIndex);
1362 PushOperand(r1); 1372 PushOperand(r1);
1363 } else { 1373 } else {
(...skipping 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after
3828 DCHECK(interrupt_address == 3838 DCHECK(interrupt_address ==
3829 isolate->builtins()->OnStackReplacement()->entry()); 3839 isolate->builtins()->OnStackReplacement()->entry());
3830 return ON_STACK_REPLACEMENT; 3840 return ON_STACK_REPLACEMENT;
3831 } 3841 }
3832 3842
3833 3843
3834 } // namespace internal 3844 } // namespace internal
3835 } // namespace v8 3845 } // namespace v8
3836 3846
3837 #endif // V8_TARGET_ARCH_ARM 3847 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698