| Index: pkg/compiler/lib/src/native/ssa.dart
|
| diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
|
| index a14f7ad92bb2af307623b952138f459bfbd23df3..7ab20c576bb9f2699fdd63aef6c1153e9f935072 100644
|
| --- a/pkg/compiler/lib/src/native/ssa.dart
|
| +++ b/pkg/compiler/lib/src/native/ssa.dart
|
| @@ -3,24 +3,17 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| import '../common.dart';
|
| -import '../compiler.dart' show
|
| - Compiler;
|
| +import '../compiler.dart' show Compiler;
|
| import '../constants/values.dart';
|
| import '../dart_types.dart';
|
| import '../elements/elements.dart';
|
| import '../js/js.dart' as js;
|
| import '../js_backend/js_backend.dart';
|
| -import '../js_emitter/js_emitter.dart' show
|
| - CodeEmitterTask,
|
| - NativeEmitter;
|
| +import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
|
| import '../ssa/builder.dart' show SsaBuilder;
|
| -import '../ssa/nodes.dart' show
|
| - HInstruction,
|
| - HForeignCode,
|
| - HReturn;
|
| +import '../ssa/nodes.dart' show HInstruction, HForeignCode, HReturn;
|
| import '../tree/tree.dart';
|
| -import '../universe/side_effects.dart' show
|
| - SideEffects;
|
| +import '../universe/side_effects.dart' show SideEffects;
|
|
|
| final RegExp nativeRedirectionRegExp = new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$');
|
|
|
| @@ -31,8 +24,8 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
|
| JavaScriptBackend backend = builder.backend;
|
| DiagnosticReporter reporter = compiler.reporter;
|
|
|
| - HInstruction convertDartClosure(ParameterElement parameter,
|
| - FunctionType type) {
|
| + HInstruction convertDartClosure(
|
| + ParameterElement parameter, FunctionType type) {
|
| HInstruction local = builder.localsHandler.readLocal(parameter);
|
| ConstantValue arityConstant =
|
| builder.constantSystem.createInt(type.computeArity());
|
| @@ -99,25 +92,26 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
|
| } else if (element.kind == ElementKind.SETTER) {
|
| nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters';
|
| } else {
|
| - builder.reporter.internalError(element,
|
| - 'Unexpected kind: "${element.kind}".');
|
| + builder.reporter
|
| + .internalError(element, 'Unexpected kind: "${element.kind}".');
|
| }
|
|
|
| - builder.push(
|
| - new HForeignCode(
|
| - // TODO(sra): This could be cached. The number of templates should
|
| - // be proportional to the number of native methods, which is bounded
|
| - // by the dart: libraries.
|
| - js.js.uncachedExpressionTemplate(nativeMethodCall),
|
| - backend.dynamicType,
|
| - inputs, effects: new SideEffects()));
|
| + builder.push(new HForeignCode(
|
| + // TODO(sra): This could be cached. The number of templates should
|
| + // be proportional to the number of native methods, which is bounded
|
| + // by the dart: libraries.
|
| + js.js.uncachedExpressionTemplate(nativeMethodCall),
|
| + backend.dynamicType,
|
| + inputs,
|
| + effects: new SideEffects()));
|
| // TODO(johnniwinther): Provide source information.
|
| builder
|
| .close(new HReturn(builder.pop(), null))
|
| .addSuccessor(builder.graph.exit);
|
| } else {
|
| if (parameters.parameterCount != 0) {
|
| - reporter.internalError(nativeBody,
|
| + reporter.internalError(
|
| + nativeBody,
|
| 'native "..." syntax is restricted to '
|
| 'functions with zero parameters.');
|
| }
|
|
|