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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 CallStoreIC(); | 1101 CallStoreIC(); |
1102 } | 1102 } |
1103 | 1103 |
1104 | 1104 |
1105 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1105 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
1106 TypeofMode typeof_mode, | 1106 TypeofMode typeof_mode, |
1107 Label* slow) { | 1107 Label* slow) { |
1108 Register context = esi; | 1108 Register context = esi; |
1109 Register temp = edx; | 1109 Register temp = edx; |
1110 | 1110 |
1111 Scope* s = scope(); | 1111 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval(); |
1112 while (s != NULL) { | 1112 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) { |
1113 if (s->num_heap_slots() > 0) { | 1113 if (!s->NeedsContext()) continue; |
1114 if (s->calls_sloppy_eval()) { | 1114 if (s->calls_sloppy_eval()) { |
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 } | |
1119 // Load next context in chain. | |
1120 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); | |
1121 // Walk the rest of the chain without clobbering esi. | |
1122 context = temp; | |
1123 } | 1118 } |
1124 // If no outer scope calls eval, we do not need to check more | 1119 // Load next context in chain. |
1125 // context extensions. | 1120 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
1126 if (!s->outer_scope_calls_sloppy_eval()) break; | 1121 // Walk the rest of the chain without clobbering esi. |
1127 s = s->outer_scope(); | 1122 context = temp; |
| 1123 to_check--; |
1128 } | 1124 } |
1129 | 1125 |
1130 // All extension objects were empty and it is safe to use a normal global | 1126 // All extension objects were empty and it is safe to use a normal global |
1131 // load machinery. | 1127 // load machinery. |
1132 EmitGlobalVariableLoad(proxy, typeof_mode); | 1128 EmitGlobalVariableLoad(proxy, typeof_mode); |
1133 } | 1129 } |
1134 | 1130 |
1135 | 1131 |
1136 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1132 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1137 Label* slow) { | 1133 Label* slow) { |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3650 isolate->builtins()->OnStackReplacement()->entry(), | 3646 isolate->builtins()->OnStackReplacement()->entry(), |
3651 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3647 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3652 return ON_STACK_REPLACEMENT; | 3648 return ON_STACK_REPLACEMENT; |
3653 } | 3649 } |
3654 | 3650 |
3655 | 3651 |
3656 } // namespace internal | 3652 } // namespace internal |
3657 } // namespace v8 | 3653 } // namespace v8 |
3658 | 3654 |
3659 #endif // V8_TARGET_ARCH_IA32 | 3655 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |