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

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

Issue 58923004: Make HTypeofIsAndBranch accept any representation input (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')
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 4426 matching lines...) Expand 10 before | Expand all | Expand 10 after
4437 class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction { 4437 class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction {
4438 public: 4438 public:
4439 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); 4439 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>);
4440 4440
4441 Handle<String> type_literal() { return type_literal_; } 4441 Handle<String> type_literal() { return type_literal_; }
4442 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 4442 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4443 4443
4444 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) 4444 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch)
4445 4445
4446 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4446 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4447 return Representation::Tagged(); 4447 return Representation::None();
4448 } 4448 }
4449 4449
4450 virtual HValue* Canonicalize() V8_OVERRIDE;
4451
4452 enum State {
4453 kUnKnown,
4454 kAlwaysTrue,
4455 kAlwaysFalse
4456 };
4457
4458 State state() { return state_; }
4459
4450 private: 4460 private:
4451 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal) 4461 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal)
4452 : HUnaryControlInstruction(value, NULL, NULL), 4462 : HUnaryControlInstruction(value, NULL, NULL),
4453 type_literal_(type_literal) { } 4463 type_literal_(type_literal), state_(kUnKnown) { }
4454 4464
4455 Handle<String> type_literal_; 4465 Handle<String> type_literal_;
4466 State state_;
4456 }; 4467 };
4457 4468
4458 4469
4459 class HInstanceOf V8_FINAL : public HBinaryOperation { 4470 class HInstanceOf V8_FINAL : public HBinaryOperation {
4460 public: 4471 public:
4461 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); 4472 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*);
4462 4473
4463 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4474 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4464 return Representation::Tagged(); 4475 return Representation::Tagged();
4465 } 4476 }
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7201 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7191 }; 7202 };
7192 7203
7193 7204
7194 #undef DECLARE_INSTRUCTION 7205 #undef DECLARE_INSTRUCTION
7195 #undef DECLARE_CONCRETE_INSTRUCTION 7206 #undef DECLARE_CONCRETE_INSTRUCTION
7196 7207
7197 } } // namespace v8::internal 7208 } } // namespace v8::internal
7198 7209
7199 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7210 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698