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

Unified Diff: src/ppc/codegen-ppc.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/ppc/codegen-ppc.cc
diff --git a/src/ppc/codegen-ppc.cc b/src/ppc/codegen-ppc.cc
index bb365b4e632b56ad25729d71f7e55ca3b5b2ffae..9109ca3fca6c80ee7487d070ec7f93e4e7740ff8 100644
--- a/src/ppc/codegen-ppc.cc
+++ b/src/ppc/codegen-ppc.cc
@@ -86,11 +86,13 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string,
__ andi(r0, result, Operand(kIsIndirectStringMask));
__ beq(&check_sequential, cr0);
- // Dispatch on the indirect string shape: slice or cons.
- Label cons_string;
- __ mov(ip, Operand(kSlicedNotConsMask));
- __ and_(r0, result, ip, SetRC);
- __ beq(&cons_string, cr0);
+ // Dispatch on the indirect string shape: slice or cons or thin.
+ Label cons_string, thin_string;
+ __ andi(ip, result, Operand(kStringRepresentationMask));
+ __ cmpi(ip, Operand(kConsStringTag));
+ __ beq(&cons_string);
+ __ cmpi(ip, Operand(kThinStringTag));
+ __ beq(&thin_string);
// Handle slices.
Label indirect_string_loaded;
@@ -100,6 +102,11 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string,
__ add(index, index, ip);
__ b(&indirect_string_loaded);
+ // Handle thin strings.
+ __ bind(&thin_string);
+ __ LoadP(string, FieldMemOperand(string, ThinString::kActualOffset));
+ __ b(&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