| 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 (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { | 184 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 185 __ push(r1); | |
| 186 __ Push(info()->scope()->GetScopeInfo()); | |
| 187 __ CallRuntime(Runtime::kNewGlobalContext, 2); | |
| 188 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | |
| 189 FastNewContextStub stub(isolate(), heap_slots); | 185 FastNewContextStub stub(isolate(), heap_slots); |
| 190 __ CallStub(&stub); | 186 __ CallStub(&stub); |
| 191 // Result of FastNewContextStub is always in new space. | 187 // Result of FastNewContextStub is always in new space. |
| 192 need_write_barrier = false; | 188 need_write_barrier = false; |
| 193 } else { | 189 } else { |
| 194 __ push(r1); | 190 __ push(r1); |
| 195 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 191 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 196 } | 192 } |
| 197 RecordSafepoint(Safepoint::kNoLazyDeopt); | 193 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 198 // Context is returned in both r0 and cp. It replaces the context | 194 // Context is returned in both r0 and cp. It replaces the context |
| (...skipping 5687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5886 __ Push(scope_info); | 5882 __ Push(scope_info); |
| 5887 __ push(ToRegister(instr->function())); | 5883 __ push(ToRegister(instr->function())); |
| 5888 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5884 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5889 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5885 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5890 } | 5886 } |
| 5891 | 5887 |
| 5892 | 5888 |
| 5893 #undef __ | 5889 #undef __ |
| 5894 | 5890 |
| 5895 } } // namespace v8::internal | 5891 } } // namespace v8::internal |
| OLD | NEW |