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

Side by Side Diff: runtime/vm/scanner.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scanner.h" 5 #include "vm/scanner.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 i++; 324 i++;
325 } 325 }
326 } 326 }
327 327
328 // We did not read a keyword. 328 // We did not read a keyword.
329 current_token_.kind = Token::kIDENT; 329 current_token_.kind = Token::kIDENT;
330 String& literal = 330 String& literal =
331 String::ZoneHandle(Z, Symbols::New(source_, ident_pos, ident_length)); 331 String::ZoneHandle(Z, Symbols::New(source_, ident_pos, ident_length));
332 if (ident_char0 == Library::kPrivateIdentifierStart) { 332 if (ident_char0 == Library::kPrivateIdentifierStart) {
333 // Private identifiers are mangled on a per library basis. 333 // Private identifiers are mangled on a per library basis.
334 literal = String::Concat(literal, private_key_); 334 literal = Symbols::FromConcat(literal, private_key_);
335 literal = Symbols::New(literal);
336 } 335 }
337 current_token_.literal = &literal; 336 current_token_.literal = &literal;
338 } 337 }
339 338
340 339
341 // Parse integer or double number literal of format: 340 // Parse integer or double number literal of format:
342 // NUMBER = INTEGER | DOUBLE 341 // NUMBER = INTEGER | DOUBLE
343 // INTEGER = D+ | (("0x" | "0X") H+) 342 // INTEGER = D+ | (("0x" | "0X") H+)
344 // DOUBLE = ((D+ ["." D*]) | ("." D+)) [ EXPONENT ] 343 // DOUBLE = ((D+ ["." D*]) | ("." D+)) [ EXPONENT ]
345 // EXPONENT = ("e" | "E") ["+" | "-"] D+ 344 // EXPONENT = ("e" | "E") ["+" | "-"] D+
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 keywords_[i].keyword_symbol = &Symbols::Keyword(token); 972 keywords_[i].keyword_symbol = &Symbols::Keyword(token);
974 973
975 int ch = keywords_[i].keyword_chars[0] - 'a'; 974 int ch = keywords_[i].keyword_chars[0] - 'a';
976 if (keywords_char_offset_[ch] == Token::kNumKeywords) { 975 if (keywords_char_offset_[ch] == Token::kNumKeywords) {
977 keywords_char_offset_[ch] = i; 976 keywords_char_offset_[ch] = i;
978 } 977 }
979 } 978 }
980 } 979 }
981 980
982 } // namespace dart 981 } // namespace dart
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | runtime/vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698