OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool need_write_barrier = true; | 175 bool need_write_barrier = true; |
176 // Argument to NewContext is the function, which is still in rdi. | 176 // Argument to NewContext is the function, which is still in rdi. |
177 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 177 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
178 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 178 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
179 if (info()->scope()->is_script_scope()) { | 179 if (info()->scope()->is_script_scope()) { |
180 __ Push(rdi); | 180 __ Push(rdi); |
181 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); | 181 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); |
182 __ CallRuntime(Runtime::kNewScriptContext); | 182 __ CallRuntime(Runtime::kNewScriptContext); |
183 deopt_mode = Safepoint::kLazyDeopt; | 183 deopt_mode = Safepoint::kLazyDeopt; |
184 } else if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 184 } else if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
185 FastNewFunctionContextStub stub(isolate(), slots); | 185 FastNewFunctionContextStub stub(isolate()); |
| 186 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
186 __ CallStub(&stub); | 187 __ CallStub(&stub); |
187 // Result of FastNewFunctionContextStub is always in new space. | 188 // Result of FastNewFunctionContextStub is always in new space. |
188 need_write_barrier = false; | 189 need_write_barrier = false; |
189 } else { | 190 } else { |
190 __ Push(rdi); | 191 __ Push(rdi); |
191 __ CallRuntime(Runtime::kNewFunctionContext); | 192 __ CallRuntime(Runtime::kNewFunctionContext); |
192 } | 193 } |
193 RecordSafepoint(deopt_mode); | 194 RecordSafepoint(deopt_mode); |
194 | 195 |
195 // Context is returned in rax. It replaces the context passed to us. | 196 // Context is returned in rax. It replaces the context passed to us. |
(...skipping 5372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5568 __ bind(deferred->exit()); | 5569 __ bind(deferred->exit()); |
5569 __ bind(&done); | 5570 __ bind(&done); |
5570 } | 5571 } |
5571 | 5572 |
5572 #undef __ | 5573 #undef __ |
5573 | 5574 |
5574 } // namespace internal | 5575 } // namespace internal |
5575 } // namespace v8 | 5576 } // namespace v8 |
5576 | 5577 |
5577 #endif // V8_TARGET_ARCH_X64 | 5578 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |