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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 217 } |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 // Possibly allocate a local context. | 221 // Possibly allocate a local context. |
222 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 222 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
223 if (heap_slots > 0) { | 223 if (heap_slots > 0) { |
224 Comment(";;; Allocate local context"); | 224 Comment(";;; Allocate local context"); |
225 bool need_write_barrier = true; | 225 bool need_write_barrier = true; |
226 // Argument to NewContext is the function, which is still in edi. | 226 // Argument to NewContext is the function, which is still in edi. |
| 227 DCHECK(!info()->scope()->is_script_scope()); |
227 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 228 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
228 FastNewContextStub stub(isolate(), heap_slots); | 229 FastNewContextStub stub(isolate(), heap_slots); |
229 __ CallStub(&stub); | 230 __ CallStub(&stub); |
230 // Result of FastNewContextStub is always in new space. | 231 // Result of FastNewContextStub is always in new space. |
231 need_write_barrier = false; | 232 need_write_barrier = false; |
232 } else { | 233 } else { |
233 __ push(edi); | 234 __ push(edi); |
234 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 235 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
235 } | 236 } |
236 RecordSafepoint(Safepoint::kNoLazyDeopt); | 237 RecordSafepoint(Safepoint::kNoLazyDeopt); |
(...skipping 6133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6370 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6371 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6371 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6372 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6372 } | 6373 } |
6373 | 6374 |
6374 | 6375 |
6375 #undef __ | 6376 #undef __ |
6376 | 6377 |
6377 } } // namespace v8::internal | 6378 } } // namespace v8::internal |
6378 | 6379 |
6379 #endif // V8_TARGET_ARCH_X87 | 6380 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |