| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); | 1156 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); |
| 1157 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | 1157 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
| 1158 } | 1158 } |
| 1159 // Load next context in chain. | 1159 // Load next context in chain. |
| 1160 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | 1160 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
| 1161 // Walk the rest of the chain without clobbering cp. | 1161 // Walk the rest of the chain without clobbering cp. |
| 1162 current = next; | 1162 current = next; |
| 1163 } | 1163 } |
| 1164 // If no outer scope calls eval, we do not need to check more | 1164 // If no outer scope calls eval, we do not need to check more |
| 1165 // context extensions. | 1165 // context extensions. |
| 1166 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | 1166 if (!s->outer_scope_calls_sloppy_eval()) break; |
| 1167 s = s->outer_scope(); | 1167 s = s->outer_scope(); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 if (s->is_eval_scope()) { | |
| 1171 Label loop, fast; | |
| 1172 if (!current.is(next)) { | |
| 1173 __ Move(next, current); | |
| 1174 } | |
| 1175 __ bind(&loop); | |
| 1176 // Terminate at native context. | |
| 1177 __ LoadP(temp, FieldMemOperand(next, HeapObject::kMapOffset)); | |
| 1178 __ LoadRoot(ip, Heap::kNativeContextMapRootIndex); | |
| 1179 __ cmp(temp, ip); | |
| 1180 __ beq(&fast); | |
| 1181 // Check that extension is "the hole". | |
| 1182 __ LoadP(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); | |
| 1183 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | |
| 1184 // Load next context in chain. | |
| 1185 __ LoadP(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | |
| 1186 __ b(&loop); | |
| 1187 __ bind(&fast); | |
| 1188 } | |
| 1189 | |
| 1190 // All extension objects were empty and it is safe to use a normal global | 1170 // All extension objects were empty and it is safe to use a normal global |
| 1191 // load machinery. | 1171 // load machinery. |
| 1192 EmitGlobalVariableLoad(proxy, typeof_mode); | 1172 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1193 } | 1173 } |
| 1194 | 1174 |
| 1195 | 1175 |
| 1196 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1176 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
| 1197 Label* slow) { | 1177 Label* slow) { |
| 1198 DCHECK(var->IsContextSlot()); | 1178 DCHECK(var->IsContextSlot()); |
| 1199 Register context = cp; | 1179 Register context = cp; |
| (...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3761 | 3741 |
| 3762 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3742 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3763 | 3743 |
| 3764 DCHECK(interrupt_address == | 3744 DCHECK(interrupt_address == |
| 3765 isolate->builtins()->OnStackReplacement()->entry()); | 3745 isolate->builtins()->OnStackReplacement()->entry()); |
| 3766 return ON_STACK_REPLACEMENT; | 3746 return ON_STACK_REPLACEMENT; |
| 3767 } | 3747 } |
| 3768 } // namespace internal | 3748 } // namespace internal |
| 3769 } // namespace v8 | 3749 } // namespace v8 |
| 3770 #endif // V8_TARGET_ARCH_PPC | 3750 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |