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

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

Issue 2680823002: Extract InterceptorData from JavaScriptBackend. (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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 670d3cf16db95f61465e5f61f1d1ed356ccb9795..9bde50e62266c02535788556509e3751acb56e71 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -462,7 +462,7 @@ class SsaBuilder extends ast.Visitor
// Generative constructors of native classes should not be called directly
// and have an extra argument that causes problems with inlining.
if (function.isGenerativeConstructor &&
- backend.isNativeOrExtendsNative(function.enclosingClass)) {
+ backend.nativeData.isNativeOrExtendsNative(function.enclosingClass)) {
return false;
}
@@ -1144,7 +1144,7 @@ class SsaBuilder extends ast.Visitor
if (initializer == null) {
// Unassigned fields of native classes are not initialized to
// prevent overwriting pre-initialized native properties.
- if (!backend.isNativeOrExtendsNative(classElement)) {
+ if (!backend.nativeData.isNativeOrExtendsNative(classElement)) {
fieldValues[member] = graph.addConstantNull(closedWorld);
}
} else {
@@ -1179,7 +1179,7 @@ class SsaBuilder extends ast.Visitor
functionElement = functionElement.implementation;
ClassElement classElement = functionElement.enclosingClass.implementation;
bool isNativeUpgradeFactory =
- backend.isNativeOrExtendsNative(classElement) &&
+ backend.nativeData.isNativeOrExtendsNative(classElement) &&
!backend.isJsInterop(classElement);
ast.FunctionExpression function;
if (resolvedAst.kind == ResolvedAstKind.PARSED) {
@@ -3406,7 +3406,8 @@ class SsaBuilder extends ast.Visitor
List<HInstruction> inputs = <HInstruction>[];
if (constructor.isGenerativeConstructor &&
- backend.isNativeOrExtendsNative(constructor.enclosingClass) &&
+ backend.nativeData
+ .isNativeOrExtendsNative(constructor.enclosingClass) &&
!backend.isJsInterop(constructor)) {
// Native class generative constructors take a pre-constructed object.
inputs.add(graph.addConstantNull(closedWorld));
@@ -3965,7 +3966,8 @@ class SsaBuilder extends ast.Visitor
bool isOptimizableOperation(Selector selector, Element element) {
ClassElement cls = element.enclosingClass;
if (isOptimizableOperationOnIndexable(selector, element)) return true;
- if (!backend.interceptedClasses.contains(cls)) return false;
+ if (!backend.interceptorData.interceptedClasses.contains(cls))
+ return false;
if (selector.isOperator) return true;
if (selector.isSetter) return true;
if (selector.isIndex) return true;
@@ -3991,7 +3993,8 @@ class SsaBuilder extends ast.Visitor
HInstruction receiver = arguments[0];
List<HInstruction> inputs = <HInstruction>[];
- bool isIntercepted = backend.isInterceptedSelector(selector);
+ bool isIntercepted =
+ backend.interceptorData.isInterceptedSelector(selector);
if (isIntercepted) {
inputs.add(invokeInterceptor(receiver));
}
@@ -4157,7 +4160,7 @@ class SsaBuilder extends ast.Visitor
// TODO(5346): Try to avoid the need for calling [declaration] before
// creating an [HStatic].
List<HInstruction> inputs = <HInstruction>[];
- if (backend.isInterceptedSelector(selector) &&
+ if (backend.interceptorData.isInterceptedSelector(selector) &&
// Fields don't need an interceptor; consider generating HFieldGet/Set
// instead.
element.kind != ElementKind.FIELD) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698