| 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 3468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3479 tst(instance_type, Operand(kIsIndirectStringMask | kIsNotStringMask)); | 3479 tst(instance_type, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
| 3480 b(ne, value_is_white_and_not_data); | 3480 b(ne, value_is_white_and_not_data); |
| 3481 // It's a non-indirect (non-cons and non-slice) string. | 3481 // It's a non-indirect (non-cons and non-slice) string. |
| 3482 // If it's external, the length is just ExternalString::kSize. | 3482 // If it's external, the length is just ExternalString::kSize. |
| 3483 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). | 3483 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). |
| 3484 // External strings are the only ones with the kExternalStringTag bit | 3484 // External strings are the only ones with the kExternalStringTag bit |
| 3485 // set. | 3485 // set. |
| 3486 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); | 3486 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); |
| 3487 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); | 3487 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); |
| 3488 tst(instance_type, Operand(kExternalStringTag)); | 3488 tst(instance_type, Operand(kExternalStringTag)); |
| 3489 mov(length, Operand(ExternalString::kSize), LeaveCC, ne); | 3489 Label not_external_string; |
| 3490 b(ne, &is_data_object); | 3490 b(eq, ¬_external_string); |
| 3491 tst(instance_type, Operand(kBufferedStringTag)); |
| 3492 mov(length, Operand(ExternalString::kSize), LeaveCC, eq); |
| 3493 mov(length, Operand(ExternalString::kExtendedSize), LeaveCC, ne); |
| 3494 b(&is_data_object); |
| 3495 bind(¬_external_string); |
| 3491 | 3496 |
| 3492 // Sequential string, either ASCII or UC16. | 3497 // Sequential string, either ASCII or UC16. |
| 3493 // For ASCII (char-size of 1) we shift the smi tag away to get the length. | 3498 // For ASCII (char-size of 1) we shift the smi tag away to get the length. |
| 3494 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby | 3499 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby |
| 3495 // getting the length multiplied by 2. | 3500 // getting the length multiplied by 2. |
| 3496 ASSERT(kAsciiStringTag == 4 && kStringEncodingMask == 4); | 3501 ASSERT(kAsciiStringTag == 4 && kStringEncodingMask == 4); |
| 3497 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); | 3502 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); |
| 3498 ldr(ip, FieldMemOperand(value, String::kLengthOffset)); | 3503 ldr(ip, FieldMemOperand(value, String::kLengthOffset)); |
| 3499 tst(instance_type, Operand(kStringEncodingMask)); | 3504 tst(instance_type, Operand(kStringEncodingMask)); |
| 3500 mov(ip, Operand(ip, LSR, 1), LeaveCC, ne); | 3505 mov(ip, Operand(ip, LSR, 1), LeaveCC, ne); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3612 void CodePatcher::EmitCondition(Condition cond) { | 3617 void CodePatcher::EmitCondition(Condition cond) { |
| 3613 Instr instr = Assembler::instr_at(masm_.pc_); | 3618 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3614 instr = (instr & ~kCondMask) | cond; | 3619 instr = (instr & ~kCondMask) | cond; |
| 3615 masm_.emit(instr); | 3620 masm_.emit(instr); |
| 3616 } | 3621 } |
| 3617 | 3622 |
| 3618 | 3623 |
| 3619 } } // namespace v8::internal | 3624 } } // namespace v8::internal |
| 3620 | 3625 |
| 3621 #endif // V8_TARGET_ARCH_ARM | 3626 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |