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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 1189 } |
1190 // Load next context in chain. | 1190 // Load next context in chain. |
1191 __ lw(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | 1191 __ lw(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1192 // Walk the rest of the chain without clobbering cp. | 1192 // Walk the rest of the chain without clobbering cp. |
1193 current = next; | 1193 current = next; |
1194 } | 1194 } |
1195 // If no outer scope calls eval, we do not need to check more | 1195 // If no outer scope calls eval, we do not need to check more |
1196 // context extensions. | 1196 // context extensions. |
1197 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | 1197 if (!s->outer_scope_calls_sloppy_eval()) break; |
1198 s = s->outer_scope(); | 1198 s = s->outer_scope(); |
1199 } | 1199 } |
1200 | 1200 |
1201 if (s->is_eval_scope()) { | |
1202 Label loop, fast; | |
1203 if (!current.is(next)) { | |
1204 __ Move(next, current); | |
1205 } | |
1206 __ bind(&loop); | |
1207 // Terminate at native context. | |
1208 __ lw(temp, FieldMemOperand(next, HeapObject::kMapOffset)); | |
1209 __ LoadRoot(t0, Heap::kNativeContextMapRootIndex); | |
1210 __ Branch(&fast, eq, temp, Operand(t0)); | |
1211 // Check that extension is "the hole". | |
1212 __ lw(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); | |
1213 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | |
1214 // Load next context in chain. | |
1215 __ lw(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | |
1216 __ Branch(&loop); | |
1217 __ bind(&fast); | |
1218 } | |
1219 | |
1220 // All extension objects were empty and it is safe to use a normal global | 1201 // All extension objects were empty and it is safe to use a normal global |
1221 // load machinery. | 1202 // load machinery. |
1222 EmitGlobalVariableLoad(proxy, typeof_mode); | 1203 EmitGlobalVariableLoad(proxy, typeof_mode); |
1223 } | 1204 } |
1224 | 1205 |
1225 | 1206 |
1226 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1207 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1227 Label* slow) { | 1208 Label* slow) { |
1228 DCHECK(var->IsContextSlot()); | 1209 DCHECK(var->IsContextSlot()); |
1229 Register context = cp; | 1210 Register context = cp; |
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3780 reinterpret_cast<uint32_t>( | 3761 reinterpret_cast<uint32_t>( |
3781 isolate->builtins()->OnStackReplacement()->entry())); | 3762 isolate->builtins()->OnStackReplacement()->entry())); |
3782 return ON_STACK_REPLACEMENT; | 3763 return ON_STACK_REPLACEMENT; |
3783 } | 3764 } |
3784 | 3765 |
3785 | 3766 |
3786 } // namespace internal | 3767 } // namespace internal |
3787 } // namespace v8 | 3768 } // namespace v8 |
3788 | 3769 |
3789 #endif // V8_TARGET_ARCH_MIPS | 3770 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |