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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/ast_transformer.h ('k') | runtime/vm/class_finalizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast_transformer.cc
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index 8954f0a15f3f6caea4772d0f24b99ebeb7dd97ea..8b14e299bf7fa5a93715ac2a6814468e3614b6c0 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -14,7 +14,7 @@ namespace dart {
#define Z (thread()->zone())
// Quick synthetic token position.
-#define ST(token_pos) Token::ToSynthetic(token_pos)
+#define ST(token_pos) ((token_pos).ToSynthetic())
// Nodes that are unreachable from already parsed expressions.
#define FOR_EACH_UNREACHABLE_NODE(V) \
@@ -74,7 +74,7 @@ LocalVariable* AwaitTransformer::EnsureCurrentTempVar() {
if (await_tmp == NULL) {
// We need a new temp variable; add it to the function's top scope.
await_tmp = new (Z) LocalVariable(
- Token::kNoSourcePos, symbol, Object::dynamic_type());
+ TokenPosition::kNoSource, symbol, Object::dynamic_type());
async_temp_scope_->AddVariable(await_tmp);
// After adding it to the top scope, we can look it up from the preamble.
// The following call includes an ASSERT check.
@@ -92,10 +92,11 @@ LocalVariable* AwaitTransformer::GetVariableInScope(LocalScope* scope,
}
-LocalVariable* AwaitTransformer::AddToPreambleNewTempVar(AstNode* node,
- intptr_t token_pos) {
+LocalVariable* AwaitTransformer::AddToPreambleNewTempVar(
+ AstNode* node,
+ TokenPosition token_pos) {
LocalVariable* tmp_var = EnsureCurrentTempVar();
- ASSERT(Token::IsSynthetic(token_pos) || Token::IsNoSource(token_pos));
+ ASSERT(token_pos.IsSynthetic() || token_pos.IsNoSource());
preamble_->Add(new(Z) StoreLocalNode(token_pos, tmp_var, node));
NextTempVar();
return tmp_var;
@@ -124,7 +125,7 @@ void AwaitTransformer::VisitAwaitNode(AwaitNode* node) {
// :saved_try_ctx_var = :await_saved_try_ctx_var_y;
// :await_temp_var_(X+1) = :result_param;
- const intptr_t token_pos = ST(node->token_pos());
+ const TokenPosition token_pos = ST(node->token_pos());
LocalVariable* async_op = GetVariableInScope(
preamble_->scope(), Symbols::AsyncOperation());
LocalVariable* async_then_callback = GetVariableInScope(
« no previous file with comments | « runtime/vm/ast_transformer.h ('k') | runtime/vm/class_finalizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698