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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 __ Dsubu(sp, sp, Operand(remaining * kPointerSize)); | 190 __ Dsubu(sp, sp, Operand(remaining * kPointerSize)); |
191 for (int i = 0; i < remaining; i++) { | 191 for (int i = 0; i < remaining; i++) { |
192 __ sd(t1, MemOperand(sp, i * kPointerSize)); | 192 __ sd(t1, MemOperand(sp, i * kPointerSize)); |
193 } | 193 } |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 bool function_in_register = true; | 197 bool function_in_register = true; |
198 | 198 |
199 // Possibly allocate a local context. | 199 // Possibly allocate a local context. |
200 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 200 if (info->scope()->num_heap_slots() > 0) { |
201 if (heap_slots > 0) { | |
202 Comment cmnt(masm_, "[ Allocate context"); | 201 Comment cmnt(masm_, "[ Allocate context"); |
203 // Argument to NewContext is the function, which is still in a1. | 202 // Argument to NewContext is the function, which is still in a1. |
204 bool need_write_barrier = true; | 203 bool need_write_barrier = true; |
| 204 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
205 if (info->scope()->is_script_scope()) { | 205 if (info->scope()->is_script_scope()) { |
206 __ push(a1); | 206 __ push(a1); |
207 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 207 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
208 __ CallRuntime(Runtime::kNewScriptContext, 2); | 208 __ CallRuntime(Runtime::kNewScriptContext, 2); |
209 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 209 } else if (slots <= FastNewContextStub::kMaximumSlots) { |
210 FastNewContextStub stub(isolate(), heap_slots); | 210 FastNewContextStub stub(isolate(), slots); |
211 __ CallStub(&stub); | 211 __ CallStub(&stub); |
212 // Result of FastNewContextStub is always in new space. | 212 // Result of FastNewContextStub is always in new space. |
213 need_write_barrier = false; | 213 need_write_barrier = false; |
214 } else { | 214 } else { |
215 __ push(a1); | 215 __ push(a1); |
216 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 216 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
217 } | 217 } |
218 function_in_register = false; | 218 function_in_register = false; |
219 // Context is returned in v0. It replaces the context passed to us. | 219 // Context is returned in v0. It replaces the context passed to us. |
220 // It's saved in the stack and kept live in cp. | 220 // It's saved in the stack and kept live in cp. |
(...skipping 5305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5526 reinterpret_cast<uint64_t>( | 5526 reinterpret_cast<uint64_t>( |
5527 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5527 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5528 return OSR_AFTER_STACK_CHECK; | 5528 return OSR_AFTER_STACK_CHECK; |
5529 } | 5529 } |
5530 | 5530 |
5531 | 5531 |
5532 } // namespace internal | 5532 } // namespace internal |
5533 } // namespace v8 | 5533 } // namespace v8 |
5534 | 5534 |
5535 #endif // V8_TARGET_ARCH_MIPS64 | 5535 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |