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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 03ff00751eb37929637ed757c18c10dae3fd136c..b736fc4324a7466ca50d404e21f585a058617f7a 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -87,6 +87,7 @@ class LChunkBuilder;
V(CheckNonSmi) \
V(CheckPrototypeMaps) \
V(CheckSmi) \
+ V(ClampToUint8) \
V(ClassOfTest) \
V(Compare) \
V(CompareJSObjectEq) \
@@ -551,7 +552,6 @@ class HValue: public ZoneObject {
Representation representation() const { return representation_; }
void ChangeRepresentation(Representation r) {
// Representation was already set and is allowed to be changed.
- ASSERT(!representation_.IsNone());
ASSERT(!r.IsNone());
ASSERT(CheckFlag(kFlexibleRepresentation));
RepresentationChanged(r);
@@ -1053,6 +1053,46 @@ class HChange: public HUnaryOperation {
};
+class HClampToUint8: public HUnaryOperation {
+ public:
+ explicit HClampToUint8(HValue* value)
+ : HUnaryOperation(value),
+ input_rep_(Representation::None()) {
+ SetFlag(kFlexibleRepresentation);
+ set_representation(Representation::Tagged());
+ SetFlag(kUseGVN);
+ }
+
+ virtual Representation RequiredInputRepresentation(int index) const {
+ return input_rep_;
+ }
+
+ virtual Representation InferredRepresentation() {
+ // TODO(danno): Inference on input types should happen separately from
+ // return representation.
+ Representation new_rep = value()->representation();
+ if (input_rep_.IsNone()) {
+ if (!new_rep.IsNone()) {
+ input_rep_ = new_rep;
+ return Representation::Integer32();
+ } else {
+ return Representation::None();
+ }
+ } else {
+ return Representation::Integer32();
+ }
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(ClampToUint8)
+
+ protected:
+ virtual bool DataEquals(HValue* other) { return true; }
+
+ private:
+ Representation input_rep_;
+};
+
+
class HSimulate: public HInstruction {
public:
HSimulate(int ast_id, int pop_count)
« 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