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

Unified Diff: src/builtins/builtins-string.cc

Issue 2452543003: Don't wrap roots in Handle just to dereference immediately. (Closed)
Patch Set: Created 4 years, 2 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/builtins/builtins-math.cc ('k') | src/frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-string.cc
diff --git a/src/builtins/builtins-string.cc b/src/builtins/builtins-string.cc
index 49fc6c28070186b6d713fd22aab4b147aa0943ab..7828dd231f1405874ee451211950f874c1562083 100644
--- a/src/builtins/builtins-string.cc
+++ b/src/builtins/builtins-string.cc
@@ -820,17 +820,17 @@ BUILTIN(StringPrototypeEndsWith) {
}
int start = end - search_string->length();
- if (start < 0) return *isolate->factory()->false_value();
+ if (start < 0) return isolate->heap()->false_value();
FlatStringReader str_reader(isolate, String::Flatten(str));
FlatStringReader search_reader(isolate, String::Flatten(search_string));
for (int i = 0; i < search_string->length(); i++) {
if (str_reader.Get(start + i) != search_reader.Get(i)) {
- return *isolate->factory()->false_value();
+ return isolate->heap()->false_value();
}
}
- return *isolate->factory()->true_value();
+ return isolate->heap()->true_value();
}
// ES6 section 21.1.3.7
@@ -1239,7 +1239,7 @@ BUILTIN(StringPrototypeStartsWith) {
}
if (start + search_string->length() > str->length()) {
- return *isolate->factory()->false_value();
+ return isolate->heap()->false_value();
}
FlatStringReader str_reader(isolate, String::Flatten(str));
@@ -1247,10 +1247,10 @@ BUILTIN(StringPrototypeStartsWith) {
for (int i = 0; i < search_string->length(); i++) {
if (str_reader.Get(start + i) != search_reader.Get(i)) {
- return *isolate->factory()->false_value();
+ return isolate->heap()->false_value();
}
}
- return *isolate->factory()->true_value();
+ return isolate->heap()->true_value();
}
// ES6 section 21.1.3.25 String.prototype.toString ()
« no previous file with comments | « src/builtins/builtins-math.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698