Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index c215142409b16997e464b0c2ae9fb500b69897cb..ff3810023e9b3de72f06453a6281f4b8279cec64 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -782,6 +782,30 @@ void MacroAssembler::AllocateAsciiString(Register result, |
} |
+void MacroAssembler::AllocateAsciiString(Register result, |
+ int length, |
+ Register scratch, |
Søren Thygesen Gjesse
2010/09/01 11:19:31
Maybe add another scratch register and pass that a
Vitaly Repeshko
2010/09/01 17:21:51
Done.
|
+ Label* gc_required) { |
+ ASSERT(length > 0); |
+ |
+ // Allocate ascii string in new space. |
+ AllocateInNewSpace(SeqAsciiString::SizeFor(length), |
+ result, |
+ scratch, |
+ no_reg, |
+ gc_required, |
+ TAG_OBJECT); |
+ |
+ // Set the map, length and hash field. |
+ mov(FieldOperand(result, HeapObject::kMapOffset), |
+ Immediate(Factory::ascii_string_map())); |
+ mov(FieldOperand(result, String::kLengthOffset), |
+ Immediate(Smi::FromInt(length))); |
+ mov(FieldOperand(result, String::kHashFieldOffset), |
+ Immediate(String::kEmptyHashField)); |
+} |
+ |
+ |
void MacroAssembler::AllocateConsString(Register result, |
Register scratch1, |
Register scratch2, |