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 4652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4663 void StringCharCodeAtGenerator::GenerateSlow( | 4663 void StringCharCodeAtGenerator::GenerateSlow( |
4664 MacroAssembler* masm, const RuntimeCallHelper& call_helper) { | 4664 MacroAssembler* masm, const RuntimeCallHelper& call_helper) { |
4665 __ Abort("Unexpected fallthrough to CharCodeAt slow case"); | 4665 __ Abort("Unexpected fallthrough to CharCodeAt slow case"); |
4666 | 4666 |
4667 // Index is not a smi. | 4667 // Index is not a smi. |
4668 __ bind(&index_not_smi_); | 4668 __ bind(&index_not_smi_); |
4669 // If index is a heap number, try converting it to an integer. | 4669 // If index is a heap number, try converting it to an integer. |
4670 __ CheckMap(index_, | 4670 __ CheckMap(index_, |
4671 masm->isolate()->factory()->heap_number_map(), | 4671 masm->isolate()->factory()->heap_number_map(), |
4672 index_not_number_, | 4672 index_not_number_, |
4673 true); | 4673 DONT_DO_SMI_CHECK); |
4674 call_helper.BeforeCall(masm); | 4674 call_helper.BeforeCall(masm); |
4675 __ push(object_); | 4675 __ push(object_); |
4676 __ push(index_); | 4676 __ push(index_); |
4677 __ push(index_); // Consumed by runtime conversion function. | 4677 __ push(index_); // Consumed by runtime conversion function. |
4678 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 4678 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
4679 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 4679 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
4680 } else { | 4680 } else { |
4681 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 4681 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
4682 // NumberToSmi discards numbers that are not exact integers. | 4682 // NumberToSmi discards numbers that are not exact integers. |
4683 __ CallRuntime(Runtime::kNumberToSmi, 1); | 4683 __ CallRuntime(Runtime::kNumberToSmi, 1); |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6150 __ Drop(1); | 6150 __ Drop(1); |
6151 __ ret(2 * kPointerSize); | 6151 __ ret(2 * kPointerSize); |
6152 } | 6152 } |
6153 | 6153 |
6154 | 6154 |
6155 #undef __ | 6155 #undef __ |
6156 | 6156 |
6157 } } // namespace v8::internal | 6157 } } // namespace v8::internal |
6158 | 6158 |
6159 #endif // V8_TARGET_ARCH_IA32 | 6159 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |