| 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 // Never falls through to here. | 717 // Never falls through to here. |
| 718 | 718 |
| 719 __ bind(&slow); | 719 __ bind(&slow); |
| 720 // Prepare for call to builtin. Push object pointers, a0 (lhs) first, | 720 // Prepare for call to builtin. Push object pointers, a0 (lhs) first, |
| 721 // a1 (rhs) second. | 721 // a1 (rhs) second. |
| 722 __ Push(lhs, rhs); | 722 __ Push(lhs, rhs); |
| 723 // Figure out which native to call and setup the arguments. | 723 // Figure out which native to call and setup the arguments. |
| 724 if (cc == eq && strict()) { | 724 if (cc == eq && strict()) { |
| 725 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); | 725 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); |
| 726 } else { | 726 } else { |
| 727 Builtins::JavaScript native; | 727 int context_index; |
| 728 if (cc == eq) { | 728 if (cc == eq) { |
| 729 native = Builtins::EQUALS; | 729 context_index = Context::EQUALS_BUILTIN_INDEX; |
| 730 } else { | 730 } else { |
| 731 native = | 731 context_index = is_strong(strength()) |
| 732 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; | 732 ? Context::COMPARE_STRONG_BUILTIN_INDEX |
| 733 : Context::COMPARE_BUILTIN_INDEX; |
| 733 int ncr; // NaN compare result. | 734 int ncr; // NaN compare result. |
| 734 if (cc == lt || cc == le) { | 735 if (cc == lt || cc == le) { |
| 735 ncr = GREATER; | 736 ncr = GREATER; |
| 736 } else { | 737 } else { |
| 737 DCHECK(cc == gt || cc == ge); // Remaining cases. | 738 DCHECK(cc == gt || cc == ge); // Remaining cases. |
| 738 ncr = LESS; | 739 ncr = LESS; |
| 739 } | 740 } |
| 740 __ li(a0, Operand(Smi::FromInt(ncr))); | 741 __ li(a0, Operand(Smi::FromInt(ncr))); |
| 741 __ push(a0); | 742 __ push(a0); |
| 742 } | 743 } |
| 743 | 744 |
| 744 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 745 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
| 745 // tagged as a small integer. | 746 // tagged as a small integer. |
| 746 __ InvokeBuiltin(native, JUMP_FUNCTION); | 747 __ InvokeBuiltin(context_index, JUMP_FUNCTION); |
| 747 } | 748 } |
| 748 | 749 |
| 749 __ bind(&miss); | 750 __ bind(&miss); |
| 750 GenerateMiss(masm); | 751 GenerateMiss(masm); |
| 751 } | 752 } |
| 752 | 753 |
| 753 | 754 |
| 754 void StoreRegistersStateStub::Generate(MacroAssembler* masm) { | 755 void StoreRegistersStateStub::Generate(MacroAssembler* masm) { |
| 755 __ mov(t9, ra); | 756 __ mov(t9, ra); |
| 756 __ pop(ra); | 757 __ pop(ra); |
| (...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 | 2591 |
| 2591 | 2592 |
| 2592 static void EmitSlowCase(MacroAssembler* masm, | 2593 static void EmitSlowCase(MacroAssembler* masm, |
| 2593 int argc, | 2594 int argc, |
| 2594 Label* non_function) { | 2595 Label* non_function) { |
| 2595 // Check for function proxy. | 2596 // Check for function proxy. |
| 2596 __ Branch(non_function, ne, a4, Operand(JS_FUNCTION_PROXY_TYPE)); | 2597 __ Branch(non_function, ne, a4, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 2597 __ push(a1); // put proxy as additional argument | 2598 __ push(a1); // put proxy as additional argument |
| 2598 __ li(a0, Operand(argc + 1, RelocInfo::NONE32)); | 2599 __ li(a0, Operand(argc + 1, RelocInfo::NONE32)); |
| 2599 __ mov(a2, zero_reg); | 2600 __ mov(a2, zero_reg); |
| 2600 __ GetBuiltinFunction(a1, Builtins::CALL_FUNCTION_PROXY); | 2601 __ GetBuiltinFunction(a1, Context::CALL_FUNCTION_PROXY_BUILTIN_INDEX); |
| 2601 { | 2602 { |
| 2602 Handle<Code> adaptor = | 2603 Handle<Code> adaptor = |
| 2603 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 2604 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
| 2604 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 2605 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
| 2605 } | 2606 } |
| 2606 | 2607 |
| 2607 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 2608 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 2608 // of the original receiver from the call site). | 2609 // of the original receiver from the call site). |
| 2609 __ bind(non_function); | 2610 __ bind(non_function); |
| 2610 __ sd(a1, MemOperand(sp, argc * kPointerSize)); | 2611 __ sd(a1, MemOperand(sp, argc * kPointerSize)); |
| 2611 __ li(a0, Operand(argc)); // Set up the number of arguments. | 2612 __ li(a0, Operand(argc)); // Set up the number of arguments. |
| 2612 __ mov(a2, zero_reg); | 2613 __ mov(a2, zero_reg); |
| 2613 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION); | 2614 __ GetBuiltinFunction(a1, Context::CALL_NON_FUNCTION_BUILTIN_INDEX); |
| 2614 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2615 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 2615 RelocInfo::CODE_TARGET); | 2616 RelocInfo::CODE_TARGET); |
| 2616 } | 2617 } |
| 2617 | 2618 |
| 2618 | 2619 |
| 2619 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { | 2620 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { |
| 2620 // Wrap the receiver and patch it back onto the stack. | 2621 // Wrap the receiver and patch it back onto the stack. |
| 2621 { FrameScope frame_scope(masm, StackFrame::INTERNAL); | 2622 { FrameScope frame_scope(masm, StackFrame::INTERNAL); |
| 2622 __ Push(a1); | 2623 __ Push(a1); |
| 2623 __ mov(a0, a3); | 2624 __ mov(a0, a3); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2740 SharedFunctionInfo::kConstructStubOffset)); | 2741 SharedFunctionInfo::kConstructStubOffset)); |
| 2741 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 2742 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 2742 __ Jump(at); | 2743 __ Jump(at); |
| 2743 | 2744 |
| 2744 // a0: number of arguments | 2745 // a0: number of arguments |
| 2745 // a1: called object | 2746 // a1: called object |
| 2746 // a5: object type | 2747 // a5: object type |
| 2747 Label do_call; | 2748 Label do_call; |
| 2748 __ bind(&slow); | 2749 __ bind(&slow); |
| 2749 __ Branch(&non_function_call, ne, a5, Operand(JS_FUNCTION_PROXY_TYPE)); | 2750 __ Branch(&non_function_call, ne, a5, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 2750 __ GetBuiltinFunction(a1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); | 2751 __ GetBuiltinFunction( |
| 2752 a1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); |
| 2751 __ jmp(&do_call); | 2753 __ jmp(&do_call); |
| 2752 | 2754 |
| 2753 __ bind(&non_function_call); | 2755 __ bind(&non_function_call); |
| 2754 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 2756 __ GetBuiltinFunction( |
| 2757 a1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); |
| 2755 __ bind(&do_call); | 2758 __ bind(&do_call); |
| 2756 // Set expected number of arguments to zero (not changing r0). | 2759 // Set expected number of arguments to zero (not changing r0). |
| 2757 __ li(a2, Operand(0, RelocInfo::NONE32)); | 2760 __ li(a2, Operand(0, RelocInfo::NONE32)); |
| 2758 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2761 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 2759 RelocInfo::CODE_TARGET); | 2762 RelocInfo::CODE_TARGET); |
| 2760 } | 2763 } |
| 2761 | 2764 |
| 2762 | 2765 |
| 2763 // StringCharCodeAtGenerator. | 2766 // StringCharCodeAtGenerator. |
| 2764 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { | 2767 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3435 __ TailCallRuntime(Runtime::kStringToNumber, 1, 1); | 3438 __ TailCallRuntime(Runtime::kStringToNumber, 1, 1); |
| 3436 __ bind(¬_string); | 3439 __ bind(¬_string); |
| 3437 | 3440 |
| 3438 Label not_oddball; | 3441 Label not_oddball; |
| 3439 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | 3442 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
| 3440 __ Ret(USE_DELAY_SLOT); | 3443 __ Ret(USE_DELAY_SLOT); |
| 3441 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); | 3444 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); |
| 3442 __ bind(¬_oddball); | 3445 __ bind(¬_oddball); |
| 3443 | 3446 |
| 3444 __ push(a0); // Push argument. | 3447 __ push(a0); // Push argument. |
| 3445 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); | 3448 __ InvokeBuiltin(Context::TO_NUMBER_BUILTIN_INDEX, JUMP_FUNCTION); |
| 3446 } | 3449 } |
| 3447 | 3450 |
| 3448 | 3451 |
| 3449 void StringHelper::GenerateFlatOneByteStringEquals( | 3452 void StringHelper::GenerateFlatOneByteStringEquals( |
| 3450 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3453 MacroAssembler* masm, Register left, Register right, Register scratch1, |
| 3451 Register scratch2, Register scratch3) { | 3454 Register scratch2, Register scratch3) { |
| 3452 Register length = scratch1; | 3455 Register length = scratch1; |
| 3453 | 3456 |
| 3454 // Compare lengths. | 3457 // Compare lengths. |
| 3455 Label strings_not_equal, check_zero_length; | 3458 Label strings_not_equal, check_zero_length; |
| (...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5657 MemOperand(fp, 6 * kPointerSize), NULL); | 5660 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5658 } | 5661 } |
| 5659 | 5662 |
| 5660 | 5663 |
| 5661 #undef __ | 5664 #undef __ |
| 5662 | 5665 |
| 5663 } // namespace internal | 5666 } // namespace internal |
| 5664 } // namespace v8 | 5667 } // namespace v8 |
| 5665 | 5668 |
| 5666 #endif // V8_TARGET_ARCH_MIPS64 | 5669 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |