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