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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2930 __ mov(a1, v0); | 2930 __ mov(a1, v0); |
2931 } | 2931 } |
2932 } | 2932 } |
2933 | 2933 |
2934 | 2934 |
2935 // StringCharCodeAtGenerator. | 2935 // StringCharCodeAtGenerator. |
2936 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { | 2936 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
2937 DCHECK(!t0.is(index_)); | 2937 DCHECK(!t0.is(index_)); |
2938 DCHECK(!t0.is(result_)); | 2938 DCHECK(!t0.is(result_)); |
2939 DCHECK(!t0.is(object_)); | 2939 DCHECK(!t0.is(object_)); |
| 2940 if (check_mode_ == RECEIVER_IS_UNKNOWN) { |
| 2941 // If the receiver is a smi trigger the non-string case. |
| 2942 __ JumpIfSmi(object_, receiver_not_string_); |
2940 | 2943 |
2941 // If the receiver is a smi trigger the non-string case. | 2944 // Fetch the instance type of the receiver into result register. |
2942 __ JumpIfSmi(object_, receiver_not_string_); | 2945 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
2943 | 2946 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
2944 // Fetch the instance type of the receiver into result register. | 2947 // If the receiver is not a string trigger the non-string case. |
2945 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 2948 __ And(t0, result_, Operand(kIsNotStringMask)); |
2946 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 2949 __ Branch(receiver_not_string_, ne, t0, Operand(zero_reg)); |
2947 // If the receiver is not a string trigger the non-string case. | 2950 } |
2948 __ And(t0, result_, Operand(kIsNotStringMask)); | |
2949 __ Branch(receiver_not_string_, ne, t0, Operand(zero_reg)); | |
2950 | 2951 |
2951 // If the index is non-smi trigger the non-smi case. | 2952 // If the index is non-smi trigger the non-smi case. |
2952 __ JumpIfNotSmi(index_, &index_not_smi_); | 2953 __ JumpIfNotSmi(index_, &index_not_smi_); |
2953 | 2954 |
2954 __ bind(&got_smi_index_); | 2955 __ bind(&got_smi_index_); |
2955 | 2956 |
2956 // Check for index out of range. | 2957 // Check for index out of range. |
2957 __ lw(t0, FieldMemOperand(object_, String::kLengthOffset)); | 2958 __ lw(t0, FieldMemOperand(object_, String::kLengthOffset)); |
2958 __ Branch(index_out_of_range_, ls, t0, Operand(index_)); | 2959 __ Branch(index_out_of_range_, ls, t0, Operand(index_)); |
2959 | 2960 |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4926 MemOperand(fp, 6 * kPointerSize), | 4927 MemOperand(fp, 6 * kPointerSize), |
4927 NULL); | 4928 NULL); |
4928 } | 4929 } |
4929 | 4930 |
4930 | 4931 |
4931 #undef __ | 4932 #undef __ |
4932 | 4933 |
4933 } } // namespace v8::internal | 4934 } } // namespace v8::internal |
4934 | 4935 |
4935 #endif // V8_TARGET_ARCH_MIPS | 4936 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |