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

Unified Diff: src/code-stubs.cc

Issue 2198133002: [turbofan] Minor refactoring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@RefactorCodeStubs
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index c663cd8878944431daf67e8a20a43e8264fb208b..a5dae551e7bb047d029a156107cefec16e194335 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -522,10 +522,8 @@ SIMD128_TYPES(SIMD128_GEN_ASM)
void StringLengthStub::GenerateAssembly(CodeStubAssembler* assembler) const {
compiler::Node* value = assembler->Parameter(0);
- compiler::Node* string =
- assembler->LoadObjectField(value, JSValue::kValueOffset);
- compiler::Node* result =
- assembler->LoadObjectField(string, String::kLengthOffset);
+ compiler::Node* string = assembler->LoadJSValueValue(value);
+ compiler::Node* result = assembler->LoadStringLength(string);
assembler->Return(result);
}
@@ -3397,8 +3395,8 @@ void GenerateStringRelationalComparison(CodeStubAssembler* assembler,
assembler->Bind(&if_bothonebyteseqstrings);
{
// Load the length of {lhs} and {rhs}.
- Node* lhs_length = assembler->LoadObjectField(lhs, String::kLengthOffset);
- Node* rhs_length = assembler->LoadObjectField(rhs, String::kLengthOffset);
+ Node* lhs_length = assembler->LoadStringLength(lhs);
+ Node* rhs_length = assembler->LoadStringLength(rhs);
// Determine the minimum length.
Node* length = assembler->SmiMin(lhs_length, rhs_length);
@@ -3569,8 +3567,8 @@ void GenerateStringEqual(CodeStubAssembler* assembler, ResultMode mode) {
// The {lhs} and {rhs} don't refer to the exact same String object.
// Load the length of {lhs} and {rhs}.
- Node* lhs_length = assembler->LoadObjectField(lhs, String::kLengthOffset);
- Node* rhs_length = assembler->LoadObjectField(rhs, String::kLengthOffset);
+ Node* lhs_length = assembler->LoadStringLength(lhs);
+ Node* rhs_length = assembler->LoadStringLength(rhs);
// Check if the lengths of {lhs} and {rhs} are equal.
Label if_lengthisequal(assembler), if_lengthisnotequal(assembler);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698