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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.interceptor_stub_generator; 5 library dart2js.js_emitter.interceptor_stub_generator;
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 8
9 import '../common_elements.dart'; 9 import '../common_elements.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 16 matching lines...) Expand all
27 27
28 import 'code_emitter_task.dart' show CodeEmitterTask, Emitter; 28 import 'code_emitter_task.dart' show CodeEmitterTask, Emitter;
29 29
30 class InterceptorStubGenerator { 30 class InterceptorStubGenerator {
31 final CompilerOptions _options; 31 final CompilerOptions _options;
32 final CommonElements _commonElements; 32 final CommonElements _commonElements;
33 final CodeEmitterTask _emitterTask; 33 final CodeEmitterTask _emitterTask;
34 final NativeCodegenEnqueuer _nativeCodegenEnqueuer; 34 final NativeCodegenEnqueuer _nativeCodegenEnqueuer;
35 final JavaScriptConstantCompiler _constants; 35 final JavaScriptConstantCompiler _constants;
36 final Namer _namer; 36 final Namer _namer;
37 final NativeData _nativeData;
38 final InterceptorData _interceptorData; 37 final InterceptorData _interceptorData;
39 final OneShotInterceptorData _oneShotInterceptorData; 38 final OneShotInterceptorData _oneShotInterceptorData;
40 final CustomElementsCodegenAnalysis _customElementsCodegenAnalysis; 39 final CustomElementsCodegenAnalysis _customElementsCodegenAnalysis;
41 final CodegenWorldBuilder _codegenWorldBuilder; 40 final CodegenWorldBuilder _codegenWorldBuilder;
42 final ClosedWorld _closedWorld; 41 final ClosedWorld _closedWorld;
43 42
44 InterceptorStubGenerator( 43 InterceptorStubGenerator(
45 this._options, 44 this._options,
46 this._commonElements, 45 this._commonElements,
47 this._emitterTask, 46 this._emitterTask,
48 this._nativeCodegenEnqueuer, 47 this._nativeCodegenEnqueuer,
49 this._constants, 48 this._constants,
50 this._namer, 49 this._namer,
51 this._nativeData,
52 this._interceptorData, 50 this._interceptorData,
53 this._oneShotInterceptorData, 51 this._oneShotInterceptorData,
54 this._customElementsCodegenAnalysis, 52 this._customElementsCodegenAnalysis,
55 this._codegenWorldBuilder, 53 this._codegenWorldBuilder,
56 this._closedWorld); 54 this._closedWorld);
57 55
56 NativeData get _nativeData => _closedWorld.nativeData;
57
58 Emitter get _emitter => _emitterTask.emitter; 58 Emitter get _emitter => _emitterTask.emitter;
59 59
60 jsAst.Expression generateGetInterceptorMethod(Set<ClassEntity> classes) { 60 jsAst.Expression generateGetInterceptorMethod(Set<ClassEntity> classes) {
61 jsAst.Expression interceptorFor(ClassEntity cls) { 61 jsAst.Expression interceptorFor(ClassEntity cls) {
62 return _emitterTask.interceptorPrototypeAccess(cls); 62 return _emitterTask.interceptorPrototypeAccess(cls);
63 } 63 }
64 64
65 /** 65 /**
66 * Build a JavaScrit AST node for doing a type check on 66 * Build a JavaScrit AST node for doing a type check on
67 * [cls]. [cls] must be a non-native interceptor class. 67 * [cls]. [cls] must be a non-native interceptor class.
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 451
452 var map = new jsAst.ObjectInitializer(properties); 452 var map = new jsAst.ObjectInitializer(properties);
453 elements.add(map); 453 elements.add(map);
454 } 454 }
455 } 455 }
456 456
457 return new jsAst.ArrayInitializer(elements); 457 return new jsAst.ArrayInitializer(elements);
458 } 458 }
459 } 459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698