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

Unified Diff: runtime/vm/object.cc

Issue 1933933002: Use a reusable handle in SubString instead of creating one as this path is now used when creating S… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: pass-thread Created 4 years, 8 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 | « runtime/vm/object.h ('k') | runtime/vm/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 33cb344bd4698ea7c22bb47507b844880f86de3f..02b05d549558c105ea73c78f47e940c39a3a1766 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -20050,7 +20050,8 @@ RawString* String::SubString(const String& str,
}
-RawString* String::SubString(const String& str,
+RawString* String::SubString(Thread* thread,
+ const String& str,
intptr_t begin_index,
intptr_t length,
Heap::Space space) {
@@ -20063,7 +20064,6 @@ RawString* String::SubString(const String& str,
if (begin_index > str.Length()) {
return String::null();
}
- String& result = String::Handle();
bool is_one_byte_string = true;
intptr_t char_size = str.CharSize();
if (char_size == kTwoByteChar) {
@@ -20074,6 +20074,8 @@ RawString* String::SubString(const String& str,
}
}
}
+ REUSABLE_STRING_HANDLESCOPE(thread);
+ String& result = thread->StringHandle();
if (is_one_byte_string) {
result = OneByteString::New(length, space);
} else {
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698