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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && | 1335 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && |
1336 result.is(LoadWithVectorDescriptor::SlotRegister())); | 1336 result.is(LoadWithVectorDescriptor::SlotRegister())); |
1337 | 1337 |
1338 // StringCharAtGenerator doesn't use the result register until it's passed | 1338 // StringCharAtGenerator doesn't use the result register until it's passed |
1339 // the different miss possibilities. If it did, we would have a conflict | 1339 // the different miss possibilities. If it did, we would have a conflict |
1340 // when FLAG_vector_ics is true. | 1340 // when FLAG_vector_ics is true. |
1341 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1341 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1342 &miss, // When not a string. | 1342 &miss, // When not a string. |
1343 &miss, // When not a number. | 1343 &miss, // When not a number. |
1344 &miss, // When index out of range. | 1344 &miss, // When index out of range. |
1345 STRING_INDEX_IS_ARRAY_INDEX, | |
1346 RECEIVER_IS_STRING); | 1345 RECEIVER_IS_STRING); |
1347 char_at_generator.GenerateFast(masm); | 1346 char_at_generator.GenerateFast(masm); |
1348 __ Ret(); | 1347 __ Ret(); |
1349 | 1348 |
1350 StubRuntimeCallHelper call_helper; | 1349 StubRuntimeCallHelper call_helper; |
1351 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | 1350 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
1352 | 1351 |
1353 __ bind(&miss); | 1352 __ bind(&miss); |
1354 PropertyAccessCompiler::TailCallBuiltin( | 1353 PropertyAccessCompiler::TailCallBuiltin( |
1355 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1354 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 index_not_number_, | 2150 index_not_number_, |
2152 DONT_DO_SMI_CHECK); | 2151 DONT_DO_SMI_CHECK); |
2153 call_helper.BeforeCall(masm); | 2152 call_helper.BeforeCall(masm); |
2154 if (embed_mode == PART_OF_IC_HANDLER) { | 2153 if (embed_mode == PART_OF_IC_HANDLER) { |
2155 __ Push(LoadWithVectorDescriptor::VectorRegister(), | 2154 __ Push(LoadWithVectorDescriptor::VectorRegister(), |
2156 LoadWithVectorDescriptor::SlotRegister(), object_, index_); | 2155 LoadWithVectorDescriptor::SlotRegister(), object_, index_); |
2157 } else { | 2156 } else { |
2158 // index_ is consumed by runtime conversion function. | 2157 // index_ is consumed by runtime conversion function. |
2159 __ Push(object_, index_); | 2158 __ Push(object_, index_); |
2160 } | 2159 } |
2161 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2160 __ CallRuntime(Runtime::kNumberToSmi); |
2162 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero); | |
2163 } else { | |
2164 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | |
2165 // NumberToSmi discards numbers that are not exact integers. | |
2166 __ CallRuntime(Runtime::kNumberToSmi); | |
2167 } | |
2168 // Save the conversion result before the pop instructions below | 2161 // Save the conversion result before the pop instructions below |
2169 // have a chance to overwrite it. | 2162 // have a chance to overwrite it. |
2170 __ Move(index_, r0); | 2163 __ Move(index_, r0); |
2171 if (embed_mode == PART_OF_IC_HANDLER) { | 2164 if (embed_mode == PART_OF_IC_HANDLER) { |
2172 __ Pop(LoadWithVectorDescriptor::VectorRegister(), | 2165 __ Pop(LoadWithVectorDescriptor::VectorRegister(), |
2173 LoadWithVectorDescriptor::SlotRegister(), object_); | 2166 LoadWithVectorDescriptor::SlotRegister(), object_); |
2174 } else { | 2167 } else { |
2175 __ pop(object_); | 2168 __ pop(object_); |
2176 } | 2169 } |
2177 // Reload the instance type. | 2170 // Reload the instance type. |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 __ bind(&runtime); | 2480 __ bind(&runtime); |
2488 __ TailCallRuntime(Runtime::kSubString); | 2481 __ TailCallRuntime(Runtime::kSubString); |
2489 | 2482 |
2490 __ bind(&single_char); | 2483 __ bind(&single_char); |
2491 // r0: original string | 2484 // r0: original string |
2492 // r1: instance type | 2485 // r1: instance type |
2493 // r2: length | 2486 // r2: length |
2494 // r3: from index (untagged) | 2487 // r3: from index (untagged) |
2495 __ SmiTag(r3, r3); | 2488 __ SmiTag(r3, r3); |
2496 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, | 2489 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, |
2497 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 2490 RECEIVER_IS_STRING); |
2498 generator.GenerateFast(masm); | 2491 generator.GenerateFast(masm); |
2499 __ Drop(3); | 2492 __ Drop(3); |
2500 __ Ret(); | 2493 __ Ret(); |
2501 generator.SkipSlow(masm, &runtime); | 2494 generator.SkipSlow(masm, &runtime); |
2502 } | 2495 } |
2503 | 2496 |
2504 | 2497 |
2505 void ToNumberStub::Generate(MacroAssembler* masm) { | 2498 void ToNumberStub::Generate(MacroAssembler* masm) { |
2506 // The ToNumber stub takes one argument in r0. | 2499 // The ToNumber stub takes one argument in r0. |
2507 STATIC_ASSERT(kSmiTag == 0); | 2500 STATIC_ASSERT(kSmiTag == 0); |
(...skipping 2937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5445 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5438 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5446 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5439 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5447 } | 5440 } |
5448 | 5441 |
5449 #undef __ | 5442 #undef __ |
5450 | 5443 |
5451 } // namespace internal | 5444 } // namespace internal |
5452 } // namespace v8 | 5445 } // namespace v8 |
5453 | 5446 |
5454 #endif // V8_TARGET_ARCH_ARM | 5447 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |