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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 a1, Operand(t0)); | 753 a1, Operand(t0)); |
754 } | 754 } |
755 } | 755 } |
756 | 756 |
757 | 757 |
758 void FullCodeGenerator::VisitVariableDeclaration( | 758 void FullCodeGenerator::VisitVariableDeclaration( |
759 VariableDeclaration* declaration) { | 759 VariableDeclaration* declaration) { |
760 VariableProxy* proxy = declaration->proxy(); | 760 VariableProxy* proxy = declaration->proxy(); |
761 Variable* variable = proxy->var(); | 761 Variable* variable = proxy->var(); |
762 switch (variable->location()) { | 762 switch (variable->location()) { |
763 case VariableLocation::GLOBAL: | |
764 case VariableLocation::UNALLOCATED: { | 763 case VariableLocation::UNALLOCATED: { |
765 DCHECK(!variable->binding_needs_init()); | 764 DCHECK(!variable->binding_needs_init()); |
766 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 765 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
767 DCHECK(!slot.IsInvalid()); | 766 DCHECK(!slot.IsInvalid()); |
768 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 767 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
769 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 768 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
770 break; | 769 break; |
771 } | 770 } |
772 case VariableLocation::PARAMETER: | 771 case VariableLocation::PARAMETER: |
773 case VariableLocation::LOCAL: | 772 case VariableLocation::LOCAL: |
(...skipping 30 matching lines...) Expand all Loading... |
804 UNREACHABLE(); | 803 UNREACHABLE(); |
805 } | 804 } |
806 } | 805 } |
807 | 806 |
808 | 807 |
809 void FullCodeGenerator::VisitFunctionDeclaration( | 808 void FullCodeGenerator::VisitFunctionDeclaration( |
810 FunctionDeclaration* declaration) { | 809 FunctionDeclaration* declaration) { |
811 VariableProxy* proxy = declaration->proxy(); | 810 VariableProxy* proxy = declaration->proxy(); |
812 Variable* variable = proxy->var(); | 811 Variable* variable = proxy->var(); |
813 switch (variable->location()) { | 812 switch (variable->location()) { |
814 case VariableLocation::GLOBAL: | |
815 case VariableLocation::UNALLOCATED: { | 813 case VariableLocation::UNALLOCATED: { |
816 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 814 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
817 DCHECK(!slot.IsInvalid()); | 815 DCHECK(!slot.IsInvalid()); |
818 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 816 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
819 Handle<SharedFunctionInfo> function = | 817 Handle<SharedFunctionInfo> function = |
820 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 818 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
821 // Check for stack-overflow exception. | 819 // Check for stack-overflow exception. |
822 if (function.is_null()) return SetStackOverflow(); | 820 if (function.is_null()) return SetStackOverflow(); |
823 globals_->Add(function, zone()); | 821 globals_->Add(function, zone()); |
824 break; | 822 break; |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1275 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
1278 TypeofMode typeof_mode) { | 1276 TypeofMode typeof_mode) { |
1279 // Record position before possible IC call. | 1277 // Record position before possible IC call. |
1280 SetExpressionPosition(proxy); | 1278 SetExpressionPosition(proxy); |
1281 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1279 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
1282 Variable* var = proxy->var(); | 1280 Variable* var = proxy->var(); |
1283 | 1281 |
1284 // Three cases: global variables, lookup variables, and all other types of | 1282 // Three cases: global variables, lookup variables, and all other types of |
1285 // variables. | 1283 // variables. |
1286 switch (var->location()) { | 1284 switch (var->location()) { |
1287 case VariableLocation::GLOBAL: | |
1288 case VariableLocation::UNALLOCATED: { | 1285 case VariableLocation::UNALLOCATED: { |
1289 Comment cmnt(masm_, "[ Global variable"); | 1286 Comment cmnt(masm_, "[ Global variable"); |
1290 EmitGlobalVariableLoad(proxy, typeof_mode); | 1287 EmitGlobalVariableLoad(proxy, typeof_mode); |
1291 context()->Plug(v0); | 1288 context()->Plug(v0); |
1292 break; | 1289 break; |
1293 } | 1290 } |
1294 | 1291 |
1295 case VariableLocation::PARAMETER: | 1292 case VariableLocation::PARAMETER: |
1296 case VariableLocation::LOCAL: | 1293 case VariableLocation::LOCAL: |
1297 case VariableLocation::CONTEXT: { | 1294 case VariableLocation::CONTEXT: { |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3753 reinterpret_cast<uint32_t>( | 3750 reinterpret_cast<uint32_t>( |
3754 isolate->builtins()->OnStackReplacement()->entry())); | 3751 isolate->builtins()->OnStackReplacement()->entry())); |
3755 return ON_STACK_REPLACEMENT; | 3752 return ON_STACK_REPLACEMENT; |
3756 } | 3753 } |
3757 | 3754 |
3758 | 3755 |
3759 } // namespace internal | 3756 } // namespace internal |
3760 } // namespace v8 | 3757 } // namespace v8 |
3761 | 3758 |
3762 #endif // V8_TARGET_ARCH_MIPS | 3759 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |