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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 __ bind(&loop); | 2117 __ bind(&loop); |
2118 __ ldrb(scratch, MemOperand(src, 1, PostIndex), lt); | 2118 __ ldrb(scratch, MemOperand(src, 1, PostIndex), lt); |
2119 __ strb(scratch, MemOperand(dest, 1, PostIndex)); | 2119 __ strb(scratch, MemOperand(dest, 1, PostIndex)); |
2120 __ bind(&loop_entry); | 2120 __ bind(&loop_entry); |
2121 __ cmp(dest, Operand(limit)); | 2121 __ cmp(dest, Operand(limit)); |
2122 __ b(lt, &loop); | 2122 __ b(lt, &loop); |
2123 | 2123 |
2124 __ bind(&done); | 2124 __ bind(&done); |
2125 } | 2125 } |
2126 | 2126 |
2127 void ToStringStub::Generate(MacroAssembler* masm) { | |
2128 // The ToString stub takes one argument in r0. | |
2129 Label is_number; | |
2130 __ JumpIfSmi(r0, &is_number); | |
2131 | |
2132 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); | |
2133 // r0: receiver | |
2134 // r1: receiver instance type | |
2135 __ Ret(lo); | |
2136 | |
2137 Label not_heap_number; | |
2138 __ cmp(r1, Operand(HEAP_NUMBER_TYPE)); | |
2139 __ b(ne, ¬_heap_number); | |
2140 __ bind(&is_number); | |
2141 NumberToStringStub stub(isolate()); | |
2142 __ TailCallStub(&stub); | |
2143 __ bind(¬_heap_number); | |
2144 | |
2145 Label not_oddball; | |
2146 __ cmp(r1, Operand(ODDBALL_TYPE)); | |
2147 __ b(ne, ¬_oddball); | |
2148 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); | |
2149 __ Ret(); | |
2150 __ bind(¬_oddball); | |
2151 | |
2152 __ push(r0); // Push argument. | |
2153 __ TailCallRuntime(Runtime::kToString); | |
2154 } | |
2155 | |
2156 | 2127 |
2157 void StringHelper::GenerateFlatOneByteStringEquals( | 2128 void StringHelper::GenerateFlatOneByteStringEquals( |
2158 MacroAssembler* masm, Register left, Register right, Register scratch1, | 2129 MacroAssembler* masm, Register left, Register right, Register scratch1, |
2159 Register scratch2, Register scratch3) { | 2130 Register scratch2, Register scratch3) { |
2160 Register length = scratch1; | 2131 Register length = scratch1; |
2161 | 2132 |
2162 // Compare lengths. | 2133 // Compare lengths. |
2163 Label strings_not_equal, check_zero_length; | 2134 Label strings_not_equal, check_zero_length; |
2164 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); | 2135 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); |
2165 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 2136 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4942 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 4913 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
4943 kStackUnwindSpace, NULL, return_value_operand, NULL); | 4914 kStackUnwindSpace, NULL, return_value_operand, NULL); |
4944 } | 4915 } |
4945 | 4916 |
4946 #undef __ | 4917 #undef __ |
4947 | 4918 |
4948 } // namespace internal | 4919 } // namespace internal |
4949 } // namespace v8 | 4920 } // namespace v8 |
4950 | 4921 |
4951 #endif // V8_TARGET_ARCH_ARM | 4922 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |