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

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: Use KnownSuccessorBlock infrastructure 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/ia32/lithium-codegen-ia32.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 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 HClassOfTestAndBranch(HValue* value, Handle<String> class_name) 4429 HClassOfTestAndBranch(HValue* value, Handle<String> class_name)
4430 : HUnaryControlInstruction(value, NULL, NULL), 4430 : HUnaryControlInstruction(value, NULL, NULL),
4431 class_name_(class_name) { } 4431 class_name_(class_name) { }
4432 4432
4433 Handle<String> class_name_; 4433 Handle<String> class_name_;
4434 }; 4434 };
4435 4435
4436 4436
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 static HTypeofIsAndBranch* New(Zone* zone, HValue* context,
Jakob Kummerow 2013/11/08 12:07:05 Please leave the DECLARE_INSTRUCTION_FACTORY_P2 ma
Weiliang 2013/11/08 13:50:26 Done.
4440 HValue* value, Handle<String> type_literal) {
4441 Heap* heap = zone->isolate()->heap();
4442 bool is_number = false;
Jakob Kummerow 2013/11/08 12:07:05 bool is_number = type_literal->Equals(heap->number
Weiliang 2013/11/08 13:50:26 Done.
4443 if (type_literal->Equals(heap->number_string())) {
4444 is_number = true;
4445 }
4446 return new(zone) HTypeofIsAndBranch(value, type_literal, is_number);
4447 }
4440 4448
4441 Handle<String> type_literal() { return type_literal_; } 4449 Handle<String> type_literal() { return type_literal_; }
4450 bool CheckNumberString() { return is_number_; }
Jakob Kummerow 2013/11/08 12:07:05 I'd call the field compares_number_type_ and the a
Weiliang 2013/11/08 13:50:26 Done.
4442 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 4451 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4443 4452
4444 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) 4453 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch)
4445 4454
4446 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4455 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4447 return Representation::Tagged(); 4456 return Representation::None();
4448 } 4457 }
4449 4458
4459 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;
4460
4450 private: 4461 private:
4451 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal) 4462 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal, bool is_number)
4452 : HUnaryControlInstruction(value, NULL, NULL), 4463 : HUnaryControlInstruction(value, NULL, NULL),
4453 type_literal_(type_literal) { } 4464 type_literal_(type_literal), is_number_(is_number) { }
4454 4465
4455 Handle<String> type_literal_; 4466 Handle<String> type_literal_;
4467 bool is_number_ : 1;
4456 }; 4468 };
4457 4469
4458 4470
4459 class HInstanceOf V8_FINAL : public HBinaryOperation { 4471 class HInstanceOf V8_FINAL : public HBinaryOperation {
4460 public: 4472 public:
4461 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); 4473 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*);
4462 4474
4463 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4475 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4464 return Representation::Tagged(); 4476 return Representation::Tagged();
4465 } 4477 }
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7202 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7191 }; 7203 };
7192 7204
7193 7205
7194 #undef DECLARE_INSTRUCTION 7206 #undef DECLARE_INSTRUCTION
7195 #undef DECLARE_CONCRETE_INSTRUCTION 7207 #undef DECLARE_CONCRETE_INSTRUCTION
7196 7208
7197 } } // namespace v8::internal 7209 } } // namespace v8::internal
7198 7210
7199 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7211 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | src/ia32/lithium-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698