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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 658543002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/node.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/graph-inl.h" 6 #include "src/compiler/graph-inl.h"
7 #include "src/compiler/js-builtin-reducer.h" 7 #include "src/compiler/js-builtin-reducer.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/node-aux-data-inl.h" 9 #include "src/compiler/node-aux-data-inl.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 NodeProperties::ReplaceWithValue(node, reduction.replacement()); 605 NodeProperties::ReplaceWithValue(node, reduction.replacement());
606 return reduction; 606 return reduction;
607 } 607 }
608 return Reducer::NoChange(); 608 return Reducer::NoChange();
609 } 609 }
610 610
611 611
612 Reduction JSTypedLowering::Reduce(Node* node) { 612 Reduction JSTypedLowering::Reduce(Node* node) {
613 // Check if the output type is a singleton. In that case we already know the 613 // Check if the output type is a singleton. In that case we already know the
614 // result value and can simply replace the node unless there are effects. 614 // result value and can simply replace the node unless there are effects.
615 if (node->bounds().upper->IsConstant() && 615 if (NodeProperties::IsTyped(node) &&
616 NodeProperties::GetBounds(node).upper->IsConstant() &&
616 !IrOpcode::IsLeafOpcode(node->opcode()) && 617 !IrOpcode::IsLeafOpcode(node->opcode()) &&
617 !OperatorProperties::HasEffectOutput(node->op())) { 618 !OperatorProperties::HasEffectOutput(node->op())) {
618 return ReplaceEagerly(node, jsgraph()->Constant( 619 return ReplaceEagerly(node, jsgraph()->Constant(
619 node->bounds().upper->AsConstant()->Value())); 620 NodeProperties::GetBounds(node).upper->AsConstant()->Value()));
620 // TODO(neis): Extend this to Range(x,x), NaN, MinusZero, ...? 621 // TODO(neis): Extend this to Range(x,x), NaN, MinusZero, ...?
621 } 622 }
622 switch (node->opcode()) { 623 switch (node->opcode()) {
623 case IrOpcode::kJSEqual: 624 case IrOpcode::kJSEqual:
624 return ReduceJSEqual(node, false); 625 return ReduceJSEqual(node, false);
625 case IrOpcode::kJSNotEqual: 626 case IrOpcode::kJSNotEqual:
626 return ReduceJSEqual(node, true); 627 return ReduceJSEqual(node, true);
627 case IrOpcode::kJSStrictEqual: 628 case IrOpcode::kJSStrictEqual:
628 return ReduceJSStrictEqual(node, false); 629 return ReduceJSStrictEqual(node, false);
629 case IrOpcode::kJSStrictNotEqual: 630 case IrOpcode::kJSStrictNotEqual:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 return JSBuiltinReducer(jsgraph()).Reduce(node); 692 return JSBuiltinReducer(jsgraph()).Reduce(node);
692 default: 693 default:
693 break; 694 break;
694 } 695 }
695 return NoChange(); 696 return NoChange();
696 } 697 }
697 698
698 } // namespace compiler 699 } // namespace compiler
699 } // namespace internal 700 } // namespace internal
700 } // namespace v8 701 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698