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

Unified Diff: runtime/vm/symbols.cc

Issue 1303923002: Remove new space allocation in optimizing compiler, use Symbols::FromConcat where appropriate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Optimize Symbols::FromConcat Created 5 years, 4 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
« runtime/vm/parser.cc ('K') | « runtime/vm/scanner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/symbols.cc
diff --git a/runtime/vm/symbols.cc b/runtime/vm/symbols.cc
index d7afc33b32bee0558a598664a3ae2568b501a51d..3fcba6f8cf201285ed4107ea71adfe3ecebbbb0b 100644
--- a/runtime/vm/symbols.cc
+++ b/runtime/vm/symbols.cc
@@ -383,7 +383,13 @@ RawString* Symbols::FromUTF32(const int32_t* utf32_array, intptr_t len) {
RawString* Symbols::FromConcat(const String& str1, const String& str2) {
- return NewSymbol(ConcatString(str1, str2));
+ if (str1.Length() == 0) {
+ return New(str2);
+ } else if (str2.Length() == 0) {
+ return New(str1);
+ } else {
+ return NewSymbol(ConcatString(str1, str2));
+ }
}
« runtime/vm/parser.cc ('K') | « runtime/vm/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698