| 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 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5683 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5687 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5684 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5688 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5685 } | 5689 } |
| 5686 | 5690 |
| 5687 | 5691 |
| 5688 #undef __ | 5692 #undef __ |
| 5689 | 5693 |
| 5690 } } // namespace v8::internal | 5694 } } // namespace v8::internal |
| 5691 | 5695 |
| 5692 #endif // V8_TARGET_ARCH_IA32 | 5696 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |