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

Unified Diff: src/hydrogen-instructions.h

Issue 1216463003: [strong] Implement strong mode semantics for the count operation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback + eliminate runtime check Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index c876bd50fafd803c19578bb898440352d5689e7b..5022a866c915be6a0fa6f38e117fe42d19e3c0a8 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -4151,7 +4151,7 @@ class HBitwiseBinaryOperation : public HBinaryOperation {
: HBinaryOperation(context, left, right, strength, type) {
SetFlag(kFlexibleRepresentation);
SetFlag(kTruncatingToInt32);
- SetFlag(kAllowUndefinedAsNaN);
+ if (!is_strong(strength)) SetFlag(kAllowUndefinedAsNaN);
SetAllSideEffects();
}
@@ -4232,7 +4232,7 @@ class HArithmeticBinaryOperation : public HBinaryOperation {
HType::TaggedNumber()) {
SetAllSideEffects();
SetFlag(kFlexibleRepresentation);
- SetFlag(kAllowUndefinedAsNaN);
+ if (!is_strong(strength)) SetFlag(kAllowUndefinedAsNaN);
}
void RepresentationChanged(Representation to) override {
@@ -4289,11 +4289,22 @@ class HCompareGeneric final : public HBinaryOperation {
class HCompareNumericAndBranch : public HTemplateControlInstruction<2, 2> {
public:
- DECLARE_INSTRUCTION_FACTORY_P3(HCompareNumericAndBranch,
- HValue*, HValue*, Token::Value);
- DECLARE_INSTRUCTION_FACTORY_P5(HCompareNumericAndBranch,
- HValue*, HValue*, Token::Value,
- HBasicBlock*, HBasicBlock*);
+ static HCompareNumericAndBranch* New(Isolate* isolate, Zone* zone,
+ HValue* context, HValue* left,
+ HValue* right, Token::Value token,
+ HBasicBlock* true_target = NULL,
+ HBasicBlock* false_target = NULL,
+ Strength strength = Strength::WEAK) {
+ return new (zone) HCompareNumericAndBranch(left, right, token, true_target,
+ false_target, strength);
+ }
+ static HCompareNumericAndBranch* New(Isolate* isolate, Zone* zone,
+ HValue* context, HValue* left,
+ HValue* right, Token::Value token,
+ Strength strength) {
+ return new (zone)
+ HCompareNumericAndBranch(left, right, token, NULL, NULL, strength);
+ }
HValue* left() const { return OperandAt(0); }
HValue* right() const { return OperandAt(1); }
@@ -4316,6 +4327,8 @@ class HCompareNumericAndBranch : public HTemplateControlInstruction<2, 2> {
bool KnownSuccessorBlock(HBasicBlock** block) override;
+ Strength strength() const { return strength_; }
+
std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
void SetOperandPositions(Zone* zone, SourcePosition left_pos,
@@ -4327,12 +4340,10 @@ class HCompareNumericAndBranch : public HTemplateControlInstruction<2, 2> {
DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch)
private:
- HCompareNumericAndBranch(HValue* left,
- HValue* right,
- Token::Value token,
- HBasicBlock* true_target = NULL,
- HBasicBlock* false_target = NULL)
- : token_(token) {
+ HCompareNumericAndBranch(HValue* left, HValue* right, Token::Value token,
+ HBasicBlock* true_target, HBasicBlock* false_target,
+ Strength strength)
+ : token_(token), strength_(strength) {
SetFlag(kFlexibleRepresentation);
DCHECK(Token::IsCompareOp(token));
SetOperandAt(0, left);
@@ -4343,6 +4354,7 @@ class HCompareNumericAndBranch : public HTemplateControlInstruction<2, 2> {
Representation observed_input_representation_[2];
Token::Value token_;
+ Strength strength_;
};
« 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