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

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

Issue 7014033: Support conversion of clamped double values for pixel arrays in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 V(CallNew) \ 80 V(CallNew) \
81 V(CallRuntime) \ 81 V(CallRuntime) \
82 V(CallStub) \ 82 V(CallStub) \
83 V(Change) \ 83 V(Change) \
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(ClampToUint8) \
90 V(ClassOfTest) \ 91 V(ClassOfTest) \
91 V(Compare) \ 92 V(Compare) \
92 V(CompareJSObjectEq) \ 93 V(CompareJSObjectEq) \
93 V(CompareMap) \ 94 V(CompareMap) \
94 V(CompareSymbolEq) \ 95 V(CompareSymbolEq) \
95 V(Constant) \ 96 V(Constant) \
96 V(Context) \ 97 V(Context) \
97 V(DeleteProperty) \ 98 V(DeleteProperty) \
98 V(Deoptimize) \ 99 V(Deoptimize) \
99 V(Div) \ 100 V(Div) \
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 545
545 int id() const { return id_; } 546 int id() const { return id_; }
546 void set_id(int id) { id_ = id; } 547 void set_id(int id) { id_ = id; }
547 548
548 HUseIterator uses() const { return HUseIterator(use_list_); } 549 HUseIterator uses() const { return HUseIterator(use_list_); }
549 550
550 virtual bool EmitAtUses() { return false; } 551 virtual bool EmitAtUses() { return false; }
551 Representation representation() const { return representation_; } 552 Representation representation() const { return representation_; }
552 void ChangeRepresentation(Representation r) { 553 void ChangeRepresentation(Representation r) {
553 // Representation was already set and is allowed to be changed. 554 // Representation was already set and is allowed to be changed.
554 ASSERT(!representation_.IsNone());
555 ASSERT(!r.IsNone()); 555 ASSERT(!r.IsNone());
556 ASSERT(CheckFlag(kFlexibleRepresentation)); 556 ASSERT(CheckFlag(kFlexibleRepresentation));
557 RepresentationChanged(r); 557 RepresentationChanged(r);
558 representation_ = r; 558 representation_ = r;
559 } 559 }
560 560
561 virtual bool IsConvertibleToInteger() const { return true; } 561 virtual bool IsConvertibleToInteger() const { return true; }
562 562
563 HType type() const { return type_; } 563 HType type() const { return type_; }
564 void set_type(HType type) { 564 void set_type(HType type) {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 HChange* change = HChange::cast(other); 1046 HChange* change = HChange::cast(other);
1047 return value() == change->value() 1047 return value() == change->value()
1048 && to().Equals(change->to()); 1048 && to().Equals(change->to());
1049 } 1049 }
1050 1050
1051 private: 1051 private:
1052 Representation from_; 1052 Representation from_;
1053 }; 1053 };
1054 1054
1055 1055
1056 class HClampToUint8: public HUnaryOperation {
1057 public:
1058 explicit HClampToUint8(HValue* value)
1059 : HUnaryOperation(value),
1060 input_rep_(Representation::None()) {
1061 SetFlag(kFlexibleRepresentation);
1062 set_representation(Representation::Tagged());
1063 SetFlag(kUseGVN);
1064 }
1065
1066 virtual Representation RequiredInputRepresentation(int index) const {
1067 return input_rep_;
1068 }
1069
1070 virtual Representation InferredRepresentation() {
1071 // TODO(danno): Inference on input types should happen separately from
1072 // return representation.
1073 Representation new_rep = value()->representation();
1074 if (input_rep_.IsNone()) {
1075 if (!new_rep.IsNone()) {
1076 input_rep_ = new_rep;
1077 return Representation::Integer32();
1078 } else {
1079 return Representation::None();
1080 }
1081 } else {
1082 return Representation::Integer32();
1083 }
1084 }
1085
1086 DECLARE_CONCRETE_INSTRUCTION(ClampToUint8)
1087
1088 protected:
1089 virtual bool DataEquals(HValue* other) { return true; }
1090
1091 private:
1092 Representation input_rep_;
1093 };
1094
1095
1056 class HSimulate: public HInstruction { 1096 class HSimulate: public HInstruction {
1057 public: 1097 public:
1058 HSimulate(int ast_id, int pop_count) 1098 HSimulate(int ast_id, int pop_count)
1059 : ast_id_(ast_id), 1099 : ast_id_(ast_id),
1060 pop_count_(pop_count), 1100 pop_count_(pop_count),
1061 values_(2), 1101 values_(2),
1062 assigned_indexes_(2) {} 1102 assigned_indexes_(2) {}
1063 virtual ~HSimulate() {} 1103 virtual ~HSimulate() {}
1064 1104
1065 virtual void PrintDataTo(StringStream* stream); 1105 virtual void PrintDataTo(StringStream* stream);
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after
3895 3935
3896 DECLARE_CONCRETE_INSTRUCTION(In) 3936 DECLARE_CONCRETE_INSTRUCTION(In)
3897 }; 3937 };
3898 3938
3899 #undef DECLARE_INSTRUCTION 3939 #undef DECLARE_INSTRUCTION
3900 #undef DECLARE_CONCRETE_INSTRUCTION 3940 #undef DECLARE_CONCRETE_INSTRUCTION
3901 3941
3902 } } // namespace v8::internal 3942 } } // namespace v8::internal
3903 3943
3904 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3944 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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