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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2646733006: Use entities in native_emitter.dart (Closed)
Patch Set: Updated cf. comments. Created 3 years, 11 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
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('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 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:js_runtime/shared/embedded_names.dart'; 7 import 'package:js_runtime/shared/embedded_names.dart';
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 ..sourceInformation = sourceInformation); 4001 ..sourceInformation = sourceInformation);
4002 } else if (selector.isSetter) { 4002 } else if (selector.isSetter) {
4003 push(new HInvokeDynamicSetter(selector, mask, null, inputs, type) 4003 push(new HInvokeDynamicSetter(selector, mask, null, inputs, type)
4004 ..sourceInformation = sourceInformation); 4004 ..sourceInformation = sourceInformation);
4005 } else { 4005 } else {
4006 push(new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted) 4006 push(new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted)
4007 ..sourceInformation = sourceInformation); 4007 ..sourceInformation = sourceInformation);
4008 } 4008 }
4009 } 4009 }
4010 4010
4011 HForeignCode invokeJsInteropFunction(FunctionElement element, 4011 HForeignCode invokeJsInteropFunction(MethodElement element,
4012 List<HInstruction> arguments, SourceInformation sourceInformation) { 4012 List<HInstruction> arguments, SourceInformation sourceInformation) {
4013 assert(backend.isJsInterop(element)); 4013 assert(backend.isJsInterop(element));
4014 nativeEmitter.nativeMethods.add(element); 4014 nativeEmitter.nativeMethods.add(element);
4015 4015
4016 if (element.isFactoryConstructor && 4016 if (element.isFactoryConstructor &&
4017 backend.jsInteropAnalysis 4017 backend.jsInteropAnalysis
4018 .hasAnonymousAnnotation(element.contextClass)) { 4018 .hasAnonymousAnnotation(element.contextClass)) {
4019 // Factory constructor that is syntactic sugar for creating a JavaScript 4019 // Factory constructor that is syntactic sugar for creating a JavaScript
4020 // object literal. 4020 // object literal.
4021 ConstructorElement constructor = element; 4021 ConstructorElement constructor = element;
(...skipping 22 matching lines...) Expand all
4044 ..codeTemplate = codeTemplate; 4044 ..codeTemplate = codeTemplate;
4045 if (compiler.options.trustJSInteropTypeAnnotations) { 4045 if (compiler.options.trustJSInteropTypeAnnotations) {
4046 nativeBehavior.typesReturned.add(constructor.enclosingClass.thisType); 4046 nativeBehavior.typesReturned.add(constructor.enclosingClass.thisType);
4047 } 4047 }
4048 return new HForeignCode( 4048 return new HForeignCode(
4049 codeTemplate, commonMasks.dynamicType, filteredArguments, 4049 codeTemplate, commonMasks.dynamicType, filteredArguments,
4050 nativeBehavior: nativeBehavior) 4050 nativeBehavior: nativeBehavior)
4051 ..sourceInformation = sourceInformation; 4051 ..sourceInformation = sourceInformation;
4052 } 4052 }
4053 var target = new HForeignCode( 4053 var target = new HForeignCode(
4054 js.js.parseForeignJS("${backend.namer.fixedBackendPath(element)}." 4054 js.js.parseForeignJS("${backend.namer.fixedBackendMethodPath(element)}."
4055 "${backend.nativeData.getFixedBackendName(element)}"), 4055 "${backend.nativeData.getFixedBackendName(element)}"),
4056 commonMasks.dynamicType, 4056 commonMasks.dynamicType,
4057 <HInstruction>[]); 4057 <HInstruction>[]);
4058 add(target); 4058 add(target);
4059 // Strip off trailing arguments that were not specified. 4059 // Strip off trailing arguments that were not specified.
4060 // we could assert that the trailing arguments are all null. 4060 // we could assert that the trailing arguments are all null.
4061 // TODO(jacobr): rewrite named arguments to an object literal matching 4061 // TODO(jacobr): rewrite named arguments to an object literal matching
4062 // the factory constructor case. 4062 // the factory constructor case.
4063 arguments = arguments.where((arg) => arg != null).toList(); 4063 arguments = arguments.where((arg) => arg != null).toList();
4064 var inputs = <HInstruction>[target]..addAll(arguments); 4064 var inputs = <HInstruction>[target]..addAll(arguments);
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
6719 this.oldReturnLocal, 6719 this.oldReturnLocal,
6720 this.oldReturnType, 6720 this.oldReturnType,
6721 this.oldResolvedAst, 6721 this.oldResolvedAst,
6722 this.oldStack, 6722 this.oldStack,
6723 this.oldLocalsHandler, 6723 this.oldLocalsHandler,
6724 this.inTryStatement, 6724 this.inTryStatement,
6725 this.allFunctionsCalledOnce, 6725 this.allFunctionsCalledOnce,
6726 this.oldElementInferenceResults) 6726 this.oldElementInferenceResults)
6727 : super(function); 6727 : super(function);
6728 } 6728 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698