OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); | 1123 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); |
1124 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | 1124 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
1125 } | 1125 } |
1126 // Load next context in chain. | 1126 // Load next context in chain. |
1127 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | 1127 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1128 // Walk the rest of the chain without clobbering cp. | 1128 // Walk the rest of the chain without clobbering cp. |
1129 current = next; | 1129 current = next; |
1130 } | 1130 } |
1131 // If no outer scope calls eval, we do not need to check more | 1131 // If no outer scope calls eval, we do not need to check more |
1132 // context extensions. | 1132 // context extensions. |
1133 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | 1133 if (!s->outer_scope_calls_sloppy_eval()) break; |
1134 s = s->outer_scope(); | 1134 s = s->outer_scope(); |
1135 } | 1135 } |
1136 | 1136 |
1137 if (s->is_eval_scope()) { | |
1138 Label loop, fast; | |
1139 if (!current.is(next)) { | |
1140 __ Move(next, current); | |
1141 } | |
1142 __ bind(&loop); | |
1143 // Terminate at native context. | |
1144 __ LoadP(temp, FieldMemOperand(next, HeapObject::kMapOffset)); | |
1145 __ CompareRoot(temp, Heap::kNativeContextMapRootIndex); | |
1146 __ beq(&fast, Label::kNear); | |
1147 // Check that extension is "the hole". | |
1148 __ LoadP(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); | |
1149 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | |
1150 // Load next context in chain. | |
1151 __ LoadP(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | |
1152 __ b(&loop); | |
1153 __ bind(&fast); | |
1154 } | |
1155 | |
1156 // All extension objects were empty and it is safe to use a normal global | 1137 // All extension objects were empty and it is safe to use a normal global |
1157 // load machinery. | 1138 // load machinery. |
1158 EmitGlobalVariableLoad(proxy, typeof_mode); | 1139 EmitGlobalVariableLoad(proxy, typeof_mode); |
1159 } | 1140 } |
1160 | 1141 |
1161 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1142 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1162 Label* slow) { | 1143 Label* slow) { |
1163 DCHECK(var->IsContextSlot()); | 1144 DCHECK(var->IsContextSlot()); |
1164 Register context = cp; | 1145 Register context = cp; |
1165 Register next = r5; | 1146 Register next = r5; |
(...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3674 DCHECK(kOSRBranchInstruction == br_instr); | 3655 DCHECK(kOSRBranchInstruction == br_instr); |
3675 | 3656 |
3676 DCHECK(interrupt_address == | 3657 DCHECK(interrupt_address == |
3677 isolate->builtins()->OnStackReplacement()->entry()); | 3658 isolate->builtins()->OnStackReplacement()->entry()); |
3678 return ON_STACK_REPLACEMENT; | 3659 return ON_STACK_REPLACEMENT; |
3679 } | 3660 } |
3680 | 3661 |
3681 } // namespace internal | 3662 } // namespace internal |
3682 } // namespace v8 | 3663 } // namespace v8 |
3683 #endif // V8_TARGET_ARCH_S390 | 3664 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |