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

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

Issue 941293002: Fix type propagation for and operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/and_operation_on_non_integer_operand_test.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) 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * [InvokeDynamicSpecializer] and its subclasses are helpers to 8 * [InvokeDynamicSpecializer] and its subclasses are helpers to
9 * optimize intercepted dynamic calls. It knows what input types 9 * optimize intercepted dynamic calls. It knows what input types
10 * would be beneficial for performance, and how to change a invoke 10 * would be beneficial for performance, and how to change a invoke
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 BinaryOperation operation(ConstantSystem constantSystem) { 558 BinaryOperation operation(ConstantSystem constantSystem) {
559 return constantSystem.bitAnd; 559 return constantSystem.bitAnd;
560 } 560 }
561 561
562 TypeMask computeTypeFromInputTypes(HInvokeDynamic instruction, 562 TypeMask computeTypeFromInputTypes(HInvokeDynamic instruction,
563 Compiler compiler) { 563 Compiler compiler) {
564 HInstruction left = instruction.inputs[1]; 564 HInstruction left = instruction.inputs[1];
565 HInstruction right = instruction.inputs[2]; 565 HInstruction right = instruction.inputs[2];
566 JavaScriptBackend backend = compiler.backend; 566 JavaScriptBackend backend = compiler.backend;
567 if (left.isUInt31(compiler) || right.isUInt31(compiler)) { 567 if (left.isPrimitiveOrNull(compiler) &&
568 (left.isUInt31(compiler) || right.isUInt31(compiler))) {
568 return backend.uint31Type; 569 return backend.uint31Type;
569 } 570 }
570 return super.computeTypeFromInputTypes(instruction, compiler); 571 return super.computeTypeFromInputTypes(instruction, compiler);
571 } 572 }
572 573
573 HInstruction newBuiltinVariant(HInvokeDynamic instruction, 574 HInstruction newBuiltinVariant(HInvokeDynamic instruction,
574 Compiler compiler) { 575 Compiler compiler) {
575 JavaScriptBackend backend = compiler.backend; 576 JavaScriptBackend backend = compiler.backend;
576 return new HBitAnd( 577 return new HBitAnd(
577 instruction.inputs[1], instruction.inputs[2], 578 instruction.inputs[1], instruction.inputs[2],
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 return constantSystem.codeUnitAt; 741 return constantSystem.codeUnitAt;
741 } 742 }
742 743
743 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, 744 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
744 Compiler compiler) { 745 Compiler compiler) {
745 // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index 746 // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index
746 // bounds checking optimizations as for HIndex. 747 // bounds checking optimizations as for HIndex.
747 return null; 748 return null;
748 } 749 }
749 } 750 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/and_operation_on_non_integer_operand_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698