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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2732793002: Add NativeDataResolver (Closed)
Patch Set: Fix. Created 3 years, 9 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: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index d9d3bd91ed04e1407c23237ef9a386751df6b45d..e7695114498257cbb1be5f1ca03290a3226464af 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -412,7 +412,7 @@ class SsaBuilder extends ast.Visitor
{ResolutionInterfaceType instanceType}) {
registry.registerStaticUse(new StaticUse.inlining(element));
- if (backend.nativeData.isJsInterop(element) &&
+ if (backend.nativeData.isJsInteropMember(element) &&
!element.isFactoryConstructor) {
// We only inline factory JavaScript interop constructors.
return false;
@@ -449,7 +449,7 @@ class SsaBuilder extends ast.Visitor
}
}
- if (backend.nativeData.isJsInterop(function)) return false;
+ if (backend.nativeData.isJsInteropMember(function)) return false;
// Don't inline operator== methods if the parameter can be null.
if (function.name == '==') {
@@ -693,7 +693,7 @@ class SsaBuilder extends ast.Visitor
assert(elements.getFunctionDefinition(function) != null);
openFunction(functionElement, function);
String name = functionElement.name;
- if (backend.nativeData.isJsInterop(functionElement)) {
+ if (backend.nativeData.isJsInteropMember(functionElement)) {
push(invokeJsInteropFunction(functionElement, parameters.values.toList(),
sourceInformationBuilder.buildGeneric(function)));
var value = pop();
@@ -1180,7 +1180,7 @@ class SsaBuilder extends ast.Visitor
ClassElement classElement = functionElement.enclosingClass.implementation;
bool isNativeUpgradeFactory =
backend.nativeData.isNativeOrExtendsNative(classElement) &&
- !backend.nativeData.isJsInterop(classElement);
+ !backend.nativeData.isJsInteropClass(classElement);
ast.FunctionExpression function;
if (resolvedAst.kind == ResolvedAstKind.PARSED) {
function = resolvedAst.node;
@@ -2510,7 +2510,7 @@ class SsaBuilder extends ast.Visitor
arguments,
element,
compileArgument,
- backend.nativeData.isJsInterop(element)
+ backend.nativeData.isJsInteropMember(element)
? handleConstantForOptionalParameterJsInterop
: handleConstantForOptionalParameter);
}
@@ -3404,7 +3404,7 @@ class SsaBuilder extends ast.Visitor
if (constructor.isGenerativeConstructor &&
backend.nativeData
.isNativeOrExtendsNative(constructor.enclosingClass) &&
- !backend.nativeData.isJsInterop(constructor)) {
+ !backend.nativeData.isJsInteropMember(constructor)) {
// Native class generative constructors take a pre-constructed object.
inputs.add(graph.addConstantNull(closedWorld));
}
@@ -4011,7 +4011,7 @@ class SsaBuilder extends ast.Visitor
HForeignCode invokeJsInteropFunction(MethodElement element,
List<HInstruction> arguments, SourceInformation sourceInformation) {
- assert(backend.nativeData.isJsInterop(element));
+ assert(backend.nativeData.isJsInteropMember(element));
nativeEmitter.nativeMethods.add(element);
if (element.isFactoryConstructor &&
@@ -4129,7 +4129,7 @@ class SsaBuilder extends ast.Visitor
bool targetCanThrow = !closedWorld.getCannotThrow(element);
// TODO(5346): Try to avoid the need for calling [declaration] before
var instruction;
- if (backend.nativeData.isJsInterop(element)) {
+ if (backend.nativeData.isJsInteropMember(element)) {
instruction =
invokeJsInteropFunction(element, arguments, sourceInformation);
} else {

Powered by Google App Engine
This is Rietveld 408576698