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

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

Issue 11574030: Revert r16155: unit tests of the dart2js compiler fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 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 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3104 } 3104 }
3105 visit(closure); 3105 visit(closure);
3106 List<HInstruction> inputs = <HInstruction>[pop()]; 3106 List<HInstruction> inputs = <HInstruction>[pop()];
3107 String invocationName = backend.namer.closureInvocationName( 3107 String invocationName = backend.namer.closureInvocationName(
3108 new Selector.callClosure(params.requiredParameterCount)); 3108 new Selector.callClosure(params.requiredParameterCount));
3109 push(new HForeign(new DartString.literal('#.$invocationName'), 3109 push(new HForeign(new DartString.literal('#.$invocationName'),
3110 const LiteralDartString('var'), 3110 const LiteralDartString('var'),
3111 inputs)); 3111 inputs));
3112 } 3112 }
3113 3113
3114 void handleForeignSetCurrentIsolate(Send node) {
3115 if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
3116 compiler.cancel('Exactly one argument required',
3117 node: node.argumentsNode);
3118 }
3119 visit(node.arguments.head);
3120 String isolateName = backend.namer.CURRENT_ISOLATE;
3121 push(new HForeign(new DartString.literal("$isolateName = #"),
3122 const LiteralDartString('void'),
3123 <HInstruction>[pop()]));
3124 }
3125
3126 void handleForeignCreateIsolate(Send node) {
3127 if (!node.arguments.isEmpty) {
3128 compiler.cancel('Too many arguments',
3129 node: node.argumentsNode);
3130 }
3131 String constructorName = backend.namer.isolateName;
3132 push(new HForeign(new DartString.literal("new $constructorName"),
3133 const LiteralDartString('var'),
3134 <HInstruction>[]));
3135 }
3136
3137 visitForeignSend(Send node) { 3114 visitForeignSend(Send node) {
3138 Selector selector = elements.getSelector(node); 3115 Selector selector = elements.getSelector(node);
3139 SourceString name = selector.name; 3116 SourceString name = selector.name;
3140 if (name == const SourceString('JS')) { 3117 if (name == const SourceString('JS')) {
3141 handleForeignJs(node); 3118 handleForeignJs(node);
3142 } else if (name == const SourceString('UNINTERCEPTED')) { 3119 } else if (name == const SourceString('UNINTERCEPTED')) {
3143 handleForeignUnintercepted(node); 3120 handleForeignUnintercepted(node);
3144 } else if (name == const SourceString('JS_HAS_EQUALS')) { 3121 } else if (name == const SourceString('JS_HAS_EQUALS')) {
3145 handleForeignJsHasEquals(node); 3122 handleForeignJsHasEquals(node);
3146 } else if (name == const SourceString('JS_CURRENT_ISOLATE')) { 3123 } else if (name == const SourceString('JS_CURRENT_ISOLATE')) {
3147 handleForeignJsCurrentIsolate(node); 3124 handleForeignJsCurrentIsolate(node);
3148 } else if (name == const SourceString('JS_CALL_IN_ISOLATE')) { 3125 } else if (name == const SourceString('JS_CALL_IN_ISOLATE')) {
3149 handleForeignJsCallInIsolate(node); 3126 handleForeignJsCallInIsolate(node);
3150 } else if (name == const SourceString('DART_CLOSURE_TO_JS')) { 3127 } else if (name == const SourceString('DART_CLOSURE_TO_JS')) {
3151 handleForeignDartClosureToJs(node); 3128 handleForeignDartClosureToJs(node);
3152 } else if (name == const SourceString('JS_SET_CURRENT_ISOLATE')) {
3153 handleForeignSetCurrentIsolate(node);
3154 } else if (name == const SourceString('JS_CREATE_ISOLATE')) {
3155 handleForeignCreateIsolate(node);
3156 } else { 3129 } else {
3157 throw "Unknown foreign: ${selector}"; 3130 throw "Unknown foreign: ${selector}";
3158 } 3131 }
3159 } 3132 }
3160 3133
3161 generateSuperNoSuchMethodSend(Send node) { 3134 generateSuperNoSuchMethodSend(Send node) {
3162 Selector selector = elements.getSelector(node); 3135 Selector selector = elements.getSelector(node);
3163 SourceString name = selector.name; 3136 SourceString name = selector.name;
3164 3137
3165 ClassElement cls = work.element.getEnclosingClass(); 3138 ClassElement cls = work.element.getEnclosingClass();
(...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after
5092 new HSubGraphBlockInformation(elseBranch.graph)); 5065 new HSubGraphBlockInformation(elseBranch.graph));
5093 5066
5094 HBasicBlock conditionStartBlock = conditionBranch.block; 5067 HBasicBlock conditionStartBlock = conditionBranch.block;
5095 conditionStartBlock.setBlockFlow(info, joinBlock); 5068 conditionStartBlock.setBlockFlow(info, joinBlock);
5096 SubGraph conditionGraph = conditionBranch.graph; 5069 SubGraph conditionGraph = conditionBranch.graph;
5097 HIf branch = conditionGraph.end.last; 5070 HIf branch = conditionGraph.end.last;
5098 assert(branch is HIf); 5071 assert(branch is HIf);
5099 branch.blockInformation = conditionStartBlock.blockFlow; 5072 branch.blockInformation = conditionStartBlock.blockFlow;
5100 } 5073 }
5101 } 5074 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/native_handler.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698