| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 __ JumpIfNotSmi(rax, &load_nonsmi_rax); | 252 __ JumpIfNotSmi(rax, &load_nonsmi_rax); |
| 253 | 253 |
| 254 __ bind(&load_smi_rax); | 254 __ bind(&load_smi_rax); |
| 255 __ SmiToInteger32(kScratchRegister, rax); | 255 __ SmiToInteger32(kScratchRegister, rax); |
| 256 __ Cvtlsi2sd(xmm1, kScratchRegister); | 256 __ Cvtlsi2sd(xmm1, kScratchRegister); |
| 257 __ bind(&done); | 257 __ bind(&done); |
| 258 } | 258 } |
| 259 | 259 |
| 260 | 260 |
| 261 void MathPowStub::Generate(MacroAssembler* masm) { | 261 void MathPowStub::Generate(MacroAssembler* masm) { |
| 262 const Register exponent = rdx; | 262 const Register exponent = MathPowTaggedDescriptor::exponent(); |
| 263 DCHECK(exponent.is(rdx)); |
| 263 const Register base = rax; | 264 const Register base = rax; |
| 264 const Register scratch = rcx; | 265 const Register scratch = rcx; |
| 265 const XMMRegister double_result = xmm3; | 266 const XMMRegister double_result = xmm3; |
| 266 const XMMRegister double_base = xmm2; | 267 const XMMRegister double_base = xmm2; |
| 267 const XMMRegister double_exponent = xmm1; | 268 const XMMRegister double_exponent = xmm1; |
| 268 const XMMRegister double_scratch = xmm4; | 269 const XMMRegister double_scratch = xmm4; |
| 269 | 270 |
| 270 Label call_runtime, done, exponent_not_smi, int_exponent; | 271 Label call_runtime, done, exponent_not_smi, int_exponent; |
| 271 | 272 |
| 272 // Save 1 in double_result - we need this several times later on. | 273 // Save 1 in double_result - we need this several times later on. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, | 525 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, |
| 525 r9, &miss); | 526 r9, &miss); |
| 526 __ bind(&miss); | 527 __ bind(&miss); |
| 527 PropertyAccessCompiler::TailCallBuiltin( | 528 PropertyAccessCompiler::TailCallBuiltin( |
| 528 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 529 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 529 } | 530 } |
| 530 | 531 |
| 531 | 532 |
| 532 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 533 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
| 533 // The key is in rdx and the parameter count is in rax. | 534 // The key is in rdx and the parameter count is in rax. |
| 535 DCHECK(rdx.is(ArgumentsAccessReadDescriptor::index())); |
| 536 DCHECK(rax.is(ArgumentsAccessReadDescriptor::parameter_count())); |
| 534 | 537 |
| 535 // Check that the key is a smi. | 538 // Check that the key is a smi. |
| 536 Label slow; | 539 Label slow; |
| 537 __ JumpIfNotSmi(rdx, &slow); | 540 __ JumpIfNotSmi(rdx, &slow); |
| 538 | 541 |
| 539 // Check if the calling frame is an arguments adaptor frame. We look at the | 542 // Check if the calling frame is an arguments adaptor frame. We look at the |
| 540 // context offset, and if the frame is not a regular one, then we find a | 543 // context offset, and if the frame is not a regular one, then we find a |
| 541 // Smi instead of the context. We can't use SmiCompare here, because that | 544 // Smi instead of the context. We can't use SmiCompare here, because that |
| 542 // only works for comparing two smis. | 545 // only works for comparing two smis. |
| 543 Label adaptor; | 546 Label adaptor; |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2015 true, | 2018 true, |
| 2016 CallAsMethod()); | 2019 CallAsMethod()); |
| 2017 | 2020 |
| 2018 // Unreachable. | 2021 // Unreachable. |
| 2019 __ int3(); | 2022 __ int3(); |
| 2020 } | 2023 } |
| 2021 | 2024 |
| 2022 | 2025 |
| 2023 void CallICStub::Generate(MacroAssembler* masm) { | 2026 void CallICStub::Generate(MacroAssembler* masm) { |
| 2024 // rdi - function | 2027 // rdi - function |
| 2025 // rbx - vector | |
| 2026 // rdx - slot id | 2028 // rdx - slot id |
| 2027 Isolate* isolate = masm->isolate(); | 2029 Isolate* isolate = masm->isolate(); |
| 2028 Label extra_checks_or_miss, slow_start; | 2030 Label extra_checks_or_miss, slow_start; |
| 2029 Label slow, non_function, wrap, cont; | 2031 Label slow, non_function, wrap, cont; |
| 2030 Label have_js_function; | 2032 Label have_js_function; |
| 2031 int argc = arg_count(); | 2033 int argc = arg_count(); |
| 2032 StackArgumentsAccessor args(rsp, argc); | 2034 StackArgumentsAccessor args(rsp, argc); |
| 2033 ParameterCount actual(argc); | 2035 ParameterCount actual(argc); |
| 2034 | 2036 |
| 2035 EmitLoadTypeFeedbackVector(masm, rbx); | 2037 EmitLoadTypeFeedbackVector(masm, rbx); |
| (...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4583 | 4585 |
| 4584 #if defined(__MINGW64__) || defined(_WIN64) | 4586 #if defined(__MINGW64__) || defined(_WIN64) |
| 4585 Register getter_arg = r8; | 4587 Register getter_arg = r8; |
| 4586 Register accessor_info_arg = rdx; | 4588 Register accessor_info_arg = rdx; |
| 4587 Register name_arg = rcx; | 4589 Register name_arg = rcx; |
| 4588 #else | 4590 #else |
| 4589 Register getter_arg = rdx; | 4591 Register getter_arg = rdx; |
| 4590 Register accessor_info_arg = rsi; | 4592 Register accessor_info_arg = rsi; |
| 4591 Register name_arg = rdi; | 4593 Register name_arg = rdi; |
| 4592 #endif | 4594 #endif |
| 4593 Register api_function_address = r8; | 4595 Register api_function_address = ApiGetterDescriptor::function_address(); |
| 4596 DCHECK(api_function_address.is(r8)); |
| 4594 Register scratch = rax; | 4597 Register scratch = rax; |
| 4595 | 4598 |
| 4596 // v8::Arguments::values_ and handler for name. | 4599 // v8::Arguments::values_ and handler for name. |
| 4597 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 1; | 4600 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 4598 | 4601 |
| 4599 // Allocate v8::AccessorInfo in non-GCed stack space. | 4602 // Allocate v8::AccessorInfo in non-GCed stack space. |
| 4600 const int kArgStackSpace = 1; | 4603 const int kArgStackSpace = 1; |
| 4601 | 4604 |
| 4602 __ leap(name_arg, Operand(rsp, kPCOnStackSize)); | 4605 __ leap(name_arg, Operand(rsp, kPCOnStackSize)); |
| 4603 | 4606 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 4631 return_value_operand, | 4634 return_value_operand, |
| 4632 NULL); | 4635 NULL); |
| 4633 } | 4636 } |
| 4634 | 4637 |
| 4635 | 4638 |
| 4636 #undef __ | 4639 #undef __ |
| 4637 | 4640 |
| 4638 } } // namespace v8::internal | 4641 } } // namespace v8::internal |
| 4639 | 4642 |
| 4640 #endif // V8_TARGET_ARCH_X64 | 4643 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |