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

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

Issue 7000021: Support symbol comparison in crankshaft. (Closed)
Patch Set: Review fixes Created 9 years, 7 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 V(CheckFunction) \ 84 V(CheckFunction) \
85 V(CheckInstanceType) \ 85 V(CheckInstanceType) \
86 V(CheckMap) \ 86 V(CheckMap) \
87 V(CheckNonSmi) \ 87 V(CheckNonSmi) \
88 V(CheckPrototypeMaps) \ 88 V(CheckPrototypeMaps) \
89 V(CheckSmi) \ 89 V(CheckSmi) \
90 V(ClassOfTest) \ 90 V(ClassOfTest) \
91 V(Compare) \ 91 V(Compare) \
92 V(CompareJSObjectEq) \ 92 V(CompareJSObjectEq) \
93 V(CompareMap) \ 93 V(CompareMap) \
94 V(CompareSymbolEq) \
94 V(Constant) \ 95 V(Constant) \
95 V(Context) \ 96 V(Context) \
96 V(DeleteProperty) \ 97 V(DeleteProperty) \
97 V(Deoptimize) \ 98 V(Deoptimize) \
98 V(Div) \ 99 V(Div) \
99 V(EnterInlined) \ 100 V(EnterInlined) \
100 V(ExternalArrayLength) \ 101 V(ExternalArrayLength) \
101 V(FixedArrayLength) \ 102 V(FixedArrayLength) \
102 V(FunctionLiteral) \ 103 V(FunctionLiteral) \
103 V(GetCachedArrayIndex) \ 104 V(GetCachedArrayIndex) \
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2402 } 2403 }
2403 virtual HType CalculateInferredType(); 2404 virtual HType CalculateInferredType();
2404 2405
2405 DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq) 2406 DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq)
2406 2407
2407 protected: 2408 protected:
2408 virtual bool DataEquals(HValue* other) { return true; } 2409 virtual bool DataEquals(HValue* other) { return true; }
2409 }; 2410 };
2410 2411
2411 2412
2413 class HCompareSymbolEq: public HBinaryOperation {
2414 public:
2415 HCompareSymbolEq(HValue* left, HValue* right, Token::Value op)
2416 : HBinaryOperation(left, right), op_(op) {
2417 ASSERT(op == Token::EQ || op == Token::EQ_STRICT);
2418 set_representation(Representation::Tagged());
2419 SetFlag(kUseGVN);
2420 SetFlag(kDependsOnMaps);
2421 }
2422
2423 Token::Value op() const { return op_; }
2424
2425 virtual bool EmitAtUses() {
2426 return !HasSideEffects() && !HasMultipleUses();
2427 }
2428
2429 virtual Representation RequiredInputRepresentation(int index) const {
2430 return Representation::Tagged();
2431 }
2432
2433 virtual HType CalculateInferredType() { return HType::Boolean(); }
2434
2435 DECLARE_CONCRETE_INSTRUCTION(CompareSymbolEq);
2436
2437 protected:
2438 virtual bool DataEquals(HValue* other) {
2439 return op_ == HCompareSymbolEq::cast(other)->op_;
2440 }
2441
2442 private:
2443 const Token::Value op_;
2444 };
2445
2446
2412 class HUnaryPredicate: public HUnaryOperation { 2447 class HUnaryPredicate: public HUnaryOperation {
2413 public: 2448 public:
2414 explicit HUnaryPredicate(HValue* value) : HUnaryOperation(value) { 2449 explicit HUnaryPredicate(HValue* value) : HUnaryOperation(value) {
2415 set_representation(Representation::Tagged()); 2450 set_representation(Representation::Tagged());
2416 SetFlag(kUseGVN); 2451 SetFlag(kUseGVN);
2417 } 2452 }
2418 2453
2419 virtual bool EmitAtUses() { 2454 virtual bool EmitAtUses() {
2420 return !HasSideEffects() && !HasMultipleUses(); 2455 return !HasSideEffects() && !HasMultipleUses();
2421 } 2456 }
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3843 3878
3844 DECLARE_CONCRETE_INSTRUCTION(In) 3879 DECLARE_CONCRETE_INSTRUCTION(In)
3845 }; 3880 };
3846 3881
3847 #undef DECLARE_INSTRUCTION 3882 #undef DECLARE_INSTRUCTION
3848 #undef DECLARE_CONCRETE_INSTRUCTION 3883 #undef DECLARE_CONCRETE_INSTRUCTION
3849 3884
3850 } } // namespace v8::internal 3885 } } // namespace v8::internal
3851 3886
3852 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3887 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698