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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/interceptor_emitter.dart

Issue 2863073003: Access NativeData only through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.js_emitter.full_emitter.interceptor_emitter; 5 library dart2js.js_emitter.full_emitter.interceptor_emitter;
6 6
7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
8 import '../../elements/entities.dart'; 8 import '../../elements/entities.dart';
9 import '../../js/js.dart' as jsAst; 9 import '../../js/js.dart' as jsAst;
10 import '../../js/js.dart' show js; 10 import '../../js/js.dart' show js;
(...skipping 16 matching lines...) Expand all
27 27
28 jsAst.Expression buildGetInterceptorMethod( 28 jsAst.Expression buildGetInterceptorMethod(
29 jsAst.Name key, Set<ClassEntity> classes) { 29 jsAst.Name key, Set<ClassEntity> classes) {
30 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator( 30 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator(
31 compiler.options, 31 compiler.options,
32 compiler.commonElements, 32 compiler.commonElements,
33 backend.emitter, 33 backend.emitter,
34 backend.nativeCodegenEnqueuer, 34 backend.nativeCodegenEnqueuer,
35 backend.constants, 35 backend.constants,
36 namer, 36 namer,
37 backend.nativeData,
38 backend.interceptorData, 37 backend.interceptorData,
39 backend.oneShotInterceptorData, 38 backend.oneShotInterceptorData,
40 backend.customElementsCodegenAnalysis, 39 backend.customElementsCodegenAnalysis,
41 compiler.codegenWorldBuilder, 40 compiler.codegenWorldBuilder,
42 closedWorld); 41 closedWorld);
43 jsAst.Expression function = 42 jsAst.Expression function =
44 stubGenerator.generateGetInterceptorMethod(classes); 43 stubGenerator.generateGetInterceptorMethod(classes);
45 44
46 return function; 45 return function;
47 } 46 }
(...skipping 27 matching lines...) Expand all
75 Iterable<jsAst.Name> names = 74 Iterable<jsAst.Name> names =
76 backend.oneShotInterceptorData.oneShotInterceptorNames; 75 backend.oneShotInterceptorData.oneShotInterceptorNames;
77 76
78 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator( 77 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator(
79 compiler.options, 78 compiler.options,
80 compiler.commonElements, 79 compiler.commonElements,
81 backend.emitter, 80 backend.emitter,
82 backend.nativeCodegenEnqueuer, 81 backend.nativeCodegenEnqueuer,
83 backend.constants, 82 backend.constants,
84 namer, 83 namer,
85 backend.nativeData,
86 backend.interceptorData, 84 backend.interceptorData,
87 backend.oneShotInterceptorData, 85 backend.oneShotInterceptorData,
88 backend.customElementsCodegenAnalysis, 86 backend.customElementsCodegenAnalysis,
89 compiler.codegenWorldBuilder, 87 compiler.codegenWorldBuilder,
90 closedWorld); 88 closedWorld);
91 String globalObject = namer 89 String globalObject = namer
92 .globalObjectForLibrary(backend.commonElements.interceptorsLibrary); 90 .globalObjectForLibrary(backend.commonElements.interceptorsLibrary);
93 for (jsAst.Name name in names) { 91 for (jsAst.Name name in names) {
94 jsAst.Expression function = 92 jsAst.Expression function =
95 stubGenerator.generateOneShotInterceptor(name); 93 stubGenerator.generateOneShotInterceptor(name);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 */ 126 */
129 jsAst.Statement buildTypeToInterceptorMap(Program program) { 127 jsAst.Statement buildTypeToInterceptorMap(Program program) {
130 jsAst.Expression array = program.typeToInterceptorMap; 128 jsAst.Expression array = program.typeToInterceptorMap;
131 if (array == null) return js.comment("Empty type-to-interceptor map."); 129 if (array == null) return js.comment("Empty type-to-interceptor map.");
132 130
133 jsAst.Expression typeToInterceptorMap = emitter 131 jsAst.Expression typeToInterceptorMap = emitter
134 .generateEmbeddedGlobalAccess(embeddedNames.TYPE_TO_INTERCEPTOR_MAP); 132 .generateEmbeddedGlobalAccess(embeddedNames.TYPE_TO_INTERCEPTOR_MAP);
135 return js.statement('# = #', [typeToInterceptorMap, array]); 133 return js.statement('# = #', [typeToInterceptorMap, array]);
136 } 134 }
137 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698