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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 a1, Operand(a4)); | 752 a1, Operand(a4)); |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 | 756 |
757 void FullCodeGenerator::VisitVariableDeclaration( | 757 void FullCodeGenerator::VisitVariableDeclaration( |
758 VariableDeclaration* declaration) { | 758 VariableDeclaration* declaration) { |
759 VariableProxy* proxy = declaration->proxy(); | 759 VariableProxy* proxy = declaration->proxy(); |
760 Variable* variable = proxy->var(); | 760 Variable* variable = proxy->var(); |
761 switch (variable->location()) { | 761 switch (variable->location()) { |
762 case VariableLocation::GLOBAL: | |
763 case VariableLocation::UNALLOCATED: { | 762 case VariableLocation::UNALLOCATED: { |
764 DCHECK(!variable->binding_needs_init()); | 763 DCHECK(!variable->binding_needs_init()); |
765 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 764 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
766 DCHECK(!slot.IsInvalid()); | 765 DCHECK(!slot.IsInvalid()); |
767 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 766 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
768 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 767 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
769 break; | 768 break; |
770 } | 769 } |
771 case VariableLocation::PARAMETER: | 770 case VariableLocation::PARAMETER: |
772 case VariableLocation::LOCAL: | 771 case VariableLocation::LOCAL: |
(...skipping 30 matching lines...) Expand all Loading... |
803 UNREACHABLE(); | 802 UNREACHABLE(); |
804 } | 803 } |
805 } | 804 } |
806 | 805 |
807 | 806 |
808 void FullCodeGenerator::VisitFunctionDeclaration( | 807 void FullCodeGenerator::VisitFunctionDeclaration( |
809 FunctionDeclaration* declaration) { | 808 FunctionDeclaration* declaration) { |
810 VariableProxy* proxy = declaration->proxy(); | 809 VariableProxy* proxy = declaration->proxy(); |
811 Variable* variable = proxy->var(); | 810 Variable* variable = proxy->var(); |
812 switch (variable->location()) { | 811 switch (variable->location()) { |
813 case VariableLocation::GLOBAL: | |
814 case VariableLocation::UNALLOCATED: { | 812 case VariableLocation::UNALLOCATED: { |
815 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 813 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
816 DCHECK(!slot.IsInvalid()); | 814 DCHECK(!slot.IsInvalid()); |
817 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 815 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
818 Handle<SharedFunctionInfo> function = | 816 Handle<SharedFunctionInfo> function = |
819 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 817 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
820 // Check for stack-overflow exception. | 818 // Check for stack-overflow exception. |
821 if (function.is_null()) return SetStackOverflow(); | 819 if (function.is_null()) return SetStackOverflow(); |
822 globals_->Add(function, zone()); | 820 globals_->Add(function, zone()); |
823 break; | 821 break; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1276 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
1279 TypeofMode typeof_mode) { | 1277 TypeofMode typeof_mode) { |
1280 // Record position before possible IC call. | 1278 // Record position before possible IC call. |
1281 SetExpressionPosition(proxy); | 1279 SetExpressionPosition(proxy); |
1282 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1280 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
1283 Variable* var = proxy->var(); | 1281 Variable* var = proxy->var(); |
1284 | 1282 |
1285 // Three cases: global variables, lookup variables, and all other types of | 1283 // Three cases: global variables, lookup variables, and all other types of |
1286 // variables. | 1284 // variables. |
1287 switch (var->location()) { | 1285 switch (var->location()) { |
1288 case VariableLocation::GLOBAL: | |
1289 case VariableLocation::UNALLOCATED: { | 1286 case VariableLocation::UNALLOCATED: { |
1290 Comment cmnt(masm_, "[ Global variable"); | 1287 Comment cmnt(masm_, "[ Global variable"); |
1291 EmitGlobalVariableLoad(proxy, typeof_mode); | 1288 EmitGlobalVariableLoad(proxy, typeof_mode); |
1292 context()->Plug(v0); | 1289 context()->Plug(v0); |
1293 break; | 1290 break; |
1294 } | 1291 } |
1295 | 1292 |
1296 case VariableLocation::PARAMETER: | 1293 case VariableLocation::PARAMETER: |
1297 case VariableLocation::LOCAL: | 1294 case VariableLocation::LOCAL: |
1298 case VariableLocation::CONTEXT: { | 1295 case VariableLocation::CONTEXT: { |
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3760 reinterpret_cast<uint64_t>( | 3757 reinterpret_cast<uint64_t>( |
3761 isolate->builtins()->OnStackReplacement()->entry())); | 3758 isolate->builtins()->OnStackReplacement()->entry())); |
3762 return ON_STACK_REPLACEMENT; | 3759 return ON_STACK_REPLACEMENT; |
3763 } | 3760 } |
3764 | 3761 |
3765 | 3762 |
3766 } // namespace internal | 3763 } // namespace internal |
3767 } // namespace v8 | 3764 } // namespace v8 |
3768 | 3765 |
3769 #endif // V8_TARGET_ARCH_MIPS64 | 3766 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |