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 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3373 Heap::kEmptyStringRootIndex); | 3373 Heap::kEmptyStringRootIndex); |
3374 __ j(not_equal, deferred->entry()); | 3374 __ j(not_equal, deferred->entry()); |
3375 __ movq(string, FieldOperand(string, ConsString::kFirstOffset)); | 3375 __ movq(string, FieldOperand(string, ConsString::kFirstOffset)); |
3376 | 3376 |
3377 __ bind(&indirect_string_loaded); | 3377 __ bind(&indirect_string_loaded); |
3378 __ movq(result, FieldOperand(string, HeapObject::kMapOffset)); | 3378 __ movq(result, FieldOperand(string, HeapObject::kMapOffset)); |
3379 __ movzxbl(result, FieldOperand(result, Map::kInstanceTypeOffset)); | 3379 __ movzxbl(result, FieldOperand(result, Map::kInstanceTypeOffset)); |
3380 | 3380 |
3381 // Check whether the string is sequential. The only non-sequential | 3381 // Check whether the string is sequential. The only non-sequential |
3382 // shapes we support have just been unwrapped above. | 3382 // shapes we support have just been unwrapped above. |
| 3383 // Note that if the original string is a cons or slice with an external |
| 3384 // string as underlying string, we pass that unpacked underlying string with |
| 3385 // the updated index to the runtime function. |
3383 __ bind(&check_sequential); | 3386 __ bind(&check_sequential); |
3384 STATIC_ASSERT(kSeqStringTag == 0); | 3387 STATIC_ASSERT(kSeqStringTag == 0); |
3385 __ testb(result, Immediate(kStringRepresentationMask)); | 3388 __ testb(result, Immediate(kStringRepresentationMask)); |
3386 __ j(not_zero, deferred->entry()); | 3389 __ j(not_zero, deferred->entry()); |
3387 | 3390 |
3388 // Dispatch on the encoding: ASCII or two-byte. | 3391 // Dispatch on the encoding: ASCII or two-byte. |
3389 Label ascii_string; | 3392 Label ascii_string; |
3390 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); | 3393 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); |
3391 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); | 3394 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
3392 __ testb(result, Immediate(kStringEncodingMask)); | 3395 __ testb(result, Immediate(kStringEncodingMask)); |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4293 RegisterEnvironmentForDeoptimization(environment); | 4296 RegisterEnvironmentForDeoptimization(environment); |
4294 ASSERT(osr_pc_offset_ == -1); | 4297 ASSERT(osr_pc_offset_ == -1); |
4295 osr_pc_offset_ = masm()->pc_offset(); | 4298 osr_pc_offset_ = masm()->pc_offset(); |
4296 } | 4299 } |
4297 | 4300 |
4298 #undef __ | 4301 #undef __ |
4299 | 4302 |
4300 } } // namespace v8::internal | 4303 } } // namespace v8::internal |
4301 | 4304 |
4302 #endif // V8_TARGET_ARCH_X64 | 4305 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |