Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 25f63ea7f56f76ec1b6d3164f679fe8b0056009f..a9967a6f926fd6a9c7d73ab4754a0e9dd5297c34 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -146,6 +146,7 @@ class LChunkBuilder; |
V(Parameter) \ |
V(Power) \ |
V(PushArgument) \ |
+ V(Random) \ |
V(RegExpLiteral) \ |
V(Return) \ |
V(Sar) \ |
@@ -2998,6 +2999,25 @@ class HPower: public HTemplateInstruction<2> { |
}; |
+class HRandom: public HTemplateInstruction<1> { |
+ public: |
+ explicit HRandom(HValue* global_object) { |
+ SetOperandAt(0, global_object); |
+ set_representation(Representation::Double()); |
+ } |
+ |
+ HValue* global_object() { return OperandAt(0); } |
+ |
+ virtual Representation RequiredInputRepresentation(int index) { |
+ return index == 0 |
+ ? Representation::Tagged() |
+ : Representation::None(); |
Jakob Kummerow
2012/01/11 08:10:40
"return Representation::Tagged();" should suffice,
Mads Ager (chromium)
2012/01/11 10:24:46
Done.
|
+ } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(Random) |
+}; |
+ |
+ |
class HAdd: public HArithmeticBinaryOperation { |
public: |
HAdd(HValue* context, HValue* left, HValue* right) |