| 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 <= FastNewFunctionContextStub::kMaximumSlots) { | 151 } else { |
| 152 FastNewFunctionContextStub stub(isolate(), slots); | 152 FastNewFunctionContextStub stub(isolate()); |
| 153 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 154 Immediate(slots)); |
| 153 __ CallStub(&stub); | 155 __ CallStub(&stub); |
| 154 // Result of FastNewFunctionContextStub is always in new space. | 156 // Result of FastNewFunctionContextStub is always in new space. |
| 155 need_write_barrier = false; | 157 need_write_barrier = false; |
| 156 } else { | |
| 157 __ push(edi); | |
| 158 __ CallRuntime(Runtime::kNewFunctionContext); | |
| 159 } | 158 } |
| 160 RecordSafepoint(deopt_mode); | 159 RecordSafepoint(deopt_mode); |
| 161 | 160 |
| 162 // Context is returned in eax. It replaces the context passed to us. | 161 // Context is returned in eax. It replaces the context passed to us. |
| 163 // It's saved in the stack and kept live in esi. | 162 // It's saved in the stack and kept live in esi. |
| 164 __ mov(esi, eax); | 163 __ mov(esi, eax); |
| 165 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 164 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
| 166 | 165 |
| 167 // Copy parameters into context if necessary. | 166 // Copy parameters into context if necessary. |
| 168 int num_parameters = scope()->num_parameters(); | 167 int num_parameters = scope()->num_parameters(); |
| (...skipping 5603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5772 __ bind(deferred->exit()); | 5771 __ bind(deferred->exit()); |
| 5773 __ bind(&done); | 5772 __ bind(&done); |
| 5774 } | 5773 } |
| 5775 | 5774 |
| 5776 #undef __ | 5775 #undef __ |
| 5777 | 5776 |
| 5778 } // namespace internal | 5777 } // namespace internal |
| 5779 } // namespace v8 | 5778 } // namespace v8 |
| 5780 | 5779 |
| 5781 #endif // V8_TARGET_ARCH_X87 | 5780 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |