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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 if (info()->saves_caller_doubles()) SaveCallerDoubles(); | 250 if (info()->saves_caller_doubles()) SaveCallerDoubles(); |
251 } | 251 } |
252 | 252 |
253 // Possibly allocate a local context. | 253 // Possibly allocate a local context. |
254 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 254 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
255 if (heap_slots > 0) { | 255 if (heap_slots > 0) { |
256 Comment(";;; Allocate local context"); | 256 Comment(";;; Allocate local context"); |
257 bool need_write_barrier = true; | 257 bool need_write_barrier = true; |
258 // Argument to NewContext is the function, which is still in edi. | 258 // Argument to NewContext is the function, which is still in edi. |
259 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { | 259 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
260 __ push(edi); | |
261 __ Push(info()->scope()->GetScopeInfo()); | |
262 __ CallRuntime(Runtime::kNewGlobalContext, 2); | |
263 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | |
264 FastNewContextStub stub(isolate(), heap_slots); | 260 FastNewContextStub stub(isolate(), heap_slots); |
265 __ CallStub(&stub); | 261 __ CallStub(&stub); |
266 // Result of FastNewContextStub is always in new space. | 262 // Result of FastNewContextStub is always in new space. |
267 need_write_barrier = false; | 263 need_write_barrier = false; |
268 } else { | 264 } else { |
269 __ push(edi); | 265 __ push(edi); |
270 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 266 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
271 } | 267 } |
272 RecordSafepoint(Safepoint::kNoLazyDeopt); | 268 RecordSafepoint(Safepoint::kNoLazyDeopt); |
273 // Context is returned in eax. It replaces the context passed to us. | 269 // Context is returned in eax. It replaces the context passed to us. |
(...skipping 5405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5679 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5675 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5680 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5676 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5681 } | 5677 } |
5682 | 5678 |
5683 | 5679 |
5684 #undef __ | 5680 #undef __ |
5685 | 5681 |
5686 } } // namespace v8::internal | 5682 } } // namespace v8::internal |
5687 | 5683 |
5688 #endif // V8_TARGET_ARCH_IA32 | 5684 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |