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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (info()->saves_caller_doubles()) { | 174 if (info()->saves_caller_doubles()) { |
175 SaveCallerDoubles(); | 175 SaveCallerDoubles(); |
176 } | 176 } |
177 | 177 |
178 // Possibly allocate a local context. | 178 // Possibly allocate a local context. |
179 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 179 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
180 if (heap_slots > 0) { | 180 if (heap_slots > 0) { |
181 Comment(";;; Allocate local context"); | 181 Comment(";;; Allocate local context"); |
182 bool need_write_barrier = true; | 182 bool need_write_barrier = true; |
183 // Argument to NewContext is the function, which is in r1. | 183 // Argument to NewContext is the function, which is in r1. |
184 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 184 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { |
| 185 __ push(r1); |
| 186 __ Push(info()->scope()->GetScopeInfo()); |
| 187 __ CallRuntime(Runtime::kNewGlobalContext, 2); |
| 188 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
185 FastNewContextStub stub(isolate(), heap_slots); | 189 FastNewContextStub stub(isolate(), heap_slots); |
186 __ CallStub(&stub); | 190 __ CallStub(&stub); |
187 // Result of FastNewContextStub is always in new space. | 191 // Result of FastNewContextStub is always in new space. |
188 need_write_barrier = false; | 192 need_write_barrier = false; |
189 } else { | 193 } else { |
190 __ push(r1); | 194 __ push(r1); |
191 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 195 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
192 } | 196 } |
193 RecordSafepoint(Safepoint::kNoLazyDeopt); | 197 RecordSafepoint(Safepoint::kNoLazyDeopt); |
194 // Context is returned in both r0 and cp. It replaces the context | 198 // Context is returned in both r0 and cp. It replaces the context |
(...skipping 5695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5890 __ Push(scope_info); | 5894 __ Push(scope_info); |
5891 __ push(ToRegister(instr->function())); | 5895 __ push(ToRegister(instr->function())); |
5892 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5896 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5893 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5897 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5894 } | 5898 } |
5895 | 5899 |
5896 | 5900 |
5897 #undef __ | 5901 #undef __ |
5898 | 5902 |
5899 } } // namespace v8::internal | 5903 } } // namespace v8::internal |
OLD | NEW |