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

Unified Diff: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart

Issue 2998113002: Reduce use of getClosureInfoForMember and cleanup closure_test (Closed)
Patch Set: Created 3 years, 4 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/js_emitter/runtime_type_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index 9a882f1ef83fa8d446a1ba7d2c7c35611072b69e..ae711e06405787400c276287c898e9028430f077 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -5,7 +5,11 @@
library dart2js.js_emitter.runtime_type_generator;
import '../closure.dart'
- show ClosureRepresentationInfo, ClosureFieldElement, ClosureConversionTask;
+ show
+ ClosureRepresentationInfo,
+ ClosureFieldElement,
+ ClosureConversionTask,
+ ScopeInfo;
import '../common.dart';
import '../common/names.dart' show Identifiers;
import '../common_elements.dart' show CommonElements, ElementEnvironment;
@@ -174,10 +178,9 @@ class RuntimeTypeGenerator {
assert(!(method is MethodElement && !method.isImplementation));
jsAst.Expression thisAccess = new jsAst.This();
if (!method.isAbstract) {
- ClosureRepresentationInfo closureData =
- _closureDataLookup.getClosureInfoForMember(method);
- if (closureData != null) {
- ClosureFieldElement thisLocal = closureData.thisFieldEntity;
+ ScopeInfo scopeInfo = _closureDataLookup.getScopeInfo(method);
+ if (scopeInfo is ClosureRepresentationInfo) {
+ ClosureFieldElement thisLocal = scopeInfo.thisFieldEntity;
if (thisLocal != null) {
jsAst.Name thisName = _namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);

Powered by Google App Engine
This is Rietveld 408576698