OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && | 1471 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && |
1472 result.is(LoadWithVectorDescriptor::SlotRegister())); | 1472 result.is(LoadWithVectorDescriptor::SlotRegister())); |
1473 | 1473 |
1474 // StringCharAtGenerator doesn't use the result register until it's passed | 1474 // StringCharAtGenerator doesn't use the result register until it's passed |
1475 // the different miss possibilities. If it did, we would have a conflict | 1475 // the different miss possibilities. If it did, we would have a conflict |
1476 // when FLAG_vector_ics is true. | 1476 // when FLAG_vector_ics is true. |
1477 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1477 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1478 &miss, // When not a string. | 1478 &miss, // When not a string. |
1479 &miss, // When not a number. | 1479 &miss, // When not a number. |
1480 &miss, // When index out of range. | 1480 &miss, // When index out of range. |
1481 STRING_INDEX_IS_ARRAY_INDEX, | |
1482 RECEIVER_IS_STRING); | 1481 RECEIVER_IS_STRING); |
1483 char_at_generator.GenerateFast(masm); | 1482 char_at_generator.GenerateFast(masm); |
1484 __ Ret(); | 1483 __ Ret(); |
1485 | 1484 |
1486 StubRuntimeCallHelper call_helper; | 1485 StubRuntimeCallHelper call_helper; |
1487 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | 1486 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
1488 | 1487 |
1489 __ Bind(&miss); | 1488 __ Bind(&miss); |
1490 PropertyAccessCompiler::TailCallBuiltin( | 1489 PropertyAccessCompiler::TailCallBuiltin( |
1491 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1490 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 // If index is a heap number, try converting it to an integer. | 2395 // If index is a heap number, try converting it to an integer. |
2397 __ JumpIfNotHeapNumber(index_, index_not_number_); | 2396 __ JumpIfNotHeapNumber(index_, index_not_number_); |
2398 call_helper.BeforeCall(masm); | 2397 call_helper.BeforeCall(masm); |
2399 if (embed_mode == PART_OF_IC_HANDLER) { | 2398 if (embed_mode == PART_OF_IC_HANDLER) { |
2400 __ Push(LoadWithVectorDescriptor::VectorRegister(), | 2399 __ Push(LoadWithVectorDescriptor::VectorRegister(), |
2401 LoadWithVectorDescriptor::SlotRegister(), object_, index_); | 2400 LoadWithVectorDescriptor::SlotRegister(), object_, index_); |
2402 } else { | 2401 } else { |
2403 // Save object_ on the stack and pass index_ as argument for runtime call. | 2402 // Save object_ on the stack and pass index_ as argument for runtime call. |
2404 __ Push(object_, index_); | 2403 __ Push(object_, index_); |
2405 } | 2404 } |
2406 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2405 __ CallRuntime(Runtime::kNumberToSmi); |
2407 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero); | |
2408 } else { | |
2409 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | |
2410 // NumberToSmi discards numbers that are not exact integers. | |
2411 __ CallRuntime(Runtime::kNumberToSmi); | |
2412 } | |
2413 // Save the conversion result before the pop instructions below | 2406 // Save the conversion result before the pop instructions below |
2414 // have a chance to overwrite it. | 2407 // have a chance to overwrite it. |
2415 __ Mov(index_, x0); | 2408 __ Mov(index_, x0); |
2416 if (embed_mode == PART_OF_IC_HANDLER) { | 2409 if (embed_mode == PART_OF_IC_HANDLER) { |
2417 __ Pop(object_, LoadWithVectorDescriptor::SlotRegister(), | 2410 __ Pop(object_, LoadWithVectorDescriptor::SlotRegister(), |
2418 LoadWithVectorDescriptor::VectorRegister()); | 2411 LoadWithVectorDescriptor::VectorRegister()); |
2419 } else { | 2412 } else { |
2420 __ Pop(object_); | 2413 __ Pop(object_); |
2421 } | 2414 } |
2422 // Reload the instance type. | 2415 // Reload the instance type. |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3088 __ TailCallRuntime(Runtime::kSubString); | 3081 __ TailCallRuntime(Runtime::kSubString); |
3089 | 3082 |
3090 __ bind(&single_char); | 3083 __ bind(&single_char); |
3091 // x1: result_length | 3084 // x1: result_length |
3092 // x10: input_string | 3085 // x10: input_string |
3093 // x12: input_type | 3086 // x12: input_type |
3094 // x15: from (untagged) | 3087 // x15: from (untagged) |
3095 __ SmiTag(from); | 3088 __ SmiTag(from); |
3096 StringCharAtGenerator generator(input_string, from, result_length, x0, | 3089 StringCharAtGenerator generator(input_string, from, result_length, x0, |
3097 &runtime, &runtime, &runtime, | 3090 &runtime, &runtime, &runtime, |
3098 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3091 RECEIVER_IS_STRING); |
3099 generator.GenerateFast(masm); | 3092 generator.GenerateFast(masm); |
3100 __ Drop(3); | 3093 __ Drop(3); |
3101 __ Ret(); | 3094 __ Ret(); |
3102 generator.SkipSlow(masm, &runtime); | 3095 generator.SkipSlow(masm, &runtime); |
3103 } | 3096 } |
3104 | 3097 |
3105 | 3098 |
3106 void ToNumberStub::Generate(MacroAssembler* masm) { | 3099 void ToNumberStub::Generate(MacroAssembler* masm) { |
3107 // The ToNumber stub takes one argument in x0. | 3100 // The ToNumber stub takes one argument in x0. |
3108 Label not_smi; | 3101 Label not_smi; |
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5841 kStackUnwindSpace, NULL, spill_offset, | 5834 kStackUnwindSpace, NULL, spill_offset, |
5842 return_value_operand, NULL); | 5835 return_value_operand, NULL); |
5843 } | 5836 } |
5844 | 5837 |
5845 #undef __ | 5838 #undef __ |
5846 | 5839 |
5847 } // namespace internal | 5840 } // namespace internal |
5848 } // namespace v8 | 5841 } // namespace v8 |
5849 | 5842 |
5850 #endif // V8_TARGET_ARCH_ARM64 | 5843 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |