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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 } | 229 } |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 // Possibly set up a local binding to the this function which is used in | 233 // Possibly set up a local binding to the this function which is used in |
234 // derived constructors with super calls. | 234 // derived constructors with super calls. |
235 Variable* this_function_var = scope()->this_function_var(); | 235 Variable* this_function_var = scope()->this_function_var(); |
236 if (this_function_var != nullptr) { | 236 if (this_function_var != nullptr) { |
237 Comment cmnt(masm_, "[ This function"); | 237 Comment cmnt(masm_, "[ This function"); |
| 238 if (!function_in_register) { |
| 239 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 240 function_in_register = true; |
| 241 } |
238 SetVar(this_function_var, rdi, rbx, rdx); | 242 SetVar(this_function_var, rdi, rbx, rdx); |
239 } | 243 } |
240 | 244 |
241 Variable* new_target_var = scope()->new_target_var(); | 245 Variable* new_target_var = scope()->new_target_var(); |
242 if (new_target_var != nullptr) { | 246 if (new_target_var != nullptr) { |
243 Comment cmnt(masm_, "[ new.target"); | 247 Comment cmnt(masm_, "[ new.target"); |
244 // new.target is parameter -2. | 248 // new.target is parameter -2. |
245 int offset = 2 * kPointerSize + kFPOnStackSize + kPCOnStackSize + | 249 int offset = 2 * kPointerSize + kFPOnStackSize + kPCOnStackSize + |
246 (info_->scope()->num_parameters() - 1) * kPointerSize; | 250 (info_->scope()->num_parameters() - 1) * kPointerSize; |
247 __ movp(rax, Operand(rbp, offset)); | 251 __ movp(rax, Operand(rbp, offset)); |
(...skipping 5233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5481 Assembler::target_address_at(call_target_address, | 5485 Assembler::target_address_at(call_target_address, |
5482 unoptimized_code)); | 5486 unoptimized_code)); |
5483 return OSR_AFTER_STACK_CHECK; | 5487 return OSR_AFTER_STACK_CHECK; |
5484 } | 5488 } |
5485 | 5489 |
5486 | 5490 |
5487 } // namespace internal | 5491 } // namespace internal |
5488 } // namespace v8 | 5492 } // namespace v8 |
5489 | 5493 |
5490 #endif // V8_TARGET_ARCH_X64 | 5494 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |