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

Side by Side Diff: src/hydrogen-instructions.h

Issue 10581014: BoundsCheck should be extended to support array_bounds_checks_elimination (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 HValue* index() { return OperandAt(2); } 2693 HValue* index() { return OperandAt(2); }
2694 2694
2695 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt) 2695 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt)
2696 2696
2697 virtual bool DataEquals(HValue* other) { return true; } 2697 virtual bool DataEquals(HValue* other) { return true; }
2698 }; 2698 };
2699 2699
2700 2700
2701 class HBoundsCheck: public HTemplateInstruction<2> { 2701 class HBoundsCheck: public HTemplateInstruction<2> {
2702 public: 2702 public:
2703 HBoundsCheck(HValue* index, HValue* length) { 2703 HBoundsCheck(HValue* index, HValue* length)
2704 : lower_offset_(0),
2705 upper_offset_(0) {
2704 SetOperandAt(0, index); 2706 SetOperandAt(0, index);
2705 SetOperandAt(1, length); 2707 SetOperandAt(1, length);
2706 set_representation(Representation::Integer32()); 2708 set_representation(Representation::Integer32());
2707 SetFlag(kUseGVN); 2709 SetFlag(kUseGVN);
2708 } 2710 }
2709 2711
2710 virtual Representation RequiredInputRepresentation(int index) { 2712 virtual Representation RequiredInputRepresentation(int index) {
2711 return Representation::Integer32(); 2713 return Representation::Integer32();
2712 } 2714 }
2713 2715
2714 virtual void PrintDataTo(StringStream* stream); 2716 virtual void PrintDataTo(StringStream* stream);
2715 2717
2716 HValue* index() { return OperandAt(0); } 2718 HValue* index() { return OperandAt(0); }
2717 HValue* length() { return OperandAt(1); } 2719 HValue* length() { return OperandAt(1); }
2718 2720
2719 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck) 2721 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck)
2720 2722
2723 void set_offset(int32_t lower_offset, int32_t upper_offset) {
2724 lower_offset_ = lower_offset;
2725 upper_offset_ = upper_offset;
2726 }
2727
2728 int32_t lower_offset() { return lower_offset_; }
2729 int32_t upper_offset() { return upper_offset_; }
2730
2721 protected: 2731 protected:
2722 virtual bool DataEquals(HValue* other) { return true; } 2732 virtual bool DataEquals(HValue* other) { return true; }
2733 int32_t lower_offset_;
2734 int32_t upper_offset_;
2723 }; 2735 };
2724 2736
2725 2737
2726 class HBitwiseBinaryOperation: public HBinaryOperation { 2738 class HBitwiseBinaryOperation: public HBinaryOperation {
2727 public: 2739 public:
2728 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right) 2740 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right)
2729 : HBinaryOperation(context, left, right) { 2741 : HBinaryOperation(context, left, right) {
2730 set_representation(Representation::Tagged()); 2742 set_representation(Representation::Tagged());
2731 SetFlag(kFlexibleRepresentation); 2743 SetFlag(kFlexibleRepresentation);
2732 SetAllSideEffects(); 2744 SetAllSideEffects();
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after
5094 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 5106 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
5095 }; 5107 };
5096 5108
5097 5109
5098 #undef DECLARE_INSTRUCTION 5110 #undef DECLARE_INSTRUCTION
5099 #undef DECLARE_CONCRETE_INSTRUCTION 5111 #undef DECLARE_CONCRETE_INSTRUCTION
5100 5112
5101 } } // namespace v8::internal 5113 } } // namespace v8::internal
5102 5114
5103 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5115 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698