| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 // Check that extension is "the hole". | 1115 // Check that extension is "the hole". |
| 1116 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), | 1116 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
| 1117 Heap::kTheHoleValueRootIndex, slow); | 1117 Heap::kTheHoleValueRootIndex, slow); |
| 1118 } | 1118 } |
| 1119 // Load next context in chain. | 1119 // Load next context in chain. |
| 1120 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); | 1120 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
| 1121 // Walk the rest of the chain without clobbering esi. | 1121 // Walk the rest of the chain without clobbering esi. |
| 1122 context = temp; | 1122 context = temp; |
| 1123 } | 1123 } |
| 1124 // If no outer scope calls eval, we do not need to check more | 1124 // If no outer scope calls eval, we do not need to check more |
| 1125 // context extensions. If we have reached an eval scope, we check | 1125 // context extensions. |
| 1126 // all extensions from this point. | 1126 if (!s->outer_scope_calls_sloppy_eval()) break; |
| 1127 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | |
| 1128 s = s->outer_scope(); | 1127 s = s->outer_scope(); |
| 1129 } | 1128 } |
| 1130 | 1129 |
| 1131 if (s != NULL && s->is_eval_scope()) { | |
| 1132 // Loop up the context chain. There is no frame effect so it is | |
| 1133 // safe to use raw labels here. | |
| 1134 Label next, fast; | |
| 1135 if (!context.is(temp)) { | |
| 1136 __ mov(temp, context); | |
| 1137 } | |
| 1138 __ bind(&next); | |
| 1139 // Terminate at native context. | |
| 1140 __ cmp(FieldOperand(temp, HeapObject::kMapOffset), | |
| 1141 Immediate(isolate()->factory()->native_context_map())); | |
| 1142 __ j(equal, &fast, Label::kNear); | |
| 1143 // Check that extension is "the hole". | |
| 1144 __ JumpIfNotRoot(ContextOperand(temp, Context::EXTENSION_INDEX), | |
| 1145 Heap::kTheHoleValueRootIndex, slow); | |
| 1146 // Load next context in chain. | |
| 1147 __ mov(temp, ContextOperand(temp, Context::PREVIOUS_INDEX)); | |
| 1148 __ jmp(&next); | |
| 1149 __ bind(&fast); | |
| 1150 } | |
| 1151 | |
| 1152 // All extension objects were empty and it is safe to use a normal global | 1130 // All extension objects were empty and it is safe to use a normal global |
| 1153 // load machinery. | 1131 // load machinery. |
| 1154 EmitGlobalVariableLoad(proxy, typeof_mode); | 1132 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1155 } | 1133 } |
| 1156 | 1134 |
| 1157 | 1135 |
| 1158 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1136 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
| 1159 Label* slow) { | 1137 Label* slow) { |
| 1160 DCHECK(var->IsContextSlot()); | 1138 DCHECK(var->IsContextSlot()); |
| 1161 Register context = esi; | 1139 Register context = esi; |
| (...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3672 isolate->builtins()->OnStackReplacement()->entry(), | 3650 isolate->builtins()->OnStackReplacement()->entry(), |
| 3673 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3651 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3674 return ON_STACK_REPLACEMENT; | 3652 return ON_STACK_REPLACEMENT; |
| 3675 } | 3653 } |
| 3676 | 3654 |
| 3677 | 3655 |
| 3678 } // namespace internal | 3656 } // namespace internal |
| 3679 } // namespace v8 | 3657 } // namespace v8 |
| 3680 | 3658 |
| 3681 #endif // V8_TARGET_ARCH_IA32 | 3659 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |