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

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

Issue 11877029: Correctly boolify feature test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Quotation marks Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to override [Element.computeType] because our 9 * methods. We need to override [Element.computeType] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 3054 matching lines...) Expand 10 before | Expand all | Expand 10 after
3065 HStatic target = new HStatic(element); 3065 HStatic target = new HStatic(element);
3066 add(target); 3066 add(target);
3067 List<HInstruction> inputs = <HInstruction>[target]; 3067 List<HInstruction> inputs = <HInstruction>[target];
3068 addGenericSendArgumentsToList(link, inputs); 3068 addGenericSendArgumentsToList(link, inputs);
3069 push(new HInvokeStatic(inputs)); 3069 push(new HInvokeStatic(inputs));
3070 } 3070 }
3071 } 3071 }
3072 3072
3073 FunctionSignature handleForeignRawFunctionRef(Send node, String name) { 3073 FunctionSignature handleForeignRawFunctionRef(Send node, String name) {
3074 if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) { 3074 if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
3075 compiler.cancel('$name requires exactly one argument', 3075 compiler.cancel('"$name" requires exactly one argument',
3076 node: node.argumentsNode); 3076 node: node.argumentsNode);
3077 } 3077 }
3078 Node closure = node.arguments.head; 3078 Node closure = node.arguments.head;
3079 Element element = elements[closure]; 3079 Element element = elements[closure];
3080 if (!Elements.isStaticOrTopLevelFunction(element)) { 3080 if (!Elements.isStaticOrTopLevelFunction(element)) {
3081 compiler.cancel( 3081 compiler.cancel(
3082 '$name requires a static or top-level method', 3082 '"$name" requires a static or top-level method',
3083 node: closure); 3083 node: closure);
3084 } 3084 }
3085 FunctionElement function = element; 3085 FunctionElement function = element;
3086 // TODO(johnniwinther): Try to eliminate the need to distinguish declaration 3086 // TODO(johnniwinther): Try to eliminate the need to distinguish declaration
3087 // and implementation signatures. Currently it is need because the 3087 // and implementation signatures. Currently it is need because the
3088 // signatures have different elements for parameters. 3088 // signatures have different elements for parameters.
3089 FunctionElement implementation = function.implementation; 3089 FunctionElement implementation = function.implementation;
3090 FunctionSignature params = implementation.computeSignature(compiler); 3090 FunctionSignature params = implementation.computeSignature(compiler);
3091 if (params.optionalParameterCount != 0) { 3091 if (params.optionalParameterCount != 0) {
3092 compiler.cancel( 3092 compiler.cancel(
3093 '$name does not handle closure with optional parameters', 3093 '"$name" does not handle closure with optional parameters',
3094 node: closure); 3094 node: closure);
3095 } 3095 }
3096 visit(closure); 3096 visit(closure);
3097 return params; 3097 return params;
3098 } 3098 }
3099 3099
3100 void handleForeignDartClosureToJs(Send node, String name) { 3100 void handleForeignDartClosureToJs(Send node, String name) {
3101 FunctionSignature params = handleForeignRawFunctionRef(node, name); 3101 FunctionSignature params = handleForeignRawFunctionRef(node, name);
3102 List<HInstruction> inputs = <HInstruction>[pop()]; 3102 List<HInstruction> inputs = <HInstruction>[pop()];
3103 String invocationName = backend.namer.invocationName( 3103 String invocationName = backend.namer.invocationName(
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after
5095 new HSubGraphBlockInformation(elseBranch.graph)); 5095 new HSubGraphBlockInformation(elseBranch.graph));
5096 5096
5097 HBasicBlock conditionStartBlock = conditionBranch.block; 5097 HBasicBlock conditionStartBlock = conditionBranch.block;
5098 conditionStartBlock.setBlockFlow(info, joinBlock); 5098 conditionStartBlock.setBlockFlow(info, joinBlock);
5099 SubGraph conditionGraph = conditionBranch.graph; 5099 SubGraph conditionGraph = conditionBranch.graph;
5100 HIf branch = conditionGraph.end.last; 5100 HIf branch = conditionGraph.end.last;
5101 assert(branch is HIf); 5101 assert(branch is HIf);
5102 branch.blockInformation = conditionStartBlock.blockFlow; 5102 branch.blockInformation = conditionStartBlock.blockFlow;
5103 } 5103 }
5104 } 5104 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698