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

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

Issue 24195009: Turn HCompareHoleAndBranch into a HUnaryControlInstruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/arm/lithium-arm.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 4017 matching lines...) Expand 10 before | Expand all | Expand 10 after
4028 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 4028 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4029 4029
4030 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch) 4030 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch)
4031 4031
4032 private: 4032 private:
4033 Representation observed_input_representation_[2]; 4033 Representation observed_input_representation_[2];
4034 Token::Value token_; 4034 Token::Value token_;
4035 }; 4035 };
4036 4036
4037 4037
4038 class HCompareHoleAndBranch V8_FINAL 4038 class HCompareHoleAndBranch V8_FINAL : public HUnaryControlInstruction {
4039 : public HTemplateControlInstruction<2, 1> {
4040 public: 4039 public:
4041 // TODO(danno): make this private when the IfBuilder properly constructs 4040 // TODO(danno): make this private when the IfBuilder properly constructs
4042 // control flow instructions. 4041 // control flow instructions.
4043 explicit HCompareHoleAndBranch(HValue* object) { 4042 HCompareHoleAndBranch(HValue* value,
4043 HBasicBlock* true_target = NULL,
4044 HBasicBlock* false_target = NULL)
4045 : HUnaryControlInstruction(value, true_target, false_target) {
4044 SetFlag(kFlexibleRepresentation); 4046 SetFlag(kFlexibleRepresentation);
4045 SetFlag(kAllowUndefinedAsNaN); 4047 SetFlag(kAllowUndefinedAsNaN);
4046 SetOperandAt(0, object);
4047 } 4048 }
4048 4049
4049 DECLARE_INSTRUCTION_FACTORY_P1(HCompareHoleAndBranch, HValue*); 4050 DECLARE_INSTRUCTION_FACTORY_P1(HCompareHoleAndBranch, HValue*);
4050 4051 DECLARE_INSTRUCTION_FACTORY_P3(HCompareHoleAndBranch, HValue*,
4051 HValue* object() { return OperandAt(0); } 4052 HBasicBlock*, HBasicBlock*);
4052 4053
4053 virtual void InferRepresentation( 4054 virtual void InferRepresentation(
4054 HInferRepresentationPhase* h_infer) V8_OVERRIDE; 4055 HInferRepresentationPhase* h_infer) V8_OVERRIDE;
4055 4056
4056 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4057 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4057 return representation(); 4058 return representation();
4058 } 4059 }
4059 4060
4060 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4061
4062 DECLARE_CONCRETE_INSTRUCTION(CompareHoleAndBranch) 4061 DECLARE_CONCRETE_INSTRUCTION(CompareHoleAndBranch)
4063 }; 4062 };
4064 4063
4065 4064
4066 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> { 4065 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> {
4067 public: 4066 public:
4068 // TODO(danno): make this private when the IfBuilder properly constructs 4067 // TODO(danno): make this private when the IfBuilder properly constructs
4069 // control flow instructions. 4068 // control flow instructions.
4070 HCompareObjectEqAndBranch(HValue* left, 4069 HCompareObjectEqAndBranch(HValue* left,
4071 HValue* right) { 4070 HValue* right) {
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after
6959 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6958 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6960 }; 6959 };
6961 6960
6962 6961
6963 #undef DECLARE_INSTRUCTION 6962 #undef DECLARE_INSTRUCTION
6964 #undef DECLARE_CONCRETE_INSTRUCTION 6963 #undef DECLARE_CONCRETE_INSTRUCTION
6965 6964
6966 } } // namespace v8::internal 6965 } } // namespace v8::internal
6967 6966
6968 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6967 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698