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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 case VariableLocation::LOOKUP: { 766 case VariableLocation::LOOKUP: {
767 Comment cmnt(masm_, "[ VariableDeclaration"); 767 Comment cmnt(masm_, "[ VariableDeclaration");
768 DCHECK_EQ(VAR, mode); 768 DCHECK_EQ(VAR, mode);
769 DCHECK(!hole_init); 769 DCHECK(!hole_init);
770 __ mov(r5, Operand(variable->name())); 770 __ mov(r5, Operand(variable->name()));
771 __ Push(r5); 771 __ Push(r5);
772 __ CallRuntime(Runtime::kDeclareEvalVar); 772 __ CallRuntime(Runtime::kDeclareEvalVar);
773 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 773 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
774 break; 774 break;
775 } 775 }
776
777 case VariableLocation::MODULE:
778 UNREACHABLE();
776 } 779 }
777 } 780 }
778 781
779 782
780 void FullCodeGenerator::VisitFunctionDeclaration( 783 void FullCodeGenerator::VisitFunctionDeclaration(
781 FunctionDeclaration* declaration) { 784 FunctionDeclaration* declaration) {
782 VariableProxy* proxy = declaration->proxy(); 785 VariableProxy* proxy = declaration->proxy();
783 Variable* variable = proxy->var(); 786 Variable* variable = proxy->var();
784 switch (variable->location()) { 787 switch (variable->location()) {
785 case VariableLocation::GLOBAL: 788 case VariableLocation::GLOBAL:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 case VariableLocation::LOOKUP: { 824 case VariableLocation::LOOKUP: {
822 Comment cmnt(masm_, "[ FunctionDeclaration"); 825 Comment cmnt(masm_, "[ FunctionDeclaration");
823 __ mov(r5, Operand(variable->name())); 826 __ mov(r5, Operand(variable->name()));
824 PushOperand(r5); 827 PushOperand(r5);
825 // Push initial value for function declaration. 828 // Push initial value for function declaration.
826 VisitForStackValue(declaration->fun()); 829 VisitForStackValue(declaration->fun());
827 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); 830 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction);
828 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); 831 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
829 break; 832 break;
830 } 833 }
834
835 case VariableLocation::MODULE:
836 UNREACHABLE();
831 } 837 }
832 } 838 }
833 839
834 840
835 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 841 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
836 // Call the runtime to declare the globals. 842 // Call the runtime to declare the globals.
837 __ mov(r4, Operand(pairs)); 843 __ mov(r4, Operand(pairs));
838 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); 844 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags()));
839 __ EmitLoadTypeFeedbackVector(r5); 845 __ EmitLoadTypeFeedbackVector(r5);
840 __ Push(r4, r3, r5); 846 __ Push(r4, r3, r5);
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); 1323 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done);
1318 __ bind(&slow); 1324 __ bind(&slow);
1319 __ Push(var->name()); 1325 __ Push(var->name());
1320 Runtime::FunctionId function_id = 1326 Runtime::FunctionId function_id =
1321 typeof_mode == NOT_INSIDE_TYPEOF 1327 typeof_mode == NOT_INSIDE_TYPEOF
1322 ? Runtime::kLoadLookupSlot 1328 ? Runtime::kLoadLookupSlot
1323 : Runtime::kLoadLookupSlotInsideTypeof; 1329 : Runtime::kLoadLookupSlotInsideTypeof;
1324 __ CallRuntime(function_id); 1330 __ CallRuntime(function_id);
1325 __ bind(&done); 1331 __ bind(&done);
1326 context()->Plug(r3); 1332 context()->Plug(r3);
1333 break;
1327 } 1334 }
1335
1336 case VariableLocation::MODULE:
1337 UNREACHABLE();
1328 } 1338 }
1329 } 1339 }
1330 1340
1331 1341
1332 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { 1342 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) {
1333 Expression* expression = (property == NULL) ? NULL : property->value(); 1343 Expression* expression = (property == NULL) ? NULL : property->value();
1334 if (expression == NULL) { 1344 if (expression == NULL) {
1335 __ LoadRoot(r4, Heap::kNullValueRootIndex); 1345 __ LoadRoot(r4, Heap::kNullValueRootIndex);
1336 PushOperand(r4); 1346 PushOperand(r4);
1337 } else { 1347 } else {
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3765 3775
3766 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); 3776 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address)));
3767 3777
3768 DCHECK(interrupt_address == 3778 DCHECK(interrupt_address ==
3769 isolate->builtins()->OnStackReplacement()->entry()); 3779 isolate->builtins()->OnStackReplacement()->entry());
3770 return ON_STACK_REPLACEMENT; 3780 return ON_STACK_REPLACEMENT;
3771 } 3781 }
3772 } // namespace internal 3782 } // namespace internal
3773 } // namespace v8 3783 } // namespace v8
3774 #endif // V8_TARGET_ARCH_PPC 3784 #endif // V8_TARGET_ARCH_PPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698