OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 __ tst(r0, Operand(kSmiTagMask)); | 72 __ tst(r0, Operand(kSmiTagMask)); |
73 __ b(ne, &check_heap_number); | 73 __ b(ne, &check_heap_number); |
74 __ Ret(); | 74 __ Ret(); |
75 | 75 |
76 __ bind(&check_heap_number); | 76 __ bind(&check_heap_number); |
77 EmitCheckForHeapNumber(masm, r0, r1, ip, &call_builtin); | 77 EmitCheckForHeapNumber(masm, r0, r1, ip, &call_builtin); |
78 __ Ret(); | 78 __ Ret(); |
79 | 79 |
80 __ bind(&call_builtin); | 80 __ bind(&call_builtin); |
81 __ push(r0); | 81 __ push(r0); |
82 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_JS); | 82 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 void FastNewClosureStub::Generate(MacroAssembler* masm) { | 86 void FastNewClosureStub::Generate(MacroAssembler* masm) { |
87 // Create a new closure from the given function info in new | 87 // Create a new closure from the given function info in new |
88 // space. Set the context to the current context in cp. | 88 // space. Set the context to the current context in cp. |
89 Label gc; | 89 Label gc; |
90 | 90 |
91 // Pop the function info from the stack. | 91 // Pop the function info from the stack. |
92 __ pop(r3); | 92 __ pop(r3); |
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 } else { | 1592 } else { |
1593 ASSERT(cc_ == gt || cc_ == ge); // remaining cases | 1593 ASSERT(cc_ == gt || cc_ == ge); // remaining cases |
1594 ncr = LESS; | 1594 ncr = LESS; |
1595 } | 1595 } |
1596 __ mov(r0, Operand(Smi::FromInt(ncr))); | 1596 __ mov(r0, Operand(Smi::FromInt(ncr))); |
1597 __ push(r0); | 1597 __ push(r0); |
1598 } | 1598 } |
1599 | 1599 |
1600 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 1600 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
1601 // tagged as a small integer. | 1601 // tagged as a small integer. |
1602 __ InvokeBuiltin(native, JUMP_JS); | 1602 __ InvokeBuiltin(native, JUMP_FUNCTION); |
1603 } | 1603 } |
1604 | 1604 |
1605 | 1605 |
1606 // This stub does not handle the inlined cases (Smis, Booleans, undefined). | 1606 // This stub does not handle the inlined cases (Smis, Booleans, undefined). |
1607 // The stub returns zero for false, and a non-zero value for true. | 1607 // The stub returns zero for false, and a non-zero value for true. |
1608 void ToBooleanStub::Generate(MacroAssembler* masm) { | 1608 void ToBooleanStub::Generate(MacroAssembler* masm) { |
1609 // This stub uses VFP3 instructions. | 1609 // This stub uses VFP3 instructions. |
1610 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1610 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
1611 | 1611 |
1612 Label false_result; | 1612 Label false_result; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 GenerateGenericCodeFallback(masm); | 1958 GenerateGenericCodeFallback(masm); |
1959 } | 1959 } |
1960 | 1960 |
1961 | 1961 |
1962 void TypeRecordingUnaryOpStub::GenerateGenericCodeFallback( | 1962 void TypeRecordingUnaryOpStub::GenerateGenericCodeFallback( |
1963 MacroAssembler* masm) { | 1963 MacroAssembler* masm) { |
1964 // Handle the slow case by jumping to the JavaScript builtin. | 1964 // Handle the slow case by jumping to the JavaScript builtin. |
1965 __ push(r0); | 1965 __ push(r0); |
1966 switch (op_) { | 1966 switch (op_) { |
1967 case Token::SUB: | 1967 case Token::SUB: |
1968 __ InvokeBuiltin(Builtins::UNARY_MINUS, JUMP_JS); | 1968 __ InvokeBuiltin(Builtins::UNARY_MINUS, JUMP_FUNCTION); |
1969 break; | 1969 break; |
1970 case Token::BIT_NOT: | 1970 case Token::BIT_NOT: |
1971 __ InvokeBuiltin(Builtins::BIT_NOT, JUMP_JS); | 1971 __ InvokeBuiltin(Builtins::BIT_NOT, JUMP_FUNCTION); |
1972 break; | 1972 break; |
1973 default: | 1973 default: |
1974 UNREACHABLE(); | 1974 UNREACHABLE(); |
1975 } | 1975 } |
1976 } | 1976 } |
1977 | 1977 |
1978 | 1978 |
1979 Handle<Code> GetTypeRecordingBinaryOpStub(int key, | 1979 Handle<Code> GetTypeRecordingBinaryOpStub(int key, |
1980 TRBinaryOpIC::TypeInfo type_info, | 1980 TRBinaryOpIC::TypeInfo type_info, |
1981 TRBinaryOpIC::TypeInfo result_type_info) { | 1981 TRBinaryOpIC::TypeInfo result_type_info) { |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2895 | 2895 |
2896 // At least one argument is not a string. | 2896 // At least one argument is not a string. |
2897 __ bind(&call_runtime); | 2897 __ bind(&call_runtime); |
2898 } | 2898 } |
2899 | 2899 |
2900 | 2900 |
2901 void TypeRecordingBinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) { | 2901 void TypeRecordingBinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) { |
2902 GenerateRegisterArgsPush(masm); | 2902 GenerateRegisterArgsPush(masm); |
2903 switch (op_) { | 2903 switch (op_) { |
2904 case Token::ADD: | 2904 case Token::ADD: |
2905 __ InvokeBuiltin(Builtins::ADD, JUMP_JS); | 2905 __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION); |
2906 break; | 2906 break; |
2907 case Token::SUB: | 2907 case Token::SUB: |
2908 __ InvokeBuiltin(Builtins::SUB, JUMP_JS); | 2908 __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION); |
2909 break; | 2909 break; |
2910 case Token::MUL: | 2910 case Token::MUL: |
2911 __ InvokeBuiltin(Builtins::MUL, JUMP_JS); | 2911 __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION); |
2912 break; | 2912 break; |
2913 case Token::DIV: | 2913 case Token::DIV: |
2914 __ InvokeBuiltin(Builtins::DIV, JUMP_JS); | 2914 __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION); |
2915 break; | 2915 break; |
2916 case Token::MOD: | 2916 case Token::MOD: |
2917 __ InvokeBuiltin(Builtins::MOD, JUMP_JS); | 2917 __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION); |
2918 break; | 2918 break; |
2919 case Token::BIT_OR: | 2919 case Token::BIT_OR: |
2920 __ InvokeBuiltin(Builtins::BIT_OR, JUMP_JS); | 2920 __ InvokeBuiltin(Builtins::BIT_OR, JUMP_FUNCTION); |
2921 break; | 2921 break; |
2922 case Token::BIT_AND: | 2922 case Token::BIT_AND: |
2923 __ InvokeBuiltin(Builtins::BIT_AND, JUMP_JS); | 2923 __ InvokeBuiltin(Builtins::BIT_AND, JUMP_FUNCTION); |
2924 break; | 2924 break; |
2925 case Token::BIT_XOR: | 2925 case Token::BIT_XOR: |
2926 __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_JS); | 2926 __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_FUNCTION); |
2927 break; | 2927 break; |
2928 case Token::SAR: | 2928 case Token::SAR: |
2929 __ InvokeBuiltin(Builtins::SAR, JUMP_JS); | 2929 __ InvokeBuiltin(Builtins::SAR, JUMP_FUNCTION); |
2930 break; | 2930 break; |
2931 case Token::SHR: | 2931 case Token::SHR: |
2932 __ InvokeBuiltin(Builtins::SHR, JUMP_JS); | 2932 __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION); |
2933 break; | 2933 break; |
2934 case Token::SHL: | 2934 case Token::SHL: |
2935 __ InvokeBuiltin(Builtins::SHL, JUMP_JS); | 2935 __ InvokeBuiltin(Builtins::SHL, JUMP_FUNCTION); |
2936 break; | 2936 break; |
2937 default: | 2937 default: |
2938 UNREACHABLE(); | 2938 UNREACHABLE(); |
2939 } | 2939 } |
2940 } | 2940 } |
2941 | 2941 |
2942 | 2942 |
2943 void TypeRecordingBinaryOpStub::GenerateHeapResultAllocation( | 2943 void TypeRecordingBinaryOpStub::GenerateHeapResultAllocation( |
2944 MacroAssembler* masm, | 2944 MacroAssembler* masm, |
2945 Register result, | 2945 Register result, |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3814 __ IsObjectJSStringType(object, scratch, &slow); | 3814 __ IsObjectJSStringType(object, scratch, &slow); |
3815 __ mov(r0, Operand(Smi::FromInt(1))); | 3815 __ mov(r0, Operand(Smi::FromInt(1))); |
3816 __ Ret(HasArgsInRegisters() ? 0 : 2); | 3816 __ Ret(HasArgsInRegisters() ? 0 : 2); |
3817 | 3817 |
3818 // Slow-case. Tail call builtin. | 3818 // Slow-case. Tail call builtin. |
3819 __ bind(&slow); | 3819 __ bind(&slow); |
3820 if (!ReturnTrueFalseObject()) { | 3820 if (!ReturnTrueFalseObject()) { |
3821 if (HasArgsInRegisters()) { | 3821 if (HasArgsInRegisters()) { |
3822 __ Push(r0, r1); | 3822 __ Push(r0, r1); |
3823 } | 3823 } |
3824 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_JS); | 3824 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
3825 } else { | 3825 } else { |
3826 __ EnterInternalFrame(); | 3826 __ EnterInternalFrame(); |
3827 __ Push(r0, r1); | 3827 __ Push(r0, r1); |
3828 __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_JS); | 3828 __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION); |
3829 __ LeaveInternalFrame(); | 3829 __ LeaveInternalFrame(); |
3830 __ cmp(r0, Operand(0)); | 3830 __ cmp(r0, Operand(0)); |
3831 __ LoadRoot(r0, Heap::kTrueValueRootIndex, eq); | 3831 __ LoadRoot(r0, Heap::kTrueValueRootIndex, eq); |
3832 __ LoadRoot(r0, Heap::kFalseValueRootIndex, ne); | 3832 __ LoadRoot(r0, Heap::kFalseValueRootIndex, ne); |
3833 __ Ret(HasArgsInRegisters() ? 0 : 2); | 3833 __ Ret(HasArgsInRegisters() ? 0 : 2); |
3834 } | 3834 } |
3835 } | 3835 } |
3836 | 3836 |
3837 | 3837 |
3838 Register InstanceofStub::left() { return r0; } | 3838 Register InstanceofStub::left() { return r0; } |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 __ JumpIfSmi(r1, &receiver_is_value); | 4469 __ JumpIfSmi(r1, &receiver_is_value); |
4470 | 4470 |
4471 // Check if the receiver is a valid JS object. | 4471 // Check if the receiver is a valid JS object. |
4472 __ CompareObjectType(r1, r2, r2, FIRST_JS_OBJECT_TYPE); | 4472 __ CompareObjectType(r1, r2, r2, FIRST_JS_OBJECT_TYPE); |
4473 __ b(ge, &receiver_is_js_object); | 4473 __ b(ge, &receiver_is_js_object); |
4474 | 4474 |
4475 // Call the runtime to box the value. | 4475 // Call the runtime to box the value. |
4476 __ bind(&receiver_is_value); | 4476 __ bind(&receiver_is_value); |
4477 __ EnterInternalFrame(); | 4477 __ EnterInternalFrame(); |
4478 __ push(r1); | 4478 __ push(r1); |
4479 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); | 4479 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
4480 __ LeaveInternalFrame(); | 4480 __ LeaveInternalFrame(); |
4481 __ str(r0, MemOperand(sp, argc_ * kPointerSize)); | 4481 __ str(r0, MemOperand(sp, argc_ * kPointerSize)); |
4482 | 4482 |
4483 __ bind(&receiver_is_js_object); | 4483 __ bind(&receiver_is_js_object); |
4484 } | 4484 } |
4485 | 4485 |
4486 // Get the function to call from the stack. | 4486 // Get the function to call from the stack. |
4487 // function, receiver [, arguments] | 4487 // function, receiver [, arguments] |
4488 __ ldr(r1, MemOperand(sp, (argc_ + 1) * kPointerSize)); | 4488 __ ldr(r1, MemOperand(sp, (argc_ + 1) * kPointerSize)); |
4489 | 4489 |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5770 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); | 5770 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); |
5771 __ add(sp, sp, Operand(2 * kPointerSize)); | 5771 __ add(sp, sp, Operand(2 * kPointerSize)); |
5772 __ Ret(); | 5772 __ Ret(); |
5773 | 5773 |
5774 // Just jump to runtime to add the two strings. | 5774 // Just jump to runtime to add the two strings. |
5775 __ bind(&string_add_runtime); | 5775 __ bind(&string_add_runtime); |
5776 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 5776 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
5777 | 5777 |
5778 if (call_builtin.is_linked()) { | 5778 if (call_builtin.is_linked()) { |
5779 __ bind(&call_builtin); | 5779 __ bind(&call_builtin); |
5780 __ InvokeBuiltin(builtin_id, JUMP_JS); | 5780 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); |
5781 } | 5781 } |
5782 } | 5782 } |
5783 | 5783 |
5784 | 5784 |
5785 void StringAddStub::GenerateConvertArgument(MacroAssembler* masm, | 5785 void StringAddStub::GenerateConvertArgument(MacroAssembler* masm, |
5786 int stack_offset, | 5786 int stack_offset, |
5787 Register arg, | 5787 Register arg, |
5788 Register scratch1, | 5788 Register scratch1, |
5789 Register scratch2, | 5789 Register scratch2, |
5790 Register scratch3, | 5790 Register scratch3, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5971 __ str(pc, MemOperand(sp, 0)); | 5971 __ str(pc, MemOperand(sp, 0)); |
5972 __ Jump(target); // Call the C++ function. | 5972 __ Jump(target); // Call the C++ function. |
5973 } | 5973 } |
5974 | 5974 |
5975 | 5975 |
5976 #undef __ | 5976 #undef __ |
5977 | 5977 |
5978 } } // namespace v8::internal | 5978 } } // namespace v8::internal |
5979 | 5979 |
5980 #endif // V8_TARGET_ARCH_ARM | 5980 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |