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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/tracer.dart

Issue 12310103: Small cleanups in RegExp to avoid generating lots of code just because there is a try/catch in our … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 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 library tracer; 5 library tracer;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'ssa.dart'; 8 import 'ssa.dart';
9 import '../js_backend/js_backend.dart'; 9 import '../js_backend/js_backend.dart';
10 import '../dart2jslib.dart'; 10 import '../dart2jslib.dart';
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 JavaScriptItemCompilationContext context; 169 JavaScriptItemCompilationContext context;
170 HBasicBlock currentBlock; 170 HBasicBlock currentBlock;
171 171
172 HInstructionStringifier(this.context, this.currentBlock); 172 HInstructionStringifier(this.context, this.currentBlock);
173 173
174 visit(HInstruction node) => node.accept(this); 174 visit(HInstruction node) => node.accept(this);
175 175
176 String temporaryId(HInstruction instruction) { 176 String temporaryId(HInstruction instruction) {
177 String prefix; 177 String prefix;
178 HType type = instruction.instructionType; 178 HType type = instruction.instructionType;
179 if (!type.isPrimitive()) { 179 if (type == HType.MUTABLE_ARRAY) {
180 prefix = 'm';
181 } else if (type == HType.READABLE_ARRAY) {
182 prefix = 'a';
183 } else if (type == HType.EXTENDABLE_ARRAY) {
184 prefix = 'e';
185 } else if (type == HType.BOOLEAN) {
186 prefix = 'b';
187 } else if (type == HType.INTEGER) {
188 prefix = 'i';
189 } else if (type == HType.DOUBLE) {
190 prefix = 'd';
191 } else if (type == HType.NUMBER) {
192 prefix = 'n';
193 } else if (type == HType.STRING) {
194 prefix = 's';
195 } else if (type == HType.UNKNOWN) {
196 prefix = 'v';
197 } else if (type == HType.CONFLICTING) {
198 prefix = 'c';
199 } else if (type == HType.INDEXABLE_PRIMITIVE) {
200 prefix = 'r';
201 } else if (type == HType.NULL) {
202 prefix = 'u';
203 } else {
180 prefix = 'U'; 204 prefix = 'U';
181 } else {
182 if (type == HType.MUTABLE_ARRAY) {
183 prefix = 'm';
184 } else if (type == HType.READABLE_ARRAY) {
185 prefix = 'a';
186 } else if (type == HType.EXTENDABLE_ARRAY) {
187 prefix = 'e';
188 } else if (type == HType.BOOLEAN) {
189 prefix = 'b';
190 } else if (type == HType.INTEGER) {
191 prefix = 'i';
192 } else if (type == HType.DOUBLE) {
193 prefix = 'd';
194 } else if (type == HType.NUMBER) {
195 prefix = 'n';
196 } else if (type == HType.STRING) {
197 prefix = 's';
198 } else if (type == HType.UNKNOWN) {
199 prefix = 'v';
200 } else if (type == HType.CONFLICTING) {
201 prefix = 'c';
202 } else if (type == HType.INDEXABLE_PRIMITIVE) {
203 prefix = 'r';
204 } else if (type == HType.NULL) {
205 prefix = 'u';
206 } else {
207 prefix = 'x';
208 }
209 } 205 }
210 return "$prefix${instruction.id}"; 206 return "$prefix${instruction.id}";
211 } 207 }
212 208
213 String visitBailoutTarget(HBailoutTarget node) { 209 String visitBailoutTarget(HBailoutTarget node) {
214 StringBuffer envBuffer = new StringBuffer(); 210 StringBuffer envBuffer = new StringBuffer();
215 List<HInstruction> inputs = node.inputs; 211 List<HInstruction> inputs = node.inputs;
216 for (int i = 0; i < inputs.length; i++) { 212 for (int i = 0; i < inputs.length; i++) {
217 envBuffer.write(" ${temporaryId(inputs[i])}"); 213 envBuffer.write(" ${temporaryId(inputs[i])}");
218 } 214 }
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 550
555 String visitTypeConversion(HTypeConversion node) { 551 String visitTypeConversion(HTypeConversion node) {
556 return "TypeConversion: ${temporaryId(node.checkedInput)} to " 552 return "TypeConversion: ${temporaryId(node.checkedInput)} to "
557 "${node.instructionType}"; 553 "${node.instructionType}";
558 } 554 }
559 555
560 String visitRangeConversion(HRangeConversion node) { 556 String visitRangeConversion(HRangeConversion node) {
561 return "RangeConversion: ${node.checkedInput}"; 557 return "RangeConversion: ${node.checkedInput}";
562 } 558 }
563 } 559 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | sdk/lib/collection/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698