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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10866021: Simplify HInvokeInterceptor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index e3135c9ac09676d2f88dc5bec684ffed056905de..62b1a7b4c79f6fabde64d3d8fa41be396bcc068c 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -206,11 +206,11 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
}
if (input.isString(types)
- && node.name == const SourceString('toString')) {
+ && node.selector.name == const SourceString('toString')) {
return node.inputs[1];
}
- if (!input.canBePrimitive(types) && !node.getter && !node.setter) {
+ if (!input.canBePrimitive(types) && node.selector.isCall()) {
bool transformToDynamicInvocation = true;
if (input.canBeNull(types)) {
// Check if the method exists on Null. If yes we must not transform
@@ -664,15 +664,11 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
HInstruction index) {
HStatic interceptor = new HStatic(lengthInterceptor);
node.block.addBefore(node, interceptor);
- Selector selector = new Selector.call(
- lengthInterceptor.name,
- lengthInterceptor.getLibrary(), // TODO(kasperl): Wrong.
- 0);
+ Selector selector = new Selector.getter(
+ const SourceString('length'),
+ lengthInterceptor.getLibrary()); // TODO(kasperl): Wrong.
ngeoffray 2012/08/22 13:58:54 Actually, I think the instruction to create should
HInvokeInterceptor length = new HInvokeInterceptor(
- selector,
- const SourceString("length"),
- <HInstruction>[interceptor, receiver],
- getter: true);
+ selector, <HInstruction>[interceptor, receiver]);
types[length] = HType.INTEGER;
node.block.addBefore(node, length);
« lib/compiler/implementation/ssa/nodes.dart ('K') | « lib/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698