| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 Comment(";;; Allocate local context"); | 174 Comment(";;; Allocate local context"); |
| 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 <= FastNewContextStub::kMaximumSlots) { | 184 } else if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
| 185 FastNewContextStub stub(isolate(), slots); | 185 FastNewFunctionContextStub stub(isolate(), slots); |
| 186 __ CallStub(&stub); | 186 __ CallStub(&stub); |
| 187 // Result of FastNewContextStub is always in new space. | 187 // Result of FastNewFunctionContextStub is always in new space. |
| 188 need_write_barrier = false; | 188 need_write_barrier = false; |
| 189 } else { | 189 } else { |
| 190 __ Push(rdi); | 190 __ Push(rdi); |
| 191 __ CallRuntime(Runtime::kNewFunctionContext); | 191 __ CallRuntime(Runtime::kNewFunctionContext); |
| 192 } | 192 } |
| 193 RecordSafepoint(deopt_mode); | 193 RecordSafepoint(deopt_mode); |
| 194 | 194 |
| 195 // Context is returned in rax. It replaces the context passed to us. | 195 // Context is returned in rax. It replaces the context passed to us. |
| 196 // It's saved in the stack and kept live in rsi. | 196 // It's saved in the stack and kept live in rsi. |
| 197 __ movp(rsi, rax); | 197 __ movp(rsi, rax); |
| (...skipping 5375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5573 __ bind(deferred->exit()); | 5573 __ bind(deferred->exit()); |
| 5574 __ bind(&done); | 5574 __ bind(&done); |
| 5575 } | 5575 } |
| 5576 | 5576 |
| 5577 #undef __ | 5577 #undef __ |
| 5578 | 5578 |
| 5579 } // namespace internal | 5579 } // namespace internal |
| 5580 } // namespace v8 | 5580 } // namespace v8 |
| 5581 | 5581 |
| 5582 #endif // V8_TARGET_ARCH_X64 | 5582 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |