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/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 Comment(";;; Allocate local context"); | 141 Comment(";;; Allocate local context"); |
142 bool need_write_barrier = true; | 142 bool need_write_barrier = true; |
143 // Argument to NewContext is the function, which is still in edi. | 143 // Argument to NewContext is the function, which is still in edi. |
144 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 144 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
145 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 145 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
146 if (info()->scope()->is_script_scope()) { | 146 if (info()->scope()->is_script_scope()) { |
147 __ push(edi); | 147 __ push(edi); |
148 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); | 148 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); |
149 __ CallRuntime(Runtime::kNewScriptContext); | 149 __ CallRuntime(Runtime::kNewScriptContext); |
150 deopt_mode = Safepoint::kLazyDeopt; | 150 deopt_mode = Safepoint::kLazyDeopt; |
151 } else if (slots <= FastNewContextStub::kMaximumSlots) { | 151 } else if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
152 FastNewContextStub stub(isolate(), slots); | 152 FastNewFunctionContextStub stub(isolate(), slots); |
153 __ CallStub(&stub); | 153 __ CallStub(&stub); |
154 // Result of FastNewContextStub is always in new space. | 154 // Result of FastNewFunctionContextStub is always in new space. |
155 need_write_barrier = false; | 155 need_write_barrier = false; |
156 } else { | 156 } else { |
157 __ push(edi); | 157 __ push(edi); |
158 __ CallRuntime(Runtime::kNewFunctionContext); | 158 __ CallRuntime(Runtime::kNewFunctionContext); |
159 } | 159 } |
160 RecordSafepoint(deopt_mode); | 160 RecordSafepoint(deopt_mode); |
161 | 161 |
162 // Context is returned in eax. It replaces the context passed to us. | 162 // Context is returned in eax. It replaces the context passed to us. |
163 // It's saved in the stack and kept live in esi. | 163 // It's saved in the stack and kept live in esi. |
164 __ mov(esi, eax); | 164 __ mov(esi, eax); |
(...skipping 5613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5778 __ bind(deferred->exit()); | 5778 __ bind(deferred->exit()); |
5779 __ bind(&done); | 5779 __ bind(&done); |
5780 } | 5780 } |
5781 | 5781 |
5782 #undef __ | 5782 #undef __ |
5783 | 5783 |
5784 } // namespace internal | 5784 } // namespace internal |
5785 } // namespace v8 | 5785 } // namespace v8 |
5786 | 5786 |
5787 #endif // V8_TARGET_ARCH_X87 | 5787 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |