OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 __ ldr(r0, MemOperand(sp, 0)); | 168 __ ldr(r0, MemOperand(sp, 0)); |
169 | 169 |
170 // Check that the receiver isn't a smi. | 170 // Check that the receiver isn't a smi. |
171 __ tst(r0, Operand(kSmiTagMask)); | 171 __ tst(r0, Operand(kSmiTagMask)); |
172 __ b(eq, &miss); | 172 __ b(eq, &miss); |
173 | 173 |
174 // Check that the object is a string. | 174 // Check that the object is a string. |
175 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 175 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
176 __ ldrb(r1, FieldMemOperand(r1, Map::kInstanceTypeOffset)); | 176 __ ldrb(r1, FieldMemOperand(r1, Map::kInstanceTypeOffset)); |
| 177 __ mov(r3, Operand(r1)); |
177 __ and_(r1, r1, Operand(kIsNotStringMask)); | 178 __ and_(r1, r1, Operand(kIsNotStringMask)); |
178 // The cast is to resolve the overload for the argument of 0x0. | 179 // The cast is to resolve the overload for the argument of 0x0. |
179 __ cmp(r1, Operand(static_cast<int32_t>(kStringTag))); | 180 __ cmp(r1, Operand(static_cast<int32_t>(kStringTag))); |
180 __ b(ne, &miss); | 181 __ b(ne, &miss); |
181 | 182 |
182 __ and_(r1, r1, Operand(kStringSizeMask)); | 183 __ and_(r1, r3, Operand(kStringSizeMask)); |
183 __ add(r1, r1, Operand(String::kHashShift)); | 184 __ add(r1, r1, Operand(String::kHashShift)); |
184 // Load length directly from the string. | 185 // Load length directly from the string. |
185 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); | 186 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); |
186 __ mov(r0, Operand(r0, LSR, r1)); | 187 __ mov(r0, Operand(r0, LSR, r1)); |
187 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 188 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
188 __ Ret(); | 189 __ Ret(); |
189 | 190 |
190 // Cache miss: Jump to runtime. | 191 // Cache miss: Jump to runtime. |
191 __ bind(&miss); | 192 __ bind(&miss); |
192 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 193 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 523 |
523 // Perform tail call to the entry. | 524 // Perform tail call to the entry. |
524 __ TailCallRuntime(f, 3); | 525 __ TailCallRuntime(f, 3); |
525 } | 526 } |
526 | 527 |
527 | 528 |
528 #undef __ | 529 #undef __ |
529 | 530 |
530 | 531 |
531 } } // namespace v8::internal | 532 } } // namespace v8::internal |
OLD | NEW |