| 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 (heap_slots <= FastNewContextStub::kMaximumSlots) { | 259 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { |
| 260 __ push(edi); |
| 261 __ Push(info()->scope()->GetScopeInfo()); |
| 262 __ CallRuntime(Runtime::kNewGlobalContext, 2); |
| 263 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 260 FastNewContextStub stub(isolate(), heap_slots); | 264 FastNewContextStub stub(isolate(), heap_slots); |
| 261 __ CallStub(&stub); | 265 __ CallStub(&stub); |
| 262 // Result of FastNewContextStub is always in new space. | 266 // Result of FastNewContextStub is always in new space. |
| 263 need_write_barrier = false; | 267 need_write_barrier = false; |
| 264 } else { | 268 } else { |
| 265 __ push(edi); | 269 __ push(edi); |
| 266 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 270 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 267 } | 271 } |
| 268 RecordSafepoint(Safepoint::kNoLazyDeopt); | 272 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 269 // Context is returned in eax. It replaces the context passed to us. | 273 // 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... |
| 5675 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5679 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5676 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5680 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5677 } | 5681 } |
| 5678 | 5682 |
| 5679 | 5683 |
| 5680 #undef __ | 5684 #undef __ |
| 5681 | 5685 |
| 5682 } } // namespace v8::internal | 5686 } } // namespace v8::internal |
| 5683 | 5687 |
| 5684 #endif // V8_TARGET_ARCH_IA32 | 5688 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |