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 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (info()->saves_caller_doubles()) { | 168 if (info()->saves_caller_doubles()) { |
169 SaveCallerDoubles(); | 169 SaveCallerDoubles(); |
170 } | 170 } |
171 | 171 |
172 // Possibly allocate a local context. | 172 // Possibly allocate a local context. |
173 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 173 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
174 if (heap_slots > 0) { | 174 if (heap_slots > 0) { |
175 Comment(";;; Allocate local context"); | 175 Comment(";;; Allocate local context"); |
176 bool need_write_barrier = true; | 176 bool need_write_barrier = true; |
177 // Argument to NewContext is the function, which is in a1. | 177 // Argument to NewContext is the function, which is in a1. |
| 178 DCHECK(!info()->scope()->is_script_scope()); |
178 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 179 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
179 FastNewContextStub stub(isolate(), heap_slots); | 180 FastNewContextStub stub(isolate(), heap_slots); |
180 __ CallStub(&stub); | 181 __ CallStub(&stub); |
181 // Result of FastNewContextStub is always in new space. | 182 // Result of FastNewContextStub is always in new space. |
182 need_write_barrier = false; | 183 need_write_barrier = false; |
183 } else { | 184 } else { |
184 __ push(a1); | 185 __ push(a1); |
185 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 186 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
186 } | 187 } |
187 RecordSafepoint(Safepoint::kNoLazyDeopt); | 188 RecordSafepoint(Safepoint::kNoLazyDeopt); |
(...skipping 5851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6039 __ li(at, scope_info); | 6040 __ li(at, scope_info); |
6040 __ Push(at, ToRegister(instr->function())); | 6041 __ Push(at, ToRegister(instr->function())); |
6041 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6042 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6042 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6043 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6043 } | 6044 } |
6044 | 6045 |
6045 | 6046 |
6046 #undef __ | 6047 #undef __ |
6047 | 6048 |
6048 } } // namespace v8::internal | 6049 } } // namespace v8::internal |
OLD | NEW |