| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| index d025633cea73351b7ae16e336e238b1efe9fdd9d..5a26177def4e3b11efe350769586c4d9fdf290af 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| @@ -3201,6 +3201,33 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| argument, string.dartString.slowToString())));
|
| }
|
|
|
| + void handleJsInterceptorConstant(Send node) {
|
| + void bad(Node node) {
|
| + compiler.reportError(node,
|
| + MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
|
| + stack.add(graph.addConstantNull(compiler));
|
| + }
|
| + if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
|
| + return bad(node.arguments);
|
| + }
|
| + Node argument = node.arguments.head;
|
| + // argument must be a TypeConstant.
|
| + visit(argument);
|
| + HInstruction argumentInstruction = pop();
|
| + if (argumentInstruction is! HConstant) {
|
| + return bad(argument);
|
| + }
|
| + Constant argumentConstant = argumentInstruction.constant;
|
| + if (argumentConstant is! TypeConstant) {
|
| + return bad(argument);
|
| + }
|
| +
|
| + Constant constant =
|
| + new InterceptorConstant(argumentConstant.representedType);
|
| + HInstruction instruction = graph.addConstant(constant, compiler);
|
| + stack.add(instruction);
|
| + }
|
| +
|
| void handleForeignJsCallInIsolate(Send node) {
|
| Link<Node> link = node.arguments;
|
| if (!compiler.hasIsolateSupport()) {
|
| @@ -3370,6 +3397,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| handleForeignJsGetName(node);
|
| } else if (name == 'JS_EFFECT') {
|
| stack.add(graph.addConstantNull(compiler));
|
| + } else if (name == 'JS_INTERCEPTOR_CONSTANT') {
|
| + handleJsInterceptorConstant(node);
|
| } else {
|
| throw "Unknown foreign: ${selector}";
|
| }
|
|
|