| Index: src/x64/code-stubs-x64.cc
|
| diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
|
| index 7dae6a0208b57ab5685874c919f4fa56bce67901..9d95fc42639ac985980073f2040a08ce9d2cc3fb 100644
|
| --- a/src/x64/code-stubs-x64.cc
|
| +++ b/src/x64/code-stubs-x64.cc
|
| @@ -78,7 +78,7 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
|
| descriptor->register_param_count_ = 3;
|
| descriptor->register_params_ = registers;
|
| descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
|
| + Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
|
| }
|
|
|
|
|
| @@ -176,14 +176,21 @@ static void InitializeArrayConstructorDescriptor(
|
| // rax -- number of arguments
|
| // rdi -- function
|
| // rbx -- type info cell with elements kind
|
| - static Register registers[] = { rdi, rbx };
|
| - descriptor->register_param_count_ = 2;
|
| - if (constant_stack_parameter_count != 0) {
|
| + static Register registers_variable_args[] = { rdi, rbx, rax };
|
| + static Register registers_no_args[] = { rdi, rbx };
|
| +
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = rax;
|
| + descriptor->register_param_count_ = 3;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
|
| @@ -197,15 +204,21 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| // register state
|
| // rax -- number of arguments
|
| // rdi -- constructor function
|
| - static Register registers[] = { rdi };
|
| - descriptor->register_param_count_ = 1;
|
| + static Register registers_variable_args[] = { rdi, rax };
|
| + static Register registers_no_args[] = { rdi };
|
|
|
| - if (constant_stack_parameter_count != 0) {
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 1;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = rax;
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
|
| @@ -302,6 +315,17 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
|
| }
|
|
|
|
|
| +void NewStringAddStub::InitializeInterfaceDescriptor(
|
| + Isolate* isolate,
|
| + CodeStubInterfaceDescriptor* descriptor) {
|
| + static Register registers[] = { rdx, rax };
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers;
|
| + descriptor->deoptimization_handler_ =
|
| + Runtime::FunctionForId(Runtime::kStringAdd)->entry;
|
| +}
|
| +
|
| +
|
| #define __ ACCESS_MASM(masm)
|
|
|
|
|
| @@ -594,7 +618,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
|
| // Input is a HeapNumber. Push it on the FPU stack and load its
|
| // bits into rbx.
|
| __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset));
|
| - __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
|
| + __ MoveDouble(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
|
| __ movq(rdx, rbx);
|
|
|
| __ bind(&loaded);
|
| @@ -631,7 +655,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
|
| // rcx = TranscendentalCache::hash(double value).
|
| ExternalReference cache_array =
|
| ExternalReference::transcendental_cache_array_address(masm->isolate());
|
| - __ movq(rax, cache_array);
|
| + __ Move(rax, cache_array);
|
| int cache_array_index =
|
| type_ * sizeof(masm->isolate()->transcendental_cache()->caches_[0]);
|
| __ movq(rax, Operand(rax, cache_array_index));
|
| @@ -959,7 +983,7 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
| Label continue_sqrt, continue_rsqrt, not_plus_half;
|
| // Test for 0.5.
|
| // Load double_scratch with 0.5.
|
| - __ movq(scratch, V8_UINT64_C(0x3FE0000000000000), RelocInfo::NONE64);
|
| + __ movq(scratch, V8_UINT64_C(0x3FE0000000000000));
|
| __ movq(double_scratch, scratch);
|
| // Already ruled out NaNs for exponent.
|
| __ ucomisd(double_scratch, double_exponent);
|
| @@ -969,7 +993,7 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
| // Math.pow(-Infinity, 0.5) == Infinity (ECMA spec, 15.8.2.13).
|
| // According to IEEE-754, double-precision -Infinity has the highest
|
| // 12 bits set and the lowest 52 bits cleared.
|
| - __ movq(scratch, V8_UINT64_C(0xFFF0000000000000), RelocInfo::NONE64);
|
| + __ movq(scratch, V8_UINT64_C(0xFFF0000000000000));
|
| __ movq(double_scratch, scratch);
|
| __ ucomisd(double_scratch, double_base);
|
| // Comparing -Infinity with NaN results in "unordered", which sets the
|
| @@ -1001,7 +1025,7 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
| // case of Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13).
|
| // According to IEEE-754, double-precision -Infinity has the highest
|
| // 12 bits set and the lowest 52 bits cleared.
|
| - __ movq(scratch, V8_UINT64_C(0xFFF0000000000000), RelocInfo::NONE64);
|
| + __ movq(scratch, V8_UINT64_C(0xFFF0000000000000));
|
| __ movq(double_scratch, scratch);
|
| __ ucomisd(double_scratch, double_base);
|
| // Comparing -Infinity with NaN results in "unordered", which sets the
|
| @@ -1136,8 +1160,6 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
| }
|
| // Return value is in xmm0.
|
| __ movsd(double_result, xmm0);
|
| - // Restore context register.
|
| - __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
|
|
| __ bind(&done);
|
| __ IncrementCounter(counters->math_pow(), 1);
|
| @@ -1873,9 +1895,9 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
| Immediate(1));
|
|
|
| // Argument 7: Start (high end) of backtracking stack memory area.
|
| - __ movq(kScratchRegister, address_of_regexp_stack_memory_address);
|
| + __ Move(kScratchRegister, address_of_regexp_stack_memory_address);
|
| __ movq(r9, Operand(kScratchRegister, 0));
|
| - __ movq(kScratchRegister, address_of_regexp_stack_memory_size);
|
| + __ Move(kScratchRegister, address_of_regexp_stack_memory_size);
|
| __ addq(r9, Operand(kScratchRegister, 0));
|
| __ movq(Operand(rsp, (argument_slots_on_stack - 3) * kPointerSize), r9);
|
|
|
| @@ -2222,7 +2244,7 @@ static void CheckInputType(MacroAssembler* masm,
|
| __ JumpIfNotSmi(input, fail);
|
| } else if (expected == CompareIC::NUMBER) {
|
| __ JumpIfSmi(input, &ok);
|
| - __ CompareMap(input, masm->isolate()->factory()->heap_number_map(), NULL);
|
| + __ CompareMap(input, masm->isolate()->factory()->heap_number_map());
|
| __ j(not_equal, fail);
|
| }
|
| // We could be strict about internalized/non-internalized here, but as long as
|
| @@ -2810,9 +2832,9 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
|
| // PerformGC. No need to use PrepareCallCFunction/CallCFunction here as the
|
| // stack is known to be aligned. This function takes one argument which is
|
| // passed in register.
|
| - __ movq(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
|
| + __ Move(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
|
| __ movq(arg_reg_1, rax);
|
| - __ movq(kScratchRegister,
|
| + __ Move(kScratchRegister,
|
| ExternalReference::perform_gc_function(masm->isolate()));
|
| __ call(kScratchRegister);
|
| }
|
| @@ -2834,7 +2856,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
|
| // Return result in single register (rax).
|
| __ movq(rcx, r14); // argc.
|
| __ movq(rdx, r15); // argv.
|
| - __ movq(r8, ExternalReference::isolate_address(masm->isolate()));
|
| + __ Move(r8, ExternalReference::isolate_address(masm->isolate()));
|
| } else {
|
| ASSERT_EQ(2, result_size_);
|
| // Pass a pointer to the result location as the first argument.
|
| @@ -2842,14 +2864,14 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
|
| // Pass a pointer to the Arguments object as the second argument.
|
| __ movq(rdx, r14); // argc.
|
| __ movq(r8, r15); // argv.
|
| - __ movq(r9, ExternalReference::isolate_address(masm->isolate()));
|
| + __ Move(r9, ExternalReference::isolate_address(masm->isolate()));
|
| }
|
|
|
| #else // _WIN64
|
| // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9.
|
| __ movq(rdi, r14); // argc.
|
| __ movq(rsi, r15); // argv.
|
| - __ movq(rdx, ExternalReference::isolate_address(masm->isolate()));
|
| + __ Move(rdx, ExternalReference::isolate_address(masm->isolate()));
|
| #endif
|
| __ call(rbx);
|
| // Result is in rax - do not destroy this register!
|
| @@ -3030,9 +3052,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
| // Scratch register is neither callee-save, nor an argument register on any
|
| // platform. It's free to use at this point.
|
| // Cannot use smi-register for loading yet.
|
| - __ movq(kScratchRegister,
|
| - reinterpret_cast<uint64_t>(Smi::FromInt(marker)),
|
| - RelocInfo::NONE64);
|
| + __ movq(kScratchRegister, Smi::FromInt(marker), RelocInfo::NONE64);
|
| __ push(kScratchRegister); // context slot
|
| __ push(kScratchRegister); // function slot
|
| // Save callee-saved registers (X64/Win64 calling conventions).
|
| @@ -3139,7 +3159,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
| __ pop(rbx);
|
| __ Cmp(rbx, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME));
|
| __ j(not_equal, ¬_outermost_js_2);
|
| - __ movq(kScratchRegister, js_entry_sp);
|
| + __ Move(kScratchRegister, js_entry_sp);
|
| __ movq(Operand(kScratchRegister, 0), Immediate(0));
|
| __ bind(¬_outermost_js_2);
|
|
|
| @@ -3208,7 +3228,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
|
| // __ j(not_equal, &cache_miss);
|
| // __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex);
|
| // before the offset of the hole value in the root array.
|
| - static const unsigned int kWordBeforeResultValue = 0x458B4909;
|
| + static const unsigned int kWordBeforeResultValue = 0x458B4906;
|
| // Only the inline check flag is supported on X64.
|
| ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck());
|
| int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0;
|
| @@ -4545,7 +4565,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
|
| // Load left and right operand.
|
| Label done, left, left_smi, right_smi;
|
| __ JumpIfSmi(rax, &right_smi, Label::kNear);
|
| - __ CompareMap(rax, masm->isolate()->factory()->heap_number_map(), NULL);
|
| + __ CompareMap(rax, masm->isolate()->factory()->heap_number_map());
|
| __ j(not_equal, &maybe_undefined1, Label::kNear);
|
| __ movsd(xmm1, FieldOperand(rax, HeapNumber::kValueOffset));
|
| __ jmp(&left, Label::kNear);
|
| @@ -4555,7 +4575,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
|
|
|
| __ bind(&left);
|
| __ JumpIfSmi(rdx, &left_smi, Label::kNear);
|
| - __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map(), NULL);
|
| + __ CompareMap(rdx, masm->isolate()->factory()->heap_number_map());
|
| __ j(not_equal, &maybe_undefined2, Label::kNear);
|
| __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset));
|
| __ jmp(&done);
|
|
|