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

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

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: rebased Created 3 years, 11 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
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/codegen-s390.cc
diff --git a/src/s390/codegen-s390.cc b/src/s390/codegen-s390.cc
index 02cc8c206c704338f94cd4e4d2798af5f0718a46..6b84200510af8245594c3fafac9385a8cdc462d7 100644
--- a/src/s390/codegen-s390.cc
+++ b/src/s390/codegen-s390.cc
@@ -70,6 +70,9 @@ void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string,
Register index, Register result,
Label* call_runtime) {
+ Label indirect_string_loaded;
+ __ bind(&indirect_string_loaded);
+
// Fetch the instance type of the receiver into result register.
__ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset));
__ LoadlB(result, FieldMemOperand(result, Map::kInstanceTypeOffset));
@@ -81,19 +84,25 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string,
__ beq(&check_sequential, Label::kNear /*, cr0*/);
// Dispatch on the indirect string shape: slice or cons.
- Label cons_string;
- __ mov(ip, Operand(kSlicedNotConsMask));
- __ LoadRR(r0, result);
- __ AndP(r0, ip /*, SetRC*/); // Should be okay to remove RC
- __ beq(&cons_string, Label::kNear /*, cr0*/);
+ Label cons_string, thin_string;
+ __ LoadRR(ip, result);
+ __ nilf(ip, Operand(kStringRepresentationMask));
+ __ CmpP(ip, Operand(kConsStringTag));
+ __ beq(&cons_string);
+ __ CmpP(ip, Operand(kThinStringTag));
+ __ beq(&thin_string);
// Handle slices.
- Label indirect_string_loaded;
__ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset));
__ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset));
__ SmiUntag(ip, result);
__ AddP(index, ip);
- __ b(&indirect_string_loaded, Label::kNear);
+ __ 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
@@ -106,10 +115,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string,
__ bne(call_runtime);
// Get the first of the two strings and load its instance type.
__ LoadP(string, FieldMemOperand(string, ConsString::kFirstOffset));
-
- __ bind(&indirect_string_loaded);
- __ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset));
- __ LoadlB(result, FieldMemOperand(result, Map::kInstanceTypeOffset));
+ __ b(&indirect_string_loaded);
// Distinguish sequential and external strings. Only these two string
// representations can reach here (slices and flat cons strings have been
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698