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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Emit the remaining pushes. | 151 // Emit the remaining pushes. |
152 for (int i = 0; i < remaining; i++) { | 152 for (int i = 0; i < remaining; i++) { |
153 __ Push(rax); | 153 __ Push(rax); |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 bool function_in_register = true; | 158 bool function_in_register = true; |
159 | 159 |
160 // Possibly allocate a local context. | 160 // Possibly allocate a local context. |
161 if (info->scope()->num_heap_slots() > 0) { | 161 if (info->scope()->NeedsContext()) { |
162 Comment cmnt(masm_, "[ Allocate context"); | 162 Comment cmnt(masm_, "[ Allocate context"); |
163 bool need_write_barrier = true; | 163 bool need_write_barrier = true; |
164 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 164 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
165 // Argument to NewContext is the function, which is still in rdi. | 165 // Argument to NewContext is the function, which is still in rdi. |
166 if (info->scope()->is_script_scope()) { | 166 if (info->scope()->is_script_scope()) { |
167 __ Push(rdi); | 167 __ Push(rdi); |
168 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 168 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
169 __ CallRuntime(Runtime::kNewScriptContext); | 169 __ CallRuntime(Runtime::kNewScriptContext); |
170 PrepareForBailoutForId(BailoutId::ScriptContext(), | 170 PrepareForBailoutForId(BailoutId::ScriptContext(), |
171 BailoutState::TOS_REGISTER); | 171 BailoutState::TOS_REGISTER); |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 } | 1156 } |
1157 | 1157 |
1158 | 1158 |
1159 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1159 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1160 Label* slow) { | 1160 Label* slow) { |
1161 DCHECK(var->IsContextSlot()); | 1161 DCHECK(var->IsContextSlot()); |
1162 Register context = rsi; | 1162 Register context = rsi; |
1163 Register temp = rbx; | 1163 Register temp = rbx; |
1164 | 1164 |
1165 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { | 1165 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { |
1166 if (s->num_heap_slots() > 0) { | 1166 if (s->NeedsContext()) { |
1167 if (s->calls_sloppy_eval()) { | 1167 if (s->calls_sloppy_eval()) { |
1168 // Check that extension is "the hole". | 1168 // Check that extension is "the hole". |
1169 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), | 1169 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
1170 Heap::kTheHoleValueRootIndex, slow); | 1170 Heap::kTheHoleValueRootIndex, slow); |
1171 } | 1171 } |
1172 __ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); | 1172 __ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
1173 // Walk the rest of the chain without clobbering rsi. | 1173 // Walk the rest of the chain without clobbering rsi. |
1174 context = temp; | 1174 context = temp; |
1175 } | 1175 } |
1176 } | 1176 } |
(...skipping 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3635 DCHECK_EQ( | 3635 DCHECK_EQ( |
3636 isolate->builtins()->OnStackReplacement()->entry(), | 3636 isolate->builtins()->OnStackReplacement()->entry(), |
3637 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3637 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3638 return ON_STACK_REPLACEMENT; | 3638 return ON_STACK_REPLACEMENT; |
3639 } | 3639 } |
3640 | 3640 |
3641 } // namespace internal | 3641 } // namespace internal |
3642 } // namespace v8 | 3642 } // namespace v8 |
3643 | 3643 |
3644 #endif // V8_TARGET_ARCH_X64 | 3644 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |