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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // Emit the remaining pushes. | 152 // Emit the remaining pushes. |
153 for (int i = 0; i < remaining; i++) { | 153 for (int i = 0; i < remaining; i++) { |
154 __ push(eax); | 154 __ push(eax); |
155 } | 155 } |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 bool function_in_register = true; | 159 bool function_in_register = true; |
160 | 160 |
161 // Possibly allocate a local context. | 161 // Possibly allocate a local context. |
162 if (info->scope()->num_heap_slots() > 0) { | 162 if (info->scope()->NeedsContext()) { |
163 Comment cmnt(masm_, "[ Allocate context"); | 163 Comment cmnt(masm_, "[ Allocate context"); |
164 bool need_write_barrier = true; | 164 bool need_write_barrier = true; |
165 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 165 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
166 // Argument to NewContext is the function, which is still in edi. | 166 // Argument to NewContext is the function, which is still in edi. |
167 if (info->scope()->is_script_scope()) { | 167 if (info->scope()->is_script_scope()) { |
168 __ push(edi); | 168 __ push(edi); |
169 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 169 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
170 __ CallRuntime(Runtime::kNewScriptContext); | 170 __ CallRuntime(Runtime::kNewScriptContext); |
171 PrepareForBailoutForId(BailoutId::ScriptContext(), | 171 PrepareForBailoutForId(BailoutId::ScriptContext(), |
172 BailoutState::TOS_REGISTER); | 172 BailoutState::TOS_REGISTER); |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 } | 1120 } |
1121 | 1121 |
1122 | 1122 |
1123 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1123 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1124 Label* slow) { | 1124 Label* slow) { |
1125 DCHECK(var->IsContextSlot()); | 1125 DCHECK(var->IsContextSlot()); |
1126 Register context = esi; | 1126 Register context = esi; |
1127 Register temp = ebx; | 1127 Register temp = ebx; |
1128 | 1128 |
1129 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { | 1129 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { |
1130 if (s->num_heap_slots() > 0) { | 1130 if (s->NeedsContext()) { |
1131 if (s->calls_sloppy_eval()) { | 1131 if (s->calls_sloppy_eval()) { |
1132 // Check that extension is "the hole". | 1132 // Check that extension is "the hole". |
1133 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), | 1133 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
1134 Heap::kTheHoleValueRootIndex, slow); | 1134 Heap::kTheHoleValueRootIndex, slow); |
1135 } | 1135 } |
1136 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); | 1136 __ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
1137 // Walk the rest of the chain without clobbering esi. | 1137 // Walk the rest of the chain without clobbering esi. |
1138 context = temp; | 1138 context = temp; |
1139 } | 1139 } |
1140 } | 1140 } |
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3637 isolate->builtins()->OnStackReplacement()->entry(), | 3637 isolate->builtins()->OnStackReplacement()->entry(), |
3638 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3638 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3639 return ON_STACK_REPLACEMENT; | 3639 return ON_STACK_REPLACEMENT; |
3640 } | 3640 } |
3641 | 3641 |
3642 | 3642 |
3643 } // namespace internal | 3643 } // namespace internal |
3644 } // namespace v8 | 3644 } // namespace v8 |
3645 | 3645 |
3646 #endif // V8_TARGET_ARCH_X87 | 3646 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |