OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3687 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); | 3687 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); |
3688 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); | 3688 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); |
3689 tst(instance_type, Operand(kExternalStringTag)); | 3689 tst(instance_type, Operand(kExternalStringTag)); |
3690 mov(length, Operand(ExternalString::kSize), LeaveCC, ne); | 3690 mov(length, Operand(ExternalString::kSize), LeaveCC, ne); |
3691 b(ne, &is_data_object); | 3691 b(ne, &is_data_object); |
3692 | 3692 |
3693 // Sequential string, either ASCII or UC16. | 3693 // Sequential string, either ASCII or UC16. |
3694 // For ASCII (char-size of 1) we shift the smi tag away to get the length. | 3694 // For ASCII (char-size of 1) we shift the smi tag away to get the length. |
3695 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby | 3695 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby |
3696 // getting the length multiplied by 2. | 3696 // getting the length multiplied by 2. |
3697 ASSERT(kAsciiStringTag == 4 && kStringEncodingMask == 4); | 3697 ASSERT(kOneByteStringTag == 4 && kStringEncodingMask == 4); |
3698 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); | 3698 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); |
3699 ldr(ip, FieldMemOperand(value, String::kLengthOffset)); | 3699 ldr(ip, FieldMemOperand(value, String::kLengthOffset)); |
3700 tst(instance_type, Operand(kStringEncodingMask)); | 3700 tst(instance_type, Operand(kStringEncodingMask)); |
3701 mov(ip, Operand(ip, LSR, 1), LeaveCC, ne); | 3701 mov(ip, Operand(ip, LSR, 1), LeaveCC, ne); |
3702 add(length, ip, Operand(SeqString::kHeaderSize + kObjectAlignmentMask)); | 3702 add(length, ip, Operand(SeqString::kHeaderSize + kObjectAlignmentMask)); |
3703 and_(length, length, Operand(~kObjectAlignmentMask)); | 3703 and_(length, length, Operand(~kObjectAlignmentMask)); |
3704 | 3704 |
3705 bind(&is_data_object); | 3705 bind(&is_data_object); |
3706 // Value is a data object, and it is white. Mark it black. Since we know | 3706 // Value is a data object, and it is white. Mark it black. Since we know |
3707 // that the object is white we can make it black by flipping one bit. | 3707 // that the object is white we can make it black by flipping one bit. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 void CodePatcher::EmitCondition(Condition cond) { | 3877 void CodePatcher::EmitCondition(Condition cond) { |
3878 Instr instr = Assembler::instr_at(masm_.pc_); | 3878 Instr instr = Assembler::instr_at(masm_.pc_); |
3879 instr = (instr & ~kCondMask) | cond; | 3879 instr = (instr & ~kCondMask) | cond; |
3880 masm_.emit(instr); | 3880 masm_.emit(instr); |
3881 } | 3881 } |
3882 | 3882 |
3883 | 3883 |
3884 } } // namespace v8::internal | 3884 } } // namespace v8::internal |
3885 | 3885 |
3886 #endif // V8_TARGET_ARCH_ARM | 3886 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |