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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 } | 1172 } |
1173 | 1173 |
1174 | 1174 |
1175 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1175 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
1176 TypeofMode typeof_mode, | 1176 TypeofMode typeof_mode, |
1177 Label* slow) { | 1177 Label* slow) { |
1178 Register current = cp; | 1178 Register current = cp; |
1179 Register next = a1; | 1179 Register next = a1; |
1180 Register temp = a2; | 1180 Register temp = a2; |
1181 | 1181 |
1182 Scope* s = scope(); | 1182 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval(); |
1183 while (s != NULL) { | 1183 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) { |
1184 if (s->num_heap_slots() > 0) { | 1184 if (!s->NeedsContext()) continue; |
1185 if (s->calls_sloppy_eval()) { | 1185 if (s->calls_sloppy_eval()) { |
1186 // Check that extension is "the hole". | 1186 // Check that extension is "the hole". |
1187 __ lw(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); | 1187 __ lw(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); |
1188 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | 1188 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
1189 } | |
1190 // Load next context in chain. | |
1191 __ lw(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | |
1192 // Walk the rest of the chain without clobbering cp. | |
1193 current = next; | |
1194 } | 1189 } |
1195 // If no outer scope calls eval, we do not need to check more | 1190 // Load next context in chain. |
1196 // context extensions. | 1191 __ lw(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1197 if (!s->outer_scope_calls_sloppy_eval()) break; | 1192 // Walk the rest of the chain without clobbering cp. |
1198 s = s->outer_scope(); | 1193 current = next; |
| 1194 to_check--; |
1199 } | 1195 } |
1200 | 1196 |
1201 // All extension objects were empty and it is safe to use a normal global | 1197 // All extension objects were empty and it is safe to use a normal global |
1202 // load machinery. | 1198 // load machinery. |
1203 EmitGlobalVariableLoad(proxy, typeof_mode); | 1199 EmitGlobalVariableLoad(proxy, typeof_mode); |
1204 } | 1200 } |
1205 | 1201 |
1206 | 1202 |
1207 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1203 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1208 Label* slow) { | 1204 Label* slow) { |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3761 reinterpret_cast<uint32_t>( | 3757 reinterpret_cast<uint32_t>( |
3762 isolate->builtins()->OnStackReplacement()->entry())); | 3758 isolate->builtins()->OnStackReplacement()->entry())); |
3763 return ON_STACK_REPLACEMENT; | 3759 return ON_STACK_REPLACEMENT; |
3764 } | 3760 } |
3765 | 3761 |
3766 | 3762 |
3767 } // namespace internal | 3763 } // namespace internal |
3768 } // namespace v8 | 3764 } // namespace v8 |
3769 | 3765 |
3770 #endif // V8_TARGET_ARCH_MIPS | 3766 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |