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

Side by Side Diff: frog/leg/ssa/builder.dart

Issue 9703074: Call the compile-time constant handler inside bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 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
« no previous file with comments | « frog/leg/compile_time_constants.dart ('k') | tests/co19/co19-leg.status » ('j') | 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 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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 // Example: A.f() or f() with 'f' bound to a static function. 1976 // Example: A.f() or f() with 'f' bound to a static function.
1977 // Also includes new A() or new A.named() which is treated like a 1977 // Also includes new A() or new A.named() which is treated like a
1978 // static call to a factory. 1978 // static call to a factory.
1979 visitStaticSend(node); 1979 visitStaticSend(node);
1980 } else { 1980 } else {
1981 compiler.internalError("Cannot generate code for send", node: node); 1981 compiler.internalError("Cannot generate code for send", node: node);
1982 } 1982 }
1983 } 1983 }
1984 } 1984 }
1985 1985
1986 visitNewExpression(NewExpression node) => visitSend(node.send); 1986 visitNewExpression(NewExpression node) {
1987 if (node.isConst()) {
1988 ConstantHandler handler = compiler.constantHandler;
1989 Constant constant = handler.compileNodeWithDefinitions(node, elements);
1990 stack.add(graph.addConstant(constant));
1991 } else {
1992 visitSend(node.send);
1993 }
1994 }
1987 1995
1988 visitSendSet(SendSet node) { 1996 visitSendSet(SendSet node) {
1989 Operator op = node.assignmentOperator; 1997 Operator op = node.assignmentOperator;
1990 if (node.isSuperCall) { 1998 if (node.isSuperCall) {
1991 compiler.unimplemented('super property store', node: node); 1999 compiler.unimplemented('super property store', node: node);
1992 } else if (node.isIndex) { 2000 } else if (node.isIndex) {
1993 if (!methodInterceptionEnabled) { 2001 if (!methodInterceptionEnabled) {
1994 assert(op.source.stringValue === '='); 2002 assert(op.source.stringValue === '=');
1995 visitDynamicSend(node); 2003 visitDynamicSend(node);
1996 } else { 2004 } else {
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 HInstruction concat = new HAdd(target, left, right); 2818 HInstruction concat = new HAdd(target, left, right);
2811 builder.add(concat); 2819 builder.add(concat);
2812 return concat; 2820 return concat;
2813 } 2821 }
2814 2822
2815 HInstruction result() { 2823 HInstruction result() {
2816 flushAccumulator(); 2824 flushAccumulator();
2817 return prefix; 2825 return prefix;
2818 } 2826 }
2819 } 2827 }
OLDNEW
« no previous file with comments | « frog/leg/compile_time_constants.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698