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 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3444 Immediate(factory()->empty_string())); | 3444 Immediate(factory()->empty_string())); |
3445 __ j(not_equal, deferred->entry()); | 3445 __ j(not_equal, deferred->entry()); |
3446 __ mov(string, FieldOperand(string, ConsString::kFirstOffset)); | 3446 __ mov(string, FieldOperand(string, ConsString::kFirstOffset)); |
3447 | 3447 |
3448 __ bind(&indirect_string_loaded); | 3448 __ bind(&indirect_string_loaded); |
3449 __ mov(result, FieldOperand(string, HeapObject::kMapOffset)); | 3449 __ mov(result, FieldOperand(string, HeapObject::kMapOffset)); |
3450 __ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset)); | 3450 __ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset)); |
3451 | 3451 |
3452 // Check whether the string is sequential. The only non-sequential | 3452 // Check whether the string is sequential. The only non-sequential |
3453 // shapes we support have just been unwrapped above. | 3453 // shapes we support have just been unwrapped above. |
| 3454 // Note that if the original string is a cons or slice with an external |
| 3455 // string as underlying string, we pass that unpacked underlying string with |
| 3456 // the updated index to the runtime function. |
3454 __ bind(&check_sequential); | 3457 __ bind(&check_sequential); |
3455 STATIC_ASSERT(kSeqStringTag == 0); | 3458 STATIC_ASSERT(kSeqStringTag == 0); |
3456 __ test(result, Immediate(kStringRepresentationMask)); | 3459 __ test(result, Immediate(kStringRepresentationMask)); |
3457 __ j(not_zero, deferred->entry()); | 3460 __ j(not_zero, deferred->entry()); |
3458 | 3461 |
3459 // Dispatch on the encoding: ASCII or two-byte. | 3462 // Dispatch on the encoding: ASCII or two-byte. |
3460 Label ascii_string; | 3463 Label ascii_string; |
3461 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); | 3464 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); |
3462 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); | 3465 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
3463 __ test(result, Immediate(kStringEncodingMask)); | 3466 __ test(result, Immediate(kStringEncodingMask)); |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4583 env->deoptimization_index()); | 4586 env->deoptimization_index()); |
4584 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4587 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4585 } | 4588 } |
4586 | 4589 |
4587 | 4590 |
4588 #undef __ | 4591 #undef __ |
4589 | 4592 |
4590 } } // namespace v8::internal | 4593 } } // namespace v8::internal |
4591 | 4594 |
4592 #endif // V8_TARGET_ARCH_IA32 | 4595 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |