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

Side by Side Diff: pkg/compiler/lib/src/universe/use.dart

Issue 2609063002: Further reduce use of Element in codegen. (Closed)
Patch Set: Created 3 years, 11 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /// This library defines individual world impacts. 5 /// This library defines individual world impacts.
6 /// 6 ///
7 /// We call these building blocks `uses`. Each `use` is a single impact of the 7 /// We call these building blocks `uses`. Each `use` is a single impact of the
8 /// world. Some example uses are: 8 /// world. Some example uses are:
9 /// 9 ///
10 /// * an invocation of a top level function 10 /// * an invocation of a top level function
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 282
283 /// Initialization of an instance field [element]. 283 /// Initialization of an instance field [element].
284 factory StaticUse.fieldInit(FieldElement element) { 284 factory StaticUse.fieldInit(FieldElement element) {
285 assert(invariant(element, element.isInstanceMember, 285 assert(invariant(element, element.isInstanceMember,
286 message: "Field init element $element must be an instance field.")); 286 message: "Field init element $element must be an instance field."));
287 return new StaticUse.internal(element, StaticUseKind.GENERAL); 287 return new StaticUse.internal(element, StaticUseKind.GENERAL);
288 } 288 }
289 289
290 /// Read access of an instance field or boxed field [element]. 290 /// Read access of an instance field or boxed field [element].
291 factory StaticUse.fieldGet(Element element) { 291 factory StaticUse.fieldGet(FieldElement element) {
292 assert(invariant( 292 assert(invariant(
293 element, element.isInstanceMember || element is BoxFieldElement, 293 element, element.isInstanceMember || element is BoxFieldElement,
294 message: "Field init element $element must be an instance " 294 message: "Field init element $element must be an instance "
295 "or boxed field.")); 295 "or boxed field."));
296 return new StaticUse.internal(element, StaticUseKind.FIELD_GET); 296 return new StaticUse.internal(element, StaticUseKind.FIELD_GET);
297 } 297 }
298 298
299 /// Write access of an instance field or boxed field [element]. 299 /// Write access of an instance field or boxed field [element].
300 factory StaticUse.fieldSet(Element element) { 300 factory StaticUse.fieldSet(FieldElement element) {
301 assert(invariant( 301 assert(invariant(
302 element, element.isInstanceMember || element is BoxFieldElement, 302 element, element.isInstanceMember || element is BoxFieldElement,
303 message: "Field init element $element must be an instance " 303 message: "Field init element $element must be an instance "
304 "or boxed field.")); 304 "or boxed field."));
305 return new StaticUse.internal(element, StaticUseKind.FIELD_SET); 305 return new StaticUse.internal(element, StaticUseKind.FIELD_SET);
306 } 306 }
307 307
308 /// Read of a local function [element]. 308 /// Read of a local function [element].
309 factory StaticUse.closure(LocalFunctionElement element) { 309 factory StaticUse.closure(LocalFunctionElement element) {
310 return new StaticUse.internal(element, StaticUseKind.CLOSURE); 310 return new StaticUse.internal(element, StaticUseKind.CLOSURE);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 bool operator ==(other) { 395 bool operator ==(other) {
396 if (identical(this, other)) return true; 396 if (identical(this, other)) return true;
397 if (other is! TypeUse) return false; 397 if (other is! TypeUse) return false;
398 return type == other.type && kind == other.kind; 398 return type == other.type && kind == other.kind;
399 } 399 }
400 400
401 String toString() => 'TypeUse($type,$kind)'; 401 String toString() => 'TypeUse($type,$kind)';
402 } 402 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698