| 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/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 __ And(at, result, Operand(kIsIndirectStringMask)); | 1052 __ And(at, result, Operand(kIsIndirectStringMask)); |
| 1053 __ Assert(eq, kExternalStringExpectedButNotFound, | 1053 __ Assert(eq, kExternalStringExpectedButNotFound, |
| 1054 at, Operand(zero_reg)); | 1054 at, Operand(zero_reg)); |
| 1055 } | 1055 } |
| 1056 // Rule out short external strings. | 1056 // Rule out short external strings. |
| 1057 STATIC_ASSERT(kShortExternalStringTag != 0); | 1057 STATIC_ASSERT(kShortExternalStringTag != 0); |
| 1058 __ And(at, result, Operand(kShortExternalStringMask)); | 1058 __ And(at, result, Operand(kShortExternalStringMask)); |
| 1059 __ Branch(call_runtime, ne, at, Operand(zero_reg)); | 1059 __ Branch(call_runtime, ne, at, Operand(zero_reg)); |
| 1060 __ lw(string, FieldMemOperand(string, ExternalString::kResourceDataOffset)); | 1060 __ lw(string, FieldMemOperand(string, ExternalString::kResourceDataOffset)); |
| 1061 | 1061 |
| 1062 Label ascii, done; | 1062 Label one_byte, done; |
| 1063 __ bind(&check_encoding); | 1063 __ bind(&check_encoding); |
| 1064 STATIC_ASSERT(kTwoByteStringTag == 0); | 1064 STATIC_ASSERT(kTwoByteStringTag == 0); |
| 1065 __ And(at, result, Operand(kStringEncodingMask)); | 1065 __ And(at, result, Operand(kStringEncodingMask)); |
| 1066 __ Branch(&ascii, ne, at, Operand(zero_reg)); | 1066 __ Branch(&one_byte, ne, at, Operand(zero_reg)); |
| 1067 // Two-byte string. | 1067 // Two-byte string. |
| 1068 __ sll(at, index, 1); | 1068 __ sll(at, index, 1); |
| 1069 __ Addu(at, string, at); | 1069 __ Addu(at, string, at); |
| 1070 __ lhu(result, MemOperand(at)); | 1070 __ lhu(result, MemOperand(at)); |
| 1071 __ jmp(&done); | 1071 __ jmp(&done); |
| 1072 __ bind(&ascii); | 1072 __ bind(&one_byte); |
| 1073 // Ascii string. | 1073 // One_byte string. |
| 1074 __ Addu(at, string, index); | 1074 __ Addu(at, string, index); |
| 1075 __ lbu(result, MemOperand(at)); | 1075 __ lbu(result, MemOperand(at)); |
| 1076 __ bind(&done); | 1076 __ bind(&done); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 | 1079 |
| 1080 static MemOperand ExpConstant(int index, Register base) { | 1080 static MemOperand ExpConstant(int index, Register base) { |
| 1081 return MemOperand(base, index * kDoubleSize); | 1081 return MemOperand(base, index * kDoubleSize); |
| 1082 } | 1082 } |
| 1083 | 1083 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 patcher.masm()->nop(); // Pad the empty space. | 1243 patcher.masm()->nop(); // Pad the empty space. |
| 1244 } | 1244 } |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 | 1247 |
| 1248 #undef __ | 1248 #undef __ |
| 1249 | 1249 |
| 1250 } } // namespace v8::internal | 1250 } } // namespace v8::internal |
| 1251 | 1251 |
| 1252 #endif // V8_TARGET_ARCH_MIPS | 1252 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |