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