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