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

Side by Side Diff: pkg/compiler/lib/src/ssa/types_propagation.dart

Issue 2569733002: Even less reliance on Compiler.closedWorld (Closed)
Patch Set: Updated cf. comments. Created 4 years 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 | « pkg/compiler/lib/src/ssa/types.dart ('k') | pkg/compiler/lib/src/types/masks.dart » ('j') | 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) 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 import '../compiler.dart' show Compiler; 5 import '../compiler.dart' show Compiler;
6 import '../elements/elements.dart'; 6 import '../elements/elements.dart';
7 import '../js_backend/js_backend.dart'; 7 import '../js_backend/js_backend.dart';
8 import '../types/types.dart'; 8 import '../types/types.dart';
9 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
10 import '../world.dart' show ClosedWorld; 10 import '../world.dart' show ClosedWorld;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (checkReceiver(instruction)) { 355 if (checkReceiver(instruction)) {
356 addAllUsersBut(instruction, instruction.inputs[1]); 356 addAllUsersBut(instruction, instruction.inputs[1]);
357 } 357 }
358 if (!selector.isUnaryOperator && checkArgument(instruction)) { 358 if (!selector.isUnaryOperator && checkArgument(instruction)) {
359 addAllUsersBut(instruction, instruction.inputs[2]); 359 addAllUsersBut(instruction, instruction.inputs[2]);
360 } 360 }
361 } 361 }
362 }); 362 });
363 } 363 }
364 364
365 HInstruction receiver = instruction.getDartReceiver(compiler); 365 HInstruction receiver = instruction.getDartReceiver(closedWorld);
366 TypeMask receiverType = receiver.instructionType; 366 TypeMask receiverType = receiver.instructionType;
367 instruction.mask = receiverType; 367 instruction.mask = receiverType;
368 368
369 // Try to specialize the receiver after this call by instering a refinement 369 // Try to specialize the receiver after this call by instering a refinement
370 // node (HTypeKnown). There are two potentially expensive tests - are there 370 // node (HTypeKnown). There are two potentially expensive tests - are there
371 // any uses of the receiver dominated by and following this call?, and what 371 // any uses of the receiver dominated by and following this call?, and what
372 // is the refined type? The first is expensive if the receiver has many 372 // is the refined type? The first is expensive if the receiver has many
373 // uses, the second is expensive if many classes implement the selector. So 373 // uses, the second is expensive if many classes implement the selector. So
374 // we try to do the least expensive test first. 374 // we try to do the least expensive test first.
375 const int _MAX_QUICK_USERS = 50; 375 const int _MAX_QUICK_USERS = 50;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 receiver.replaceAllUsersDominatedBy(converted.next, converted); 407 receiver.replaceAllUsersDominatedBy(converted.next, converted);
408 addDependentInstructionsToWorkList(converted); 408 addDependentInstructionsToWorkList(converted);
409 } 409 }
410 } 410 }
411 } 411 }
412 412
413 return instruction.specializer 413 return instruction.specializer
414 .computeTypeFromInputTypes(instruction, compiler, closedWorld); 414 .computeTypeFromInputTypes(instruction, compiler, closedWorld);
415 } 415 }
416 } 416 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/types.dart ('k') | pkg/compiler/lib/src/types/masks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698