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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 SaveCallerDoubles(); | 188 SaveCallerDoubles(); |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 // Possibly allocate a local context. | 192 // Possibly allocate a local context. |
193 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 193 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
194 if (heap_slots > 0) { | 194 if (heap_slots > 0) { |
195 Comment(";;; Allocate local context"); | 195 Comment(";;; Allocate local context"); |
196 bool need_write_barrier = true; | 196 bool need_write_barrier = true; |
197 // Argument to NewContext is the function, which is still in rdi. | 197 // Argument to NewContext is the function, which is still in rdi. |
| 198 DCHECK(!info()->scope()->is_script_scope()); |
198 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 199 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
199 FastNewContextStub stub(isolate(), heap_slots); | 200 FastNewContextStub stub(isolate(), heap_slots); |
200 __ CallStub(&stub); | 201 __ CallStub(&stub); |
201 // Result of FastNewContextStub is always in new space. | 202 // Result of FastNewContextStub is always in new space. |
202 need_write_barrier = false; | 203 need_write_barrier = false; |
203 } else { | 204 } else { |
204 __ Push(rdi); | 205 __ Push(rdi); |
205 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 206 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
206 } | 207 } |
207 RecordSafepoint(Safepoint::kNoLazyDeopt); | 208 RecordSafepoint(Safepoint::kNoLazyDeopt); |
(...skipping 5725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5933 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5934 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5934 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5935 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5935 } | 5936 } |
5936 | 5937 |
5937 | 5938 |
5938 #undef __ | 5939 #undef __ |
5939 | 5940 |
5940 } } // namespace v8::internal | 5941 } } // namespace v8::internal |
5941 | 5942 |
5942 #endif // V8_TARGET_ARCH_X64 | 5943 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |