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

Unified Diff: src/mips/codegen-mips.cc

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: forgot one Created 4 years 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/mips/codegen-mips.cc
diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc
index a57299abf67bc55042bc764ca7069a9a0e3cf166..15011023ccdaad35a072844fad8abce5be3d9d1d 100644
--- a/src/mips/codegen-mips.cc
+++ b/src/mips/codegen-mips.cc
@@ -620,9 +620,10 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
__ Branch(&check_sequential, eq, at, Operand(zero_reg));
// Dispatch on the indirect string shape: slice or cons.
- Label cons_string;
- __ And(at, result, Operand(kSlicedNotConsMask));
- __ Branch(&cons_string, eq, at, Operand(zero_reg));
+ Label cons_string, thin_string;
+ __ And(at, result, Operand(kStringRepresentationMask));
+ __ Branch(&cons_string, eq, at, Operand(kConsStringTag));
+ __ Branch(&thin_string, eq, at, Operand(kThinStringTag));
// Handle slices.
Label indirect_string_loaded;
@@ -632,6 +633,11 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
__ Addu(index, index, at);
__ jmp(&indirect_string_loaded);
+ // Handle thin strings.
+ __ bind(&thin_string);
+ __ lw(string, FieldMemOperand(string, ThinString::kActualOffset));
+ __ jmp(&indirect_string_loaded);
+
// Handle cons strings.
// Check whether the right hand side is the empty string (i.e. if
// this is really a flat string in a cons string). If that is not

Powered by Google App Engine
This is Rietveld 408576698