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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 case VariableLocation::LOOKUP: { | 746 case VariableLocation::LOOKUP: { |
747 Comment cmnt(masm_, "[ VariableDeclaration"); | 747 Comment cmnt(masm_, "[ VariableDeclaration"); |
748 DCHECK_EQ(VAR, mode); | 748 DCHECK_EQ(VAR, mode); |
749 DCHECK(!hole_init); | 749 DCHECK(!hole_init); |
750 __ push(Immediate(variable->name())); | 750 __ push(Immediate(variable->name())); |
751 __ CallRuntime(Runtime::kDeclareEvalVar); | 751 __ CallRuntime(Runtime::kDeclareEvalVar); |
752 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 752 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
753 break; | 753 break; |
754 } | 754 } |
| 755 |
| 756 case VariableLocation::MODULE: |
| 757 UNREACHABLE(); |
755 } | 758 } |
756 } | 759 } |
757 | 760 |
758 void FullCodeGenerator::VisitFunctionDeclaration( | 761 void FullCodeGenerator::VisitFunctionDeclaration( |
759 FunctionDeclaration* declaration) { | 762 FunctionDeclaration* declaration) { |
760 VariableProxy* proxy = declaration->proxy(); | 763 VariableProxy* proxy = declaration->proxy(); |
761 Variable* variable = proxy->var(); | 764 Variable* variable = proxy->var(); |
762 switch (variable->location()) { | 765 switch (variable->location()) { |
763 case VariableLocation::GLOBAL: | 766 case VariableLocation::GLOBAL: |
764 case VariableLocation::UNALLOCATED: { | 767 case VariableLocation::UNALLOCATED: { |
(...skipping 30 matching lines...) Expand all Loading... |
795 } | 798 } |
796 | 799 |
797 case VariableLocation::LOOKUP: { | 800 case VariableLocation::LOOKUP: { |
798 Comment cmnt(masm_, "[ FunctionDeclaration"); | 801 Comment cmnt(masm_, "[ FunctionDeclaration"); |
799 PushOperand(variable->name()); | 802 PushOperand(variable->name()); |
800 VisitForStackValue(declaration->fun()); | 803 VisitForStackValue(declaration->fun()); |
801 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 804 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
802 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 805 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
803 break; | 806 break; |
804 } | 807 } |
| 808 |
| 809 case VariableLocation::MODULE: |
| 810 UNREACHABLE(); |
805 } | 811 } |
806 } | 812 } |
807 | 813 |
808 | 814 |
809 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 815 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
810 // Call the runtime to declare the globals. | 816 // Call the runtime to declare the globals. |
811 __ Push(pairs); | 817 __ Push(pairs); |
812 __ Push(Smi::FromInt(DeclareGlobalsFlags())); | 818 __ Push(Smi::FromInt(DeclareGlobalsFlags())); |
813 __ EmitLoadTypeFeedbackVector(eax); | 819 __ EmitLoadTypeFeedbackVector(eax); |
814 __ Push(eax); | 820 __ Push(eax); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 __ push(Immediate(var->name())); | 1273 __ push(Immediate(var->name())); |
1268 Runtime::FunctionId function_id = | 1274 Runtime::FunctionId function_id = |
1269 typeof_mode == NOT_INSIDE_TYPEOF | 1275 typeof_mode == NOT_INSIDE_TYPEOF |
1270 ? Runtime::kLoadLookupSlot | 1276 ? Runtime::kLoadLookupSlot |
1271 : Runtime::kLoadLookupSlotInsideTypeof; | 1277 : Runtime::kLoadLookupSlotInsideTypeof; |
1272 __ CallRuntime(function_id); | 1278 __ CallRuntime(function_id); |
1273 __ bind(&done); | 1279 __ bind(&done); |
1274 context()->Plug(eax); | 1280 context()->Plug(eax); |
1275 break; | 1281 break; |
1276 } | 1282 } |
| 1283 |
| 1284 case VariableLocation::MODULE: |
| 1285 UNREACHABLE(); |
1277 } | 1286 } |
1278 } | 1287 } |
1279 | 1288 |
1280 | 1289 |
1281 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1290 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1282 Expression* expression = (property == NULL) ? NULL : property->value(); | 1291 Expression* expression = (property == NULL) ? NULL : property->value(); |
1283 if (expression == NULL) { | 1292 if (expression == NULL) { |
1284 PushOperand(isolate()->factory()->null_value()); | 1293 PushOperand(isolate()->factory()->null_value()); |
1285 } else { | 1294 } else { |
1286 VisitForStackValue(expression); | 1295 VisitForStackValue(expression); |
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3669 isolate->builtins()->OnStackReplacement()->entry(), | 3678 isolate->builtins()->OnStackReplacement()->entry(), |
3670 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3679 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3671 return ON_STACK_REPLACEMENT; | 3680 return ON_STACK_REPLACEMENT; |
3672 } | 3681 } |
3673 | 3682 |
3674 | 3683 |
3675 } // namespace internal | 3684 } // namespace internal |
3676 } // namespace v8 | 3685 } // namespace v8 |
3677 | 3686 |
3678 #endif // V8_TARGET_ARCH_X87 | 3687 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |