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

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

Issue 2199283002: [modules] Introduce new VariableLocation for module imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment 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
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_IA32 5 #if V8_TARGET_ARCH_IA32
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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 747
748 case VariableLocation::LOOKUP: { 748 case VariableLocation::LOOKUP: {
749 Comment cmnt(masm_, "[ VariableDeclaration"); 749 Comment cmnt(masm_, "[ VariableDeclaration");
750 DCHECK_EQ(VAR, mode); 750 DCHECK_EQ(VAR, mode);
751 DCHECK(!hole_init); 751 DCHECK(!hole_init);
752 __ push(Immediate(variable->name())); 752 __ push(Immediate(variable->name()));
753 __ CallRuntime(Runtime::kDeclareEvalVar); 753 __ CallRuntime(Runtime::kDeclareEvalVar);
754 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 754 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
755 break; 755 break;
756 } 756 }
757
758 case VariableLocation::MODULE:
759 UNREACHABLE();
757 } 760 }
758 } 761 }
759 762
760 763
761 void FullCodeGenerator::VisitFunctionDeclaration( 764 void FullCodeGenerator::VisitFunctionDeclaration(
762 FunctionDeclaration* declaration) { 765 FunctionDeclaration* declaration) {
763 VariableProxy* proxy = declaration->proxy(); 766 VariableProxy* proxy = declaration->proxy();
764 Variable* variable = proxy->var(); 767 Variable* variable = proxy->var();
765 switch (variable->location()) { 768 switch (variable->location()) {
766 case VariableLocation::GLOBAL: 769 case VariableLocation::GLOBAL:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 } 805 }
803 806
804 case VariableLocation::LOOKUP: { 807 case VariableLocation::LOOKUP: {
805 Comment cmnt(masm_, "[ FunctionDeclaration"); 808 Comment cmnt(masm_, "[ FunctionDeclaration");
806 PushOperand(variable->name()); 809 PushOperand(variable->name());
807 VisitForStackValue(declaration->fun()); 810 VisitForStackValue(declaration->fun());
808 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); 811 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction);
809 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 812 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
810 break; 813 break;
811 } 814 }
815
816 case VariableLocation::MODULE:
817 UNREACHABLE();
812 } 818 }
813 } 819 }
814 820
815 821
816 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 822 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
817 // Call the runtime to declare the globals. 823 // Call the runtime to declare the globals.
818 __ Push(pairs); 824 __ Push(pairs);
819 __ Push(Smi::FromInt(DeclareGlobalsFlags())); 825 __ Push(Smi::FromInt(DeclareGlobalsFlags()));
820 __ EmitLoadTypeFeedbackVector(eax); 826 __ EmitLoadTypeFeedbackVector(eax);
821 __ Push(eax); 827 __ Push(eax);
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 __ push(Immediate(var->name())); 1280 __ push(Immediate(var->name()));
1275 Runtime::FunctionId function_id = 1281 Runtime::FunctionId function_id =
1276 typeof_mode == NOT_INSIDE_TYPEOF 1282 typeof_mode == NOT_INSIDE_TYPEOF
1277 ? Runtime::kLoadLookupSlot 1283 ? Runtime::kLoadLookupSlot
1278 : Runtime::kLoadLookupSlotInsideTypeof; 1284 : Runtime::kLoadLookupSlotInsideTypeof;
1279 __ CallRuntime(function_id); 1285 __ CallRuntime(function_id);
1280 __ bind(&done); 1286 __ bind(&done);
1281 context()->Plug(eax); 1287 context()->Plug(eax);
1282 break; 1288 break;
1283 } 1289 }
1290
1291 case VariableLocation::MODULE:
1292 UNREACHABLE();
1284 } 1293 }
1285 } 1294 }
1286 1295
1287 1296
1288 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { 1297 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) {
1289 Expression* expression = (property == NULL) ? NULL : property->value(); 1298 Expression* expression = (property == NULL) ? NULL : property->value();
1290 if (expression == NULL) { 1299 if (expression == NULL) {
1291 PushOperand(isolate()->factory()->null_value()); 1300 PushOperand(isolate()->factory()->null_value());
1292 } else { 1301 } else {
1293 VisitForStackValue(expression); 1302 VisitForStackValue(expression);
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
3671 isolate->builtins()->OnStackReplacement()->entry(), 3680 isolate->builtins()->OnStackReplacement()->entry(),
3672 Assembler::target_address_at(call_target_address, unoptimized_code)); 3681 Assembler::target_address_at(call_target_address, unoptimized_code));
3673 return ON_STACK_REPLACEMENT; 3682 return ON_STACK_REPLACEMENT;
3674 } 3683 }
3675 3684
3676 3685
3677 } // namespace internal 3686 } // namespace internal
3678 } // namespace v8 3687 } // namespace v8
3679 3688
3680 #endif // V8_TARGET_ARCH_IA32 3689 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698