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

Unified Diff: runtime/vm/scanner.cc

Issue 982873004: Thread/Isolate refactoring: new(Isolate) -> new(Zone) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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/scanner.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
===================================================================
--- runtime/vm/scanner.cc (revision 44266)
+++ runtime/vm/scanner.cc (working copy)
@@ -18,8 +18,8 @@
DEFINE_FLAG(bool, print_tokens, false, "Print scanned tokens.");
-// Quick access to the locally defined isolate() method.
-#define I (isolate())
+// Quick access to the locally defined zone() method.
+#define Z (zone())
class ScanContext : public ZoneAllocated {
@@ -83,7 +83,7 @@
saved_context_(NULL),
private_key_(String::ZoneHandle(private_key.raw())),
char_at_func_(src.CharAtFunc()),
- isolate_(Isolate::Current()) {
+ zone_(Thread::Current()->zone()) {
Reset();
}
@@ -93,7 +93,7 @@
void Scanner::ErrorMsg(const char* msg) {
current_token_.kind = Token::kERROR;
- current_token_.literal = &String::ZoneHandle(I, Symbols::New(msg));
+ current_token_.literal = &String::ZoneHandle(Z, Symbols::New(msg));
current_token_.position = c0_pos_;
token_start_ = lookahead_pos_;
current_token_.offset = lookahead_pos_;
@@ -101,7 +101,7 @@
void Scanner::PushContext() {
- ScanContext* ctx = new(I) ScanContext(this);
+ ScanContext* ctx = new(Z) ScanContext(this);
saved_context_ = ctx;
string_delimiter_ = '\0';
string_is_multiline_ = false;
@@ -328,7 +328,7 @@
// We did not read a keyword.
current_token_.kind = Token::kIDENT;
String& literal =
- String::ZoneHandle(I, Symbols::New(source_, ident_pos, ident_length));
+ String::ZoneHandle(Z, Symbols::New(source_, ident_pos, ident_length));
if (ident_char0 == Library::kPrivateIdentifierStart) {
// Private identifiers are mangled on a per library basis.
literal = String::Concat(literal, private_key_);
@@ -386,7 +386,7 @@
}
if (current_token_.kind != Token::kILLEGAL) {
intptr_t len = lookahead_pos_ - token_start_;
- String& str = String::ZoneHandle(I,
+ String& str = String::ZoneHandle(Z,
String::SubString(source_, token_start_, len, Heap::kOld));
str = Symbols::New(str);
current_token_.literal = &str;
@@ -541,7 +541,7 @@
// Scanned a string piece.
ASSERT(string_chars.data() != NULL);
// Strings are canonicalized: Allocate a symbol.
- current_token_.literal = &String::ZoneHandle(I,
+ current_token_.literal = &String::ZoneHandle(Z,
Symbols::FromUTF32(string_chars.data(), string_chars.length()));
// Preserve error tokens.
if (current_token_.kind != Token::kERROR) {
@@ -564,7 +564,7 @@
Recognize(Token::kSTRING);
ASSERT(string_chars.data() != NULL);
// Strings are canonicalized: Allocate a symbol.
- current_token_.literal = &String::ZoneHandle(I,
+ current_token_.literal = &String::ZoneHandle(Z,
Symbols::FromUTF32(string_chars.data(), string_chars.length()));
}
EndStringLiteral();
@@ -929,7 +929,7 @@
const Scanner::GrowableTokenStream& Scanner::GetStream() {
- GrowableTokenStream* ts = new(I) GrowableTokenStream(128);
+ GrowableTokenStream* ts = new(Z) GrowableTokenStream(128);
ScanAll(ts);
if (FLAG_print_tokens) {
Scanner::PrintTokens(*ts);
« no previous file with comments | « runtime/vm/scanner.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698