Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 11293168: Rename kAsciiStringTag to kOneByteStringTag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | tools/gen-postmortem-metadata.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 Label* failure, 2221 Label* failure,
2222 Label::Distance near_jump) { 2222 Label::Distance near_jump) {
2223 if (!scratch.is(instance_type)) { 2223 if (!scratch.is(instance_type)) {
2224 movl(scratch, instance_type); 2224 movl(scratch, instance_type);
2225 } 2225 }
2226 2226
2227 const int kFlatAsciiStringMask = 2227 const int kFlatAsciiStringMask =
2228 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 2228 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
2229 2229
2230 andl(scratch, Immediate(kFlatAsciiStringMask)); 2230 andl(scratch, Immediate(kFlatAsciiStringMask));
2231 cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kAsciiStringTag)); 2231 cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kOneByteStringTag));
2232 j(not_equal, failure, near_jump); 2232 j(not_equal, failure, near_jump);
2233 } 2233 }
2234 2234
2235 2235
2236 void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( 2236 void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii(
2237 Register first_object_instance_type, 2237 Register first_object_instance_type,
2238 Register second_object_instance_type, 2238 Register second_object_instance_type,
2239 Register scratch1, 2239 Register scratch1,
2240 Register scratch2, 2240 Register scratch2,
2241 Label* on_fail, 2241 Label* on_fail,
(...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after
4496 // set. 4496 // set.
4497 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); 4497 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag);
4498 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); 4498 ASSERT_EQ(0, kConsStringTag & kExternalStringTag);
4499 testb(instance_type, Immediate(kExternalStringTag)); 4499 testb(instance_type, Immediate(kExternalStringTag));
4500 j(zero, &not_external, Label::kNear); 4500 j(zero, &not_external, Label::kNear);
4501 movq(length, Immediate(ExternalString::kSize)); 4501 movq(length, Immediate(ExternalString::kSize));
4502 jmp(&is_data_object, Label::kNear); 4502 jmp(&is_data_object, Label::kNear);
4503 4503
4504 bind(&not_external); 4504 bind(&not_external);
4505 // Sequential string, either ASCII or UC16. 4505 // Sequential string, either ASCII or UC16.
4506 ASSERT(kAsciiStringTag == 0x04); 4506 ASSERT(kOneByteStringTag == 0x04);
4507 and_(length, Immediate(kStringEncodingMask)); 4507 and_(length, Immediate(kStringEncodingMask));
4508 xor_(length, Immediate(kStringEncodingMask)); 4508 xor_(length, Immediate(kStringEncodingMask));
4509 addq(length, Immediate(0x04)); 4509 addq(length, Immediate(0x04));
4510 // Value now either 4 (if ASCII) or 8 (if UC16), i.e. char-size shifted by 2. 4510 // Value now either 4 (if ASCII) or 8 (if UC16), i.e. char-size shifted by 2.
4511 imul(length, FieldOperand(value, String::kLengthOffset)); 4511 imul(length, FieldOperand(value, String::kLengthOffset));
4512 shr(length, Immediate(2 + kSmiTagSize + kSmiShiftSize)); 4512 shr(length, Immediate(2 + kSmiTagSize + kSmiShiftSize));
4513 addq(length, Immediate(SeqString::kHeaderSize + kObjectAlignmentMask)); 4513 addq(length, Immediate(SeqString::kHeaderSize + kObjectAlignmentMask));
4514 and_(length, Immediate(~kObjectAlignmentMask)); 4514 and_(length, Immediate(~kObjectAlignmentMask));
4515 4515
4516 bind(&is_data_object); 4516 bind(&is_data_object);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4560 4560
4561 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 4561 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
4562 cmpq(rcx, null_value); 4562 cmpq(rcx, null_value);
4563 j(not_equal, &next); 4563 j(not_equal, &next);
4564 } 4564 }
4565 4565
4566 4566
4567 } } // namespace v8::internal 4567 } } // namespace v8::internal
4568 4568
4569 #endif // V8_TARGET_ARCH_X64 4569 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | tools/gen-postmortem-metadata.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698