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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartScanner.java

Issue 10692198: Cache model elements for compiler elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug output, tweak for caching Created 8 years, 5 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
Index: compiler/java/com/google/dart/compiler/parser/DartScanner.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartScanner.java b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
index 904c13c21532d85ce2300143076a610cab70f49e..d79d39fddc47d82378dff1e1696ff601f5ac1c47 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartScanner.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
@@ -7,6 +7,7 @@ package com.google.dart.compiler.parser;
import com.google.dart.compiler.metrics.DartEventType;
import com.google.dart.compiler.metrics.Tracer;
import com.google.dart.compiler.metrics.Tracer.TraceEvent;
+import com.google.dart.compiler.parser.DartScanner.InternalState.Mode;
import java.util.ArrayList;
import java.util.List;
@@ -1322,13 +1323,15 @@ public class DartScanner {
}
private void skipWhiteSpace() {
- if ((internalState.getMode() != InternalState.Mode.DEFAULT)
- && (internalState.getMode() != InternalState.Mode.IN_STRING_EMBEDDED_EXPRESSION)) {
+ Mode mode = internalState.getMode();
+ if ((mode != InternalState.Mode.DEFAULT)
+ && (mode != InternalState.Mode.IN_STRING_EMBEDDED_EXPRESSION)) {
return;
}
while (true) {
- if (isLineTerminator(lookahead(0))) {
- } else if (!isWhiteSpace(lookahead(0))) {
+ int c = lookahead(0);
+ if (isLineTerminator(c)) {
+ } else if (!isWhiteSpace(c)) {
break;
}
advance();

Powered by Google App Engine
This is Rietveld 408576698