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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 CallStoreIC(); | 1108 CallStoreIC(); |
1109 } | 1109 } |
1110 | 1110 |
1111 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1111 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
1112 TypeofMode typeof_mode, | 1112 TypeofMode typeof_mode, |
1113 Label* slow) { | 1113 Label* slow) { |
1114 Register current = cp; | 1114 Register current = cp; |
1115 Register next = r3; | 1115 Register next = r3; |
1116 Register temp = r4; | 1116 Register temp = r4; |
1117 | 1117 |
1118 Scope* s = scope(); | 1118 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval(); |
1119 while (s != NULL) { | 1119 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) { |
1120 if (s->num_heap_slots() > 0) { | 1120 if (!s->NeedsContext()) continue; |
1121 if (s->calls_sloppy_eval()) { | 1121 if (s->calls_sloppy_eval()) { |
1122 // Check that extension is "the hole". | 1122 // Check that extension is "the hole". |
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 } | |
1126 // Load next context in chain. | |
1127 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | |
1128 // Walk the rest of the chain without clobbering cp. | |
1129 current = next; | |
1130 } | 1125 } |
1131 // If no outer scope calls eval, we do not need to check more | 1126 // Load next context in chain. |
1132 // context extensions. | 1127 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1133 if (!s->outer_scope_calls_sloppy_eval()) break; | 1128 // Walk the rest of the chain without clobbering cp. |
1134 s = s->outer_scope(); | 1129 current = next; |
| 1130 to_check--; |
1135 } | 1131 } |
1136 | 1132 |
1137 // All extension objects were empty and it is safe to use a normal global | 1133 // All extension objects were empty and it is safe to use a normal global |
1138 // load machinery. | 1134 // load machinery. |
1139 EmitGlobalVariableLoad(proxy, typeof_mode); | 1135 EmitGlobalVariableLoad(proxy, typeof_mode); |
1140 } | 1136 } |
1141 | 1137 |
1142 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1138 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1143 Label* slow) { | 1139 Label* slow) { |
1144 DCHECK(var->IsContextSlot()); | 1140 DCHECK(var->IsContextSlot()); |
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 DCHECK(kOSRBranchInstruction == br_instr); | 3651 DCHECK(kOSRBranchInstruction == br_instr); |
3656 | 3652 |
3657 DCHECK(interrupt_address == | 3653 DCHECK(interrupt_address == |
3658 isolate->builtins()->OnStackReplacement()->entry()); | 3654 isolate->builtins()->OnStackReplacement()->entry()); |
3659 return ON_STACK_REPLACEMENT; | 3655 return ON_STACK_REPLACEMENT; |
3660 } | 3656 } |
3661 | 3657 |
3662 } // namespace internal | 3658 } // namespace internal |
3663 } // namespace v8 | 3659 } // namespace v8 |
3664 #endif // V8_TARGET_ARCH_S390 | 3660 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |