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

Side by Side Diff: frog/leg/compiler.dart

Issue 9427012: Allow binary operators on compile-time-constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
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 class WorkItem { 5 class WorkItem {
6 final Element element; 6 final Element element;
7 TreeElements resolutionTree; 7 TreeElements resolutionTree;
8 Function run; 8 Function run;
9 Map<int, BailoutInfo> bailouts = null; 9 Map<int, BailoutInfo> bailouts = null;
10 bool allowSpeculativeOptimization = true; 10 bool allowSpeculativeOptimization = true;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 emitter = new CodeEmitterTask(this); 96 emitter = new CodeEmitterTask(this);
97 tasks = [scanner, parser, resolver, checker, builder, optimizer, generator, 97 tasks = [scanner, parser, resolver, checker, builder, optimizer, generator,
98 emitter, compileTimeConstantHandler]; 98 emitter, compileTimeConstantHandler];
99 } 99 }
100 100
101 void ensure(bool condition) { 101 void ensure(bool condition) {
102 if (!condition) cancel('failed assertion in leg'); 102 if (!condition) cancel('failed assertion in leg');
103 } 103 }
104 104
105 void unimplemented(String methodName, 105 void unimplemented(String methodName,
106 [Node node, Token token, HInstruction instruction]) { 106 [Node node, Token token, HInstruction instruction,
107 cancel("$methodName not implemented", node, token, instruction); 107 Element element]) {
108 cancel("$methodName not implemented", node, token, instruction, element);
108 } 109 }
109 110
110 void internalError(String message, 111 void internalError(String message,
111 [Node node, Token token, HInstruction instruction, 112 [Node node, Token token, HInstruction instruction,
112 Element element]) { 113 Element element]) {
113 cancel("Internal Error: $message", node, token, instruction, element); 114 cancel("Internal Error: $message", node, token, instruction, element);
114 } 115 }
115 116
116 void cancel([String reason, Node node, Token token, 117 void cancel([String reason, Node node, Token token,
117 HInstruction instruction, Element element]) { 118 HInstruction instruction, Element element]) {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 400
400 class CompilerCancelledException implements Exception { 401 class CompilerCancelledException implements Exception {
401 final String reason; 402 final String reason;
402 CompilerCancelledException(this.reason); 403 CompilerCancelledException(this.reason);
403 404
404 String toString() { 405 String toString() {
405 String banner = 'compiler cancelled'; 406 String banner = 'compiler cancelled';
406 return (reason !== null) ? '$banner: $reason' : '$banner'; 407 return (reason !== null) ? '$banner: $reason' : '$banner';
407 } 408 }
408 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698