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

Unified Diff: lib/compiler/implementation/ssa/codegen.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/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 9cfe2dbc9c2456278896de74881c55b1022fb402..2a908db76fd368dc8a5f81f0469c622cecb8d59a 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -2028,19 +2028,19 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// Don't count the target method or the receiver in the arity.
int arity = interceptor.inputs.length - 2;
HInstruction receiver = interceptor.inputs[1];
- bool getter = interceptor.getter;
- SourceString name = interceptor.name;
+ bool isCall = interceptor.selector.isCall();
+ SourceString name = interceptor.selector.name;
if (interceptor.isLengthGetterOnStringOrArray(types)) {
return 'length';
- } else if (receiver.isExtendableArray(types) && !getter) {
+ } else if (receiver.isExtendableArray(types) && isCall) {
if (name == const SourceString('add') && arity == 1) {
return 'push';
}
if (name == const SourceString('removeLast') && arity == 0) {
return 'pop';
}
- } else if (receiver.isString(types) && !getter) {
+ } else if (receiver.isString(types) && isCall) {
if (name == const SourceString('concat') &&
arity == 1 &&
interceptor.inputs[2].isString(types)) {
@@ -2062,7 +2062,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
} else {
use(node.inputs[1]);
js.PropertyAccess access = new js.PropertyAccess.field(pop(), builtin);
- if (node.getter) {
+ if (node.selector.isGetter()) {
push(access, node);
return;
}

Powered by Google App Engine
This is Rietveld 408576698