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 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 // We want to bailout to runtime here if From is negative. In that case, the | 3384 // We want to bailout to runtime here if From is negative. In that case, the |
3385 // next instruction is not executed and we fall through to bailing out to | 3385 // next instruction is not executed and we fall through to bailing out to |
3386 // runtime. | 3386 // runtime. |
3387 // Executed if both r2 and r3 are untagged integers. | 3387 // Executed if both r2 and r3 are untagged integers. |
3388 __ sub(r2, r2, Operand(r3), SetCC, cc); | 3388 __ sub(r2, r2, Operand(r3), SetCC, cc); |
3389 // One of the above un-smis or the above SUB could have set N==1. | 3389 // One of the above un-smis or the above SUB could have set N==1. |
3390 __ b(mi, &runtime); // Either "from" or "to" is not an smi, or from > to. | 3390 __ b(mi, &runtime); // Either "from" or "to" is not an smi, or from > to. |
3391 | 3391 |
3392 // Make sure first argument is a string. | 3392 // Make sure first argument is a string. |
3393 __ ldr(r0, MemOperand(sp, kStringOffset)); | 3393 __ ldr(r0, MemOperand(sp, kStringOffset)); |
3394 // Do a JumpIfSmi, but fold its jump into the subsequent string test. | 3394 __ JumpIfSmi(r0, &runtime); |
3395 __ SmiTst(r0); | 3395 Condition is_string = masm->IsObjectStringType(r0, r1); |
3396 Condition is_string = masm->IsObjectStringType(r0, r1, ne); | |
3397 ASSERT(is_string == eq); | |
3398 __ b(NegateCondition(is_string), &runtime); | 3396 __ b(NegateCondition(is_string), &runtime); |
3399 | 3397 |
3400 Label single_char; | 3398 Label single_char; |
3401 __ cmp(r2, Operand(1)); | 3399 __ cmp(r2, Operand(1)); |
3402 __ b(eq, &single_char); | 3400 __ b(eq, &single_char); |
3403 | 3401 |
3404 // Short-cut for the case of trivial substring. | 3402 // Short-cut for the case of trivial substring. |
3405 Label return_r0; | 3403 Label return_r0; |
3406 // r0: original string | 3404 // r0: original string |
3407 // r2: result string length | 3405 // r2: result string length |
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5125 MemOperand(fp, 6 * kPointerSize), | 5123 MemOperand(fp, 6 * kPointerSize), |
5126 NULL); | 5124 NULL); |
5127 } | 5125 } |
5128 | 5126 |
5129 | 5127 |
5130 #undef __ | 5128 #undef __ |
5131 | 5129 |
5132 } } // namespace v8::internal | 5130 } } // namespace v8::internal |
5133 | 5131 |
5134 #endif // V8_TARGET_ARCH_ARM | 5132 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |