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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 case VariableLocation::LOOKUP: { 794 case VariableLocation::LOOKUP: {
795 Comment cmnt(masm_, "[ VariableDeclaration"); 795 Comment cmnt(masm_, "[ VariableDeclaration");
796 DCHECK_EQ(VAR, mode); 796 DCHECK_EQ(VAR, mode);
797 DCHECK(!hole_init); 797 DCHECK(!hole_init);
798 __ li(a2, Operand(variable->name())); 798 __ li(a2, Operand(variable->name()));
799 __ Push(a2); 799 __ Push(a2);
800 __ CallRuntime(Runtime::kDeclareEvalVar); 800 __ CallRuntime(Runtime::kDeclareEvalVar);
801 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 801 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
802 break; 802 break;
803 } 803 }
804
805 case VariableLocation::MODULE:
806 UNREACHABLE();
804 } 807 }
805 } 808 }
806 809
807 810
808 void FullCodeGenerator::VisitFunctionDeclaration( 811 void FullCodeGenerator::VisitFunctionDeclaration(
809 FunctionDeclaration* declaration) { 812 FunctionDeclaration* declaration) {
810 VariableProxy* proxy = declaration->proxy(); 813 VariableProxy* proxy = declaration->proxy();
811 Variable* variable = proxy->var(); 814 Variable* variable = proxy->var();
812 switch (variable->location()) { 815 switch (variable->location()) {
813 case VariableLocation::GLOBAL: 816 case VariableLocation::GLOBAL:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 case VariableLocation::LOOKUP: { 856 case VariableLocation::LOOKUP: {
854 Comment cmnt(masm_, "[ FunctionDeclaration"); 857 Comment cmnt(masm_, "[ FunctionDeclaration");
855 __ li(a2, Operand(variable->name())); 858 __ li(a2, Operand(variable->name()));
856 PushOperand(a2); 859 PushOperand(a2);
857 // Push initial value for function declaration. 860 // Push initial value for function declaration.
858 VisitForStackValue(declaration->fun()); 861 VisitForStackValue(declaration->fun());
859 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); 862 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction);
860 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 863 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
861 break; 864 break;
862 } 865 }
866
867 case VariableLocation::MODULE:
868 UNREACHABLE();
863 } 869 }
864 } 870 }
865 871
866 872
867 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 873 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
868 // Call the runtime to declare the globals. 874 // Call the runtime to declare the globals.
869 __ li(a1, Operand(pairs)); 875 __ li(a1, Operand(pairs));
870 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); 876 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
871 __ EmitLoadTypeFeedbackVector(a2); 877 __ EmitLoadTypeFeedbackVector(a2);
872 __ Push(a1, a0, a2); 878 __ Push(a1, a0, a2);
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); 1352 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done);
1347 __ bind(&slow); 1353 __ bind(&slow);
1348 __ Push(var->name()); 1354 __ Push(var->name());
1349 Runtime::FunctionId function_id = 1355 Runtime::FunctionId function_id =
1350 typeof_mode == NOT_INSIDE_TYPEOF 1356 typeof_mode == NOT_INSIDE_TYPEOF
1351 ? Runtime::kLoadLookupSlot 1357 ? Runtime::kLoadLookupSlot
1352 : Runtime::kLoadLookupSlotInsideTypeof; 1358 : Runtime::kLoadLookupSlotInsideTypeof;
1353 __ CallRuntime(function_id); 1359 __ CallRuntime(function_id);
1354 __ bind(&done); 1360 __ bind(&done);
1355 context()->Plug(v0); 1361 context()->Plug(v0);
1362 break;
1356 } 1363 }
1364
1365 case VariableLocation::MODULE:
1366 UNREACHABLE();
1357 } 1367 }
1358 } 1368 }
1359 1369
1360 1370
1361 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { 1371 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) {
1362 Expression* expression = (property == NULL) ? NULL : property->value(); 1372 Expression* expression = (property == NULL) ? NULL : property->value();
1363 if (expression == NULL) { 1373 if (expression == NULL) {
1364 __ LoadRoot(a1, Heap::kNullValueRootIndex); 1374 __ LoadRoot(a1, Heap::kNullValueRootIndex);
1365 PushOperand(a1); 1375 PushOperand(a1);
1366 } else { 1376 } else {
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
3787 reinterpret_cast<uint64_t>( 3797 reinterpret_cast<uint64_t>(
3788 isolate->builtins()->OnStackReplacement()->entry())); 3798 isolate->builtins()->OnStackReplacement()->entry()));
3789 return ON_STACK_REPLACEMENT; 3799 return ON_STACK_REPLACEMENT;
3790 } 3800 }
3791 3801
3792 3802
3793 } // namespace internal 3803 } // namespace internal
3794 } // namespace v8 3804 } // namespace v8
3795 3805
3796 #endif // V8_TARGET_ARCH_MIPS64 3806 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698