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

Side by Side Diff: runtime/vm/scanner.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, 7 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
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 i++; 326 i++;
327 } 327 }
328 } 328 }
329 329
330 // We did not read a keyword. 330 // We did not read a keyword.
331 current_token_.kind = Token::kIDENT; 331 current_token_.kind = Token::kIDENT;
332 String& literal = String::ZoneHandle(Z); 332 String& literal = String::ZoneHandle(Z);
333 if (ident_char0 == Library::kPrivateIdentifierStart) { 333 if (ident_char0 == Library::kPrivateIdentifierStart) {
334 // Private identifiers are mangled on a per library basis. 334 // Private identifiers are mangled on a per library basis.
335 literal = String::SubString(source_, ident_pos, ident_length); 335 literal = String::SubString(T, source_, ident_pos, ident_length);
336 literal = Symbols::FromConcat(T, literal, private_key_); 336 literal = Symbols::FromConcat(T, literal, private_key_);
337 } else { 337 } else {
338 literal = Symbols::New(T, source_, ident_pos, ident_length); 338 literal = Symbols::New(T, source_, ident_pos, ident_length);
339 } 339 }
340 current_token_.literal = &literal; 340 current_token_.literal = &literal;
341 } 341 }
342 342
343 343
344 // Parse integer or double number literal of format: 344 // Parse integer or double number literal of format:
345 // NUMBER = INTEGER | DOUBLE 345 // NUMBER = INTEGER | DOUBLE
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 keywords_[i].keyword_symbol = &Symbols::Token(token); 978 keywords_[i].keyword_symbol = &Symbols::Token(token);
979 979
980 int ch = keywords_[i].keyword_chars[0] - 'a'; 980 int ch = keywords_[i].keyword_chars[0] - 'a';
981 if (keywords_char_offset_[ch] == Token::kNumKeywords) { 981 if (keywords_char_offset_[ch] == Token::kNumKeywords) {
982 keywords_char_offset_[ch] = i; 982 keywords_char_offset_[ch] = i;
983 } 983 }
984 } 984 }
985 } 985 }
986 986
987 } // namespace dart 987 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698