OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 SaveCallerDoubles(); | 186 SaveCallerDoubles(); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 // Possibly allocate a local context. | 190 // Possibly allocate a local context. |
191 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 191 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
192 if (heap_slots > 0) { | 192 if (heap_slots > 0) { |
193 Comment(";;; Allocate local context"); | 193 Comment(";;; Allocate local context"); |
194 bool need_write_barrier = true; | 194 bool need_write_barrier = true; |
195 // Argument to NewContext is the function, which is still in rdi. | 195 // Argument to NewContext is the function, which is still in rdi. |
196 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { | 196 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
197 __ Push(rdi); | |
198 __ Push(info()->scope()->GetScopeInfo()); | |
199 __ CallRuntime(Runtime::kNewGlobalContext, 2); | |
200 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | |
201 FastNewContextStub stub(isolate(), heap_slots); | 197 FastNewContextStub stub(isolate(), heap_slots); |
202 __ CallStub(&stub); | 198 __ CallStub(&stub); |
203 // Result of FastNewContextStub is always in new space. | 199 // Result of FastNewContextStub is always in new space. |
204 need_write_barrier = false; | 200 need_write_barrier = false; |
205 } else { | 201 } else { |
206 __ Push(rdi); | 202 __ Push(rdi); |
207 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 203 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
208 } | 204 } |
209 RecordSafepoint(Safepoint::kNoLazyDeopt); | 205 RecordSafepoint(Safepoint::kNoLazyDeopt); |
210 // Context is returned in rax. It replaces the context passed to us. | 206 // Context is returned in rax. It replaces the context passed to us. |
(...skipping 5645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5856 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5852 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5857 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5853 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5858 } | 5854 } |
5859 | 5855 |
5860 | 5856 |
5861 #undef __ | 5857 #undef __ |
5862 | 5858 |
5863 } } // namespace v8::internal | 5859 } } // namespace v8::internal |
5864 | 5860 |
5865 #endif // V8_TARGET_ARCH_X64 | 5861 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |