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 5044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5055 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 5055 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
5056 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 5056 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
5057 // Check that parent is not an external string. Go to runtime otherwise. | 5057 // Check that parent is not an external string. Go to runtime otherwise. |
5058 STATIC_ASSERT(kSeqStringTag == 0); | 5058 STATIC_ASSERT(kSeqStringTag == 0); |
5059 | 5059 |
5060 __ And(t0, result_, Operand(kStringRepresentationMask)); | 5060 __ And(t0, result_, Operand(kStringRepresentationMask)); |
5061 __ Branch(&call_runtime_, ne, t0, Operand(zero_reg)); | 5061 __ Branch(&call_runtime_, ne, t0, Operand(zero_reg)); |
5062 | 5062 |
5063 // Check for 1-byte or 2-byte string. | 5063 // Check for 1-byte or 2-byte string. |
5064 __ bind(&flat_string); | 5064 __ bind(&flat_string); |
5065 STATIC_ASSERT(kAsciiStringTag != 0); | 5065 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); |
| 5066 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
5066 __ And(t0, result_, Operand(kStringEncodingMask)); | 5067 __ And(t0, result_, Operand(kStringEncodingMask)); |
5067 __ Branch(&ascii_string, ne, t0, Operand(zero_reg)); | 5068 __ Branch(&ascii_string, ne, t0, Operand(zero_reg)); |
5068 | 5069 |
5069 // 2-byte string. | 5070 // 2-byte string. |
5070 // Load the 2-byte character code into the result register. We can | 5071 // Load the 2-byte character code into the result register. We can |
5071 // add without shifting since the smi tag size is the log2 of the | 5072 // add without shifting since the smi tag size is the log2 of the |
5072 // number of bytes in a two-byte character. | 5073 // number of bytes in a two-byte character. |
5073 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1 && kSmiShiftSize == 0); | 5074 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1 && kSmiShiftSize == 0); |
5074 __ Addu(scratch_, object_, Operand(scratch_)); | 5075 __ Addu(scratch_, object_, Operand(scratch_)); |
5075 __ lhu(result_, FieldMemOperand(scratch_, SeqTwoByteString::kHeaderSize)); | 5076 __ lhu(result_, FieldMemOperand(scratch_, SeqTwoByteString::kHeaderSize)); |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6868 __ mov(result, zero_reg); | 6869 __ mov(result, zero_reg); |
6869 __ Ret(); | 6870 __ Ret(); |
6870 } | 6871 } |
6871 | 6872 |
6872 | 6873 |
6873 #undef __ | 6874 #undef __ |
6874 | 6875 |
6875 } } // namespace v8::internal | 6876 } } // namespace v8::internal |
6876 | 6877 |
6877 #endif // V8_TARGET_ARCH_MIPS | 6878 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |