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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool function_in_register = true; | 182 bool function_in_register = true; |
183 | 183 |
184 // Possibly allocate a local context. | 184 // Possibly allocate a local context. |
185 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 185 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
186 if (heap_slots > 0) { | 186 if (heap_slots > 0) { |
187 Comment cmnt(masm_, "[ Allocate context"); | 187 Comment cmnt(masm_, "[ Allocate context"); |
188 bool need_write_barrier = true; | 188 bool need_write_barrier = true; |
189 // Argument to NewContext is the function, which is still in rdi. | 189 // Argument to NewContext is the function, which is still in rdi. |
190 if (FLAG_harmony_scoping && info->scope()->is_script_scope()) { | 190 if (FLAG_harmony_scoping && info->scope()->is_script_scope()) { |
191 __ Push(rdi); | 191 __ Push(rdi); |
192 __ Push(info->scope()->GetScopeInfo()); | 192 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
193 __ CallRuntime(Runtime::kNewScriptContext, 2); | 193 __ CallRuntime(Runtime::kNewScriptContext, 2); |
194 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 194 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
195 FastNewContextStub stub(isolate(), heap_slots); | 195 FastNewContextStub stub(isolate(), heap_slots); |
196 __ CallStub(&stub); | 196 __ CallStub(&stub); |
197 // Result of FastNewContextStub is always in new space. | 197 // Result of FastNewContextStub is always in new space. |
198 need_write_barrier = false; | 198 need_write_barrier = false; |
199 } else { | 199 } else { |
200 __ Push(rdi); | 200 __ Push(rdi); |
201 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 201 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
202 } | 202 } |
(...skipping 5112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5315 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5315 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5316 Assembler::target_address_at(call_target_address, | 5316 Assembler::target_address_at(call_target_address, |
5317 unoptimized_code)); | 5317 unoptimized_code)); |
5318 return OSR_AFTER_STACK_CHECK; | 5318 return OSR_AFTER_STACK_CHECK; |
5319 } | 5319 } |
5320 | 5320 |
5321 | 5321 |
5322 } } // namespace v8::internal | 5322 } } // namespace v8::internal |
5323 | 5323 |
5324 #endif // V8_TARGET_ARCH_X64 | 5324 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |