OLD | NEW |
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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 | 756 |
757 case VariableLocation::LOOKUP: { | 757 case VariableLocation::LOOKUP: { |
758 Comment cmnt(masm_, "[ VariableDeclaration"); | 758 Comment cmnt(masm_, "[ VariableDeclaration"); |
759 DCHECK_EQ(VAR, variable->mode()); | 759 DCHECK_EQ(VAR, variable->mode()); |
760 DCHECK(!variable->binding_needs_init()); | 760 DCHECK(!variable->binding_needs_init()); |
761 __ Push(variable->name()); | 761 __ Push(variable->name()); |
762 __ CallRuntime(Runtime::kDeclareEvalVar); | 762 __ CallRuntime(Runtime::kDeclareEvalVar); |
763 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 763 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
764 break; | 764 break; |
765 } | 765 } |
| 766 |
| 767 case VariableLocation::MODULE: |
| 768 UNREACHABLE(); |
766 } | 769 } |
767 } | 770 } |
768 | 771 |
769 | 772 |
770 void FullCodeGenerator::VisitFunctionDeclaration( | 773 void FullCodeGenerator::VisitFunctionDeclaration( |
771 FunctionDeclaration* declaration) { | 774 FunctionDeclaration* declaration) { |
772 VariableProxy* proxy = declaration->proxy(); | 775 VariableProxy* proxy = declaration->proxy(); |
773 Variable* variable = proxy->var(); | 776 Variable* variable = proxy->var(); |
774 switch (variable->location()) { | 777 switch (variable->location()) { |
775 case VariableLocation::GLOBAL: | 778 case VariableLocation::GLOBAL: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 } | 815 } |
813 | 816 |
814 case VariableLocation::LOOKUP: { | 817 case VariableLocation::LOOKUP: { |
815 Comment cmnt(masm_, "[ FunctionDeclaration"); | 818 Comment cmnt(masm_, "[ FunctionDeclaration"); |
816 PushOperand(variable->name()); | 819 PushOperand(variable->name()); |
817 VisitForStackValue(declaration->fun()); | 820 VisitForStackValue(declaration->fun()); |
818 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 821 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
819 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 822 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
820 break; | 823 break; |
821 } | 824 } |
| 825 |
| 826 case VariableLocation::MODULE: |
| 827 UNREACHABLE(); |
822 } | 828 } |
823 } | 829 } |
824 | 830 |
825 | 831 |
826 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 832 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
827 // Call the runtime to declare the globals. | 833 // Call the runtime to declare the globals. |
828 __ Push(pairs); | 834 __ Push(pairs); |
829 __ Push(Smi::FromInt(DeclareGlobalsFlags())); | 835 __ Push(Smi::FromInt(DeclareGlobalsFlags())); |
830 __ EmitLoadTypeFeedbackVector(rax); | 836 __ EmitLoadTypeFeedbackVector(rax); |
831 __ Push(rax); | 837 __ Push(rax); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 __ Push(var->name()); | 1304 __ Push(var->name()); |
1299 Runtime::FunctionId function_id = | 1305 Runtime::FunctionId function_id = |
1300 typeof_mode == NOT_INSIDE_TYPEOF | 1306 typeof_mode == NOT_INSIDE_TYPEOF |
1301 ? Runtime::kLoadLookupSlot | 1307 ? Runtime::kLoadLookupSlot |
1302 : Runtime::kLoadLookupSlotInsideTypeof; | 1308 : Runtime::kLoadLookupSlotInsideTypeof; |
1303 __ CallRuntime(function_id); | 1309 __ CallRuntime(function_id); |
1304 __ bind(&done); | 1310 __ bind(&done); |
1305 context()->Plug(rax); | 1311 context()->Plug(rax); |
1306 break; | 1312 break; |
1307 } | 1313 } |
| 1314 |
| 1315 case VariableLocation::MODULE: |
| 1316 UNREACHABLE(); |
1308 } | 1317 } |
1309 } | 1318 } |
1310 | 1319 |
1311 | 1320 |
1312 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1321 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1313 Expression* expression = (property == NULL) ? NULL : property->value(); | 1322 Expression* expression = (property == NULL) ? NULL : property->value(); |
1314 if (expression == NULL) { | 1323 if (expression == NULL) { |
1315 OperandStackDepthIncrement(1); | 1324 OperandStackDepthIncrement(1); |
1316 __ PushRoot(Heap::kNullValueRootIndex); | 1325 __ PushRoot(Heap::kNullValueRootIndex); |
1317 } else { | 1326 } else { |
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3652 DCHECK_EQ( | 3661 DCHECK_EQ( |
3653 isolate->builtins()->OnStackReplacement()->entry(), | 3662 isolate->builtins()->OnStackReplacement()->entry(), |
3654 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3663 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3655 return ON_STACK_REPLACEMENT; | 3664 return ON_STACK_REPLACEMENT; |
3656 } | 3665 } |
3657 | 3666 |
3658 } // namespace internal | 3667 } // namespace internal |
3659 } // namespace v8 | 3668 } // namespace v8 |
3660 | 3669 |
3661 #endif // V8_TARGET_ARCH_X64 | 3670 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |