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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10540052: Only generate assert in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 add(typeInfoSetter); 2365 add(typeInfoSetter);
2366 Selector setSelector = Selector.INVOCATION_2; 2366 Selector setSelector = Selector.INVOCATION_2;
2367 var inputs = <HInstruction>[typeInfoSetter, instance, typeInfo]; 2367 var inputs = <HInstruction>[typeInfoSetter, instance, typeInfo];
2368 add(new HInvokeStatic(setSelector, inputs)); 2368 add(new HInvokeStatic(setSelector, inputs));
2369 } 2369 }
2370 } 2370 }
2371 2371
2372 visitStaticSend(Send node) { 2372 visitStaticSend(Send node) {
2373 Selector selector = elements.getSelector(node); 2373 Selector selector = elements.getSelector(node);
2374 Element element = elements[node]; 2374 Element element = elements[node];
2375 if (element == compiler.assertMethod && !compiler.enableUserAssertions) {
kasperl 2012/06/08 05:34:05 ===?
ngeoffray 2012/06/08 09:40:58 Done.
2376 stack.add(graph.addConstantNull());
karlklose 2012/06/08 07:42:42 I guess we add null here because we do not check t
ahe 2012/06/08 07:59:14 I don't think Nicolas needs to worry about this no
ngeoffray 2012/06/08 09:40:58 OK. Note that I think we will keep the the addCons
2377 return;
2378 }
2375 compiler.ensure(element.kind !== ElementKind.GENERATIVE_CONSTRUCTOR); 2379 compiler.ensure(element.kind !== ElementKind.GENERATIVE_CONSTRUCTOR);
2376 HInstruction target = new HStatic(element); 2380 HInstruction target = new HStatic(element);
2377 add(target); 2381 add(target);
2378 var inputs = <HInstruction>[]; 2382 var inputs = <HInstruction>[];
2379 inputs.add(target); 2383 inputs.add(target);
2380 if (element.kind == ElementKind.FUNCTION) { 2384 if (element.kind == ElementKind.FUNCTION) {
2381 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, 2385 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
2382 element, inputs); 2386 element, inputs);
2383 if (!succeeded) { 2387 if (!succeeded) {
2384 // TODO(ngeoffray): Match the VM behavior and throw an 2388 // TODO(ngeoffray): Match the VM behavior and throw an
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
3430 void visitNodeList(NodeList node) { 3434 void visitNodeList(NodeList node) {
3431 node.visitChildren(this); 3435 node.visitChildren(this);
3432 } 3436 }
3433 3437
3434 HInstruction concat(HInstruction left, HInstruction right) { 3438 HInstruction concat(HInstruction left, HInstruction right) {
3435 HInstruction instruction = new HStringConcat(left, right, node); 3439 HInstruction instruction = new HStringConcat(left, right, node);
3436 builder.add(instruction); 3440 builder.add(instruction);
3437 return instruction; 3441 return instruction;
3438 } 3442 }
3439 } 3443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698