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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (info()->saves_caller_doubles()) { | 173 if (info()->saves_caller_doubles()) { |
174 SaveCallerDoubles(); | 174 SaveCallerDoubles(); |
175 } | 175 } |
176 | 176 |
177 // Possibly allocate a local context. | 177 // Possibly allocate a local context. |
178 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 178 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
179 if (heap_slots > 0) { | 179 if (heap_slots > 0) { |
180 Comment(";;; Allocate local context"); | 180 Comment(";;; Allocate local context"); |
181 bool need_write_barrier = true; | 181 bool need_write_barrier = true; |
182 // Argument to NewContext is the function, which is in r1. | 182 // Argument to NewContext is the function, which is in r1. |
| 183 DCHECK(!info()->scope()->is_script_scope()); |
183 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 184 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
184 FastNewContextStub stub(isolate(), heap_slots); | 185 FastNewContextStub stub(isolate(), heap_slots); |
185 __ CallStub(&stub); | 186 __ CallStub(&stub); |
186 // Result of FastNewContextStub is always in new space. | 187 // Result of FastNewContextStub is always in new space. |
187 need_write_barrier = false; | 188 need_write_barrier = false; |
188 } else { | 189 } else { |
189 __ push(r1); | 190 __ push(r1); |
190 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 191 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
191 } | 192 } |
192 RecordSafepoint(Safepoint::kNoLazyDeopt); | 193 RecordSafepoint(Safepoint::kNoLazyDeopt); |
(...skipping 5743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5936 __ Push(scope_info); | 5937 __ Push(scope_info); |
5937 __ push(ToRegister(instr->function())); | 5938 __ push(ToRegister(instr->function())); |
5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5939 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5939 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5940 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5940 } | 5941 } |
5941 | 5942 |
5942 | 5943 |
5943 #undef __ | 5944 #undef __ |
5944 | 5945 |
5945 } } // namespace v8::internal | 5946 } } // namespace v8::internal |
OLD | NEW |