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

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

Issue 12517012: Revert "Revert "Use interceptor convention for methods declared on native classes."" (Closed) Base URL: https://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 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } else if (cls == builder.backend.jsDoubleClass) { 314 } else if (cls == builder.backend.jsDoubleClass) {
315 type = HType.DOUBLE; 315 type = HType.DOUBLE;
316 } else if (cls == builder.backend.jsNullClass) { 316 } else if (cls == builder.backend.jsNullClass) {
317 type = HType.NULL; 317 type = HType.NULL;
318 } else if (cls == builder.backend.jsBoolClass) { 318 } else if (cls == builder.backend.jsBoolClass) {
319 type = HType.BOOLEAN; 319 type = HType.BOOLEAN;
320 } else if (cls == builder.backend.jsFunctionClass) { 320 } else if (cls == builder.backend.jsFunctionClass) {
321 type = HType.UNKNOWN; 321 type = HType.UNKNOWN;
322 } else if (cls != compiler.objectClass) { 322 } else if (cls != compiler.objectClass) {
323 JavaScriptBackend backend = compiler.backend; 323 JavaScriptBackend backend = compiler.backend;
324 assert(!backend.isInterceptorClass(cls)); 324 if (!backend.isInterceptorClass(cls)) {
325 name = const SourceString('_'); 325 name = const SourceString('_');
326 }
326 } 327 }
327 Element parameter = new InterceptedElement(type, name, element); 328 Element parameter = new InterceptedElement(type, name, element);
328 HParameterValue value = new HParameterValue(parameter); 329 HParameterValue value = new HParameterValue(parameter);
329 builder.graph.explicitReceiverParameter = value; 330 builder.graph.explicitReceiverParameter = value;
330 builder.graph.entry.addAfter( 331 builder.graph.entry.addAfter(
331 directLocals[closureData.thisElement], value); 332 directLocals[closureData.thisElement], value);
332 if (builder.backend.isInterceptorClass(cls.declaration)) { 333 if (builder.backend.isInterceptorClass(cls.declaration)) {
333 // Only use the extra parameter in intercepted classes. 334 // Only use the extra parameter in intercepted classes.
334 directLocals[closureData.thisElement] = value; 335 directLocals[closureData.thisElement] = value;
335 } 336 }
(...skipping 4787 matching lines...) Expand 10 before | Expand all | Expand 10 after
5123 new HSubGraphBlockInformation(elseBranch.graph)); 5124 new HSubGraphBlockInformation(elseBranch.graph));
5124 5125
5125 HBasicBlock conditionStartBlock = conditionBranch.block; 5126 HBasicBlock conditionStartBlock = conditionBranch.block;
5126 conditionStartBlock.setBlockFlow(info, joinBlock); 5127 conditionStartBlock.setBlockFlow(info, joinBlock);
5127 SubGraph conditionGraph = conditionBranch.graph; 5128 SubGraph conditionGraph = conditionBranch.graph;
5128 HIf branch = conditionGraph.end.last; 5129 HIf branch = conditionGraph.end.last;
5129 assert(branch is HIf); 5130 assert(branch is HIf);
5130 branch.blockInformation = conditionStartBlock.blockFlow; 5131 branch.blockInformation = conditionStartBlock.blockFlow;
5131 } 5132 }
5132 } 5133 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698