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

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

Issue 3327001: ia32 StringAddStub: fast two character case. (Closed)
Patch Set: Better comment. Created 10 years, 4 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 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,

Powered by Google App Engine
This is Rietveld 408576698