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

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

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 65 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
66 V(AbnormalExit) \ 66 V(AbnormalExit) \
67 V(AccessArgumentsAt) \ 67 V(AccessArgumentsAt) \
68 V(Add) \ 68 V(Add) \
69 V(Allocate) \ 69 V(Allocate) \
70 V(ApplyArguments) \ 70 V(ApplyArguments) \
71 V(ArgumentsElements) \ 71 V(ArgumentsElements) \
72 V(ArgumentsLength) \ 72 V(ArgumentsLength) \
73 V(ArgumentsObject) \ 73 V(ArgumentsObject) \
74 V(Bitwise) \ 74 V(Bitwise) \
75 V(BitNot) \
76 V(BlockEntry) \ 75 V(BlockEntry) \
77 V(BoundsCheck) \ 76 V(BoundsCheck) \
78 V(BoundsCheckBaseIndexInformation) \ 77 V(BoundsCheckBaseIndexInformation) \
79 V(Branch) \ 78 V(Branch) \
80 V(CallConstantFunction) \ 79 V(CallConstantFunction) \
81 V(CallFunction) \ 80 V(CallFunction) \
82 V(CallGlobal) \ 81 V(CallGlobal) \
83 V(CallKeyed) \ 82 V(CallKeyed) \
84 V(CallKnownGlobal) \ 83 V(CallKnownGlobal) \
85 V(CallNamed) \ 84 V(CallNamed) \
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 DECLARE_CONCRETE_INSTRUCTION(ElementsKind) 2384 DECLARE_CONCRETE_INSTRUCTION(ElementsKind)
2386 2385
2387 protected: 2386 protected:
2388 virtual bool DataEquals(HValue* other) { return true; } 2387 virtual bool DataEquals(HValue* other) { return true; }
2389 2388
2390 private: 2389 private:
2391 virtual bool IsDeletable() const { return true; } 2390 virtual bool IsDeletable() const { return true; }
2392 }; 2391 };
2393 2392
2394 2393
2395 class HBitNot: public HUnaryOperation {
2396 public:
2397 DECLARE_INSTRUCTION_FACTORY_P1(HBitNot, HValue*);
2398
2399 virtual Representation RequiredInputRepresentation(int index) {
2400 return Representation::Integer32();
2401 }
2402 virtual Representation observed_input_representation(int index) {
2403 return Representation::Integer32();
2404 }
2405
2406 virtual HValue* Canonicalize();
2407
2408 DECLARE_CONCRETE_INSTRUCTION(BitNot)
2409
2410 protected:
2411 virtual bool DataEquals(HValue* other) { return true; }
2412
2413 private:
2414 explicit HBitNot(HValue* value)
2415 : HUnaryOperation(value, HType::TaggedNumber()) {
2416 set_representation(Representation::Integer32());
2417 SetFlag(kUseGVN);
2418 SetFlag(kTruncatingToInt32);
2419 SetFlag(kAllowUndefinedAsNaN);
2420 }
2421
2422 virtual bool IsDeletable() const { return true; }
2423 };
2424
2425
2426 class HUnaryMathOperation: public HTemplateInstruction<2> { 2394 class HUnaryMathOperation: public HTemplateInstruction<2> {
2427 public: 2395 public:
2428 static HInstruction* New(Zone* zone, 2396 static HInstruction* New(Zone* zone,
2429 HValue* context, 2397 HValue* context,
2430 HValue* value, 2398 HValue* value,
2431 BuiltinFunctionId op); 2399 BuiltinFunctionId op);
2432 2400
2433 HValue* context() { return OperandAt(0); } 2401 HValue* context() { return OperandAt(0); }
2434 HValue* value() { return OperandAt(1); } 2402 HValue* value() { return OperandAt(1); }
2435 2403
(...skipping 4342 matching lines...) Expand 10 before | Expand all | Expand 10 after
6778 virtual bool IsDeletable() const { return true; } 6746 virtual bool IsDeletable() const { return true; }
6779 }; 6747 };
6780 6748
6781 6749
6782 #undef DECLARE_INSTRUCTION 6750 #undef DECLARE_INSTRUCTION
6783 #undef DECLARE_CONCRETE_INSTRUCTION 6751 #undef DECLARE_CONCRETE_INSTRUCTION
6784 6752
6785 } } // namespace v8::internal 6753 } } // namespace v8::internal
6786 6754
6787 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6755 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698