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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index b815c29c3936cf5c8496459552916a2bcf74619f..f16058bb55b84812b2fee1d5458df180265705b8 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -1735,12 +1735,10 @@ void MacroAssembler::AllocateTwoByteString(Register result,
}
-void MacroAssembler::AllocateAsciiString(Register result,
- Register length,
- Register scratch1,
- Register scratch2,
- Register scratch3,
- Label* gc_required) {
+void MacroAssembler::AllocateOneByteString(Register result, Register length,
+ Register scratch1, Register scratch2,
+ Register scratch3,
+ Label* gc_required) {
// Calculate the number of bytes needed for the characters in the string while
// observing object alignment.
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
@@ -1749,7 +1747,7 @@ void MacroAssembler::AllocateAsciiString(Register result,
add(scratch1, Immediate(kObjectAlignmentMask));
and_(scratch1, Immediate(~kObjectAlignmentMask));
- // Allocate ASCII string in new space.
+ // Allocate one-byte string in new space.
Allocate(SeqOneByteString::kHeaderSize,
times_1,
scratch1,
@@ -1762,7 +1760,7 @@ void MacroAssembler::AllocateAsciiString(Register result,
// Set the map, length and hash field.
mov(FieldOperand(result, HeapObject::kMapOffset),
- Immediate(isolate()->factory()->ascii_string_map()));
+ Immediate(isolate()->factory()->one_byte_string_map()));
mov(scratch1, length);
SmiTag(scratch1);
mov(FieldOperand(result, String::kLengthOffset), scratch1);
@@ -1771,20 +1769,18 @@ void MacroAssembler::AllocateAsciiString(Register result,
}
-void MacroAssembler::AllocateAsciiString(Register result,
- int length,
- Register scratch1,
- Register scratch2,
- Label* gc_required) {
+void MacroAssembler::AllocateOneByteString(Register result, int length,
+ Register scratch1, Register scratch2,
+ Label* gc_required) {
DCHECK(length > 0);
- // Allocate ASCII string in new space.
+ // Allocate one-byte string in new space.
Allocate(SeqOneByteString::SizeFor(length), result, scratch1, scratch2,
gc_required, TAG_OBJECT);
// Set the map, length and hash field.
mov(FieldOperand(result, HeapObject::kMapOffset),
- Immediate(isolate()->factory()->ascii_string_map()));
+ Immediate(isolate()->factory()->one_byte_string_map()));
mov(FieldOperand(result, String::kLengthOffset),
Immediate(Smi::FromInt(length)));
mov(FieldOperand(result, String::kHashFieldOffset),
@@ -1806,10 +1802,10 @@ void MacroAssembler::AllocateTwoByteConsString(Register result,
}
-void MacroAssembler::AllocateAsciiConsString(Register result,
- Register scratch1,
- Register scratch2,
- Label* gc_required) {
+void MacroAssembler::AllocateOneByteConsString(Register result,
+ Register scratch1,
+ Register scratch2,
+ Label* gc_required) {
Allocate(ConsString::kSize,
result,
scratch1,
@@ -1819,7 +1815,7 @@ void MacroAssembler::AllocateAsciiConsString(Register result,
// Set the map. The other fields are left uninitialized.
mov(FieldOperand(result, HeapObject::kMapOffset),
- Immediate(isolate()->factory()->cons_ascii_string_map()));
+ Immediate(isolate()->factory()->cons_one_byte_string_map()));
}
@@ -1837,17 +1833,17 @@ void MacroAssembler::AllocateTwoByteSlicedString(Register result,
}
-void MacroAssembler::AllocateAsciiSlicedString(Register result,
- Register scratch1,
- Register scratch2,
- Label* gc_required) {
+void MacroAssembler::AllocateOneByteSlicedString(Register result,
+ Register scratch1,
+ Register scratch2,
+ Label* gc_required) {
// Allocate heap number in new space.
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
TAG_OBJECT);
// Set the map. The other fields are left uninitialized.
mov(FieldOperand(result, HeapObject::kMapOffset),
- Immediate(isolate()->factory()->sliced_ascii_string_map()));
+ Immediate(isolate()->factory()->sliced_one_byte_string_map()));
}
@@ -2911,10 +2907,8 @@ void MacroAssembler::LookupNumberStringCache(Register object,
}
-void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
- Register instance_type,
- Register scratch,
- Label* failure) {
+void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(
+ Register instance_type, Register scratch, Label* failure) {
if (!scratch.is(instance_type)) {
mov(scratch, instance_type);
}
@@ -2925,11 +2919,11 @@ void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
}
-void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
- Register object2,
- Register scratch1,
- Register scratch2,
- Label* failure) {
+void MacroAssembler::JumpIfNotBothSequentialOneByteStrings(Register object1,
+ Register object2,
+ Register scratch1,
+ Register scratch2,
+ Label* failure) {
// Check that both objects are not smis.
STATIC_ASSERT(kSmiTag == 0);
mov(scratch1, object1);
@@ -2942,17 +2936,17 @@ void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
- // Check that both are flat ASCII strings.
- const int kFlatAsciiStringMask =
+ // Check that both are flat one-byte strings.
+ const int kFlatOneByteStringMask =
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
- const int kFlatAsciiStringTag =
+ const int kFlatOneByteStringTag =
kStringTag | kOneByteStringTag | kSeqStringTag;
// Interleave bits from both instance types and compare them in one check.
- DCHECK_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
- and_(scratch1, kFlatAsciiStringMask);
- and_(scratch2, kFlatAsciiStringMask);
+ DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << 3));
+ and_(scratch1, kFlatOneByteStringMask);
+ and_(scratch2, kFlatOneByteStringMask);
lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
- cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3));
+ cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << 3));
j(not_equal, failure);
}
@@ -3291,12 +3285,12 @@ void MacroAssembler::EnsureNotWhite(
jmp(&is_data_object, Label::kNear);
bind(&not_external);
- // Sequential string, either ASCII or UC16.
+ // Sequential string, either Latin1 or UC16.
DCHECK(kOneByteStringTag == 0x04);
and_(length, Immediate(kStringEncodingMask));
xor_(length, Immediate(kStringEncodingMask));
add(length, Immediate(0x04));
- // Value now either 4 (if ASCII) or 8 (if UC16), i.e., char-size shifted
+ // Value now either 4 (if Latin1) or 8 (if UC16), i.e., char-size shifted
// by 2. If we multiply the string length as smi by this, it still
// won't overflow a 32-bit value.
DCHECK_EQ(SeqOneByteString::kMaxSize, SeqTwoByteString::kMaxSize);

Powered by Google App Engine
This is Rietveld 408576698