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

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

Issue 2438823002: Re-add null check for closure-data (Originally removed in 177dee8f1621eef43d5c820f1a0e9d91bce1dc6d) (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 // Function signatures used in the generation of runtime type information. 7 // Function signatures used in the generation of runtime type information.
8 typedef void FunctionTypeSignatureEmitter( 8 typedef void FunctionTypeSignatureEmitter(
9 Element method, FunctionType methodType); 9 Element method, FunctionType methodType);
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 } 75 }
76 76
77 void generateFunctionTypeSignature( 77 void generateFunctionTypeSignature(
78 FunctionElement method, FunctionType type) { 78 FunctionElement method, FunctionType type) {
79 assert(method.isImplementation); 79 assert(method.isImplementation);
80 jsAst.Expression thisAccess = new jsAst.This(); 80 jsAst.Expression thisAccess = new jsAst.This();
81 if (!method.isAbstract) { 81 if (!method.isAbstract) {
82 ClosureClassMap closureData = compiler.closureToClassMapper 82 ClosureClassMap closureData = compiler.closureToClassMapper
83 .getClosureToClassMapping(method.resolvedAst); 83 .getClosureToClassMapping(method.resolvedAst);
84 ClosureFieldElement thisLocal = 84 if (closureData != null) {
85 closureData.freeVariableMap[closureData.thisLocal]; 85 ClosureFieldElement thisLocal =
86 if (thisLocal != null) { 86 closureData.freeVariableMap[closureData.thisLocal];
87 jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal); 87 if (thisLocal != null) {
88 thisAccess = js('this.#', thisName); 88 jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
89 thisAccess = js('this.#', thisName);
90 }
89 } 91 }
90 } 92 }
91 93
92 if (storeFunctionTypeInMetadata && !type.containsTypeVariables) { 94 if (storeFunctionTypeInMetadata && !type.containsTypeVariables) {
93 result.functionTypeIndex = 95 result.functionTypeIndex =
94 emitterTask.metadataCollector.reifyType(type); 96 emitterTask.metadataCollector.reifyType(type);
95 } else { 97 } else {
96 RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder; 98 RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder;
97 jsAst.Expression encoding = 99 jsAst.Expression encoding =
98 rtiEncoder.getSignatureEncoding(type, thisAccess); 100 rtiEncoder.getSignatureEncoding(type, thisAccess);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 335 }
334 jsAst.Expression convertRtiToRuntimeType = backend.emitter 336 jsAst.Expression convertRtiToRuntimeType = backend.emitter
335 .staticFunctionAccess(backend.helpers.convertRtiToRuntimeType); 337 .staticFunctionAccess(backend.helpers.convertRtiToRuntimeType);
336 338
337 return new StubMethod( 339 return new StubMethod(
338 name, 340 name,
339 js('function () { return #(#) }', 341 js('function () { return #(#) }',
340 [convertRtiToRuntimeType, computeTypeVariable])); 342 [convertRtiToRuntimeType, computeTypeVariable]));
341 } 343 }
342 } 344 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698