diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2012-01-16 14:37:57 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2012-01-16 14:37:57 -0800 |
commit | 60040a4f366d436d759729530f4d19e7e1958e51 (patch) | |
tree | 953a40adf24a0826836cc69843ea80d197a12dab /deps/v8/src/hydrogen-instructions.h | |
parent | 1afd0b52fe9bb4642a44b48dabf9d7b26d00e4ab (diff) | |
download | node-new-60040a4f366d436d759729530f4d19e7e1958e51.tar.gz |
Upgrade V8 to 3.8.6
Diffstat (limited to 'deps/v8/src/hydrogen-instructions.h')
-rw-r--r-- | deps/v8/src/hydrogen-instructions.h | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/deps/v8/src/hydrogen-instructions.h b/deps/v8/src/hydrogen-instructions.h index 1856c80929..5082e4d3ff 100644 --- a/deps/v8/src/hydrogen-instructions.h +++ b/deps/v8/src/hydrogen-instructions.h @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -146,6 +146,7 @@ class LChunkBuilder; V(Parameter) \ V(Power) \ V(PushArgument) \ + V(Random) \ V(RegExpLiteral) \ V(Return) \ V(Sar) \ @@ -1130,12 +1131,16 @@ class HChange: public HUnaryOperation { virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); virtual HType CalculateInferredType(); + virtual HValue* Canonicalize(); Representation from() { return value()->representation(); } Representation to() { return representation(); } bool deoptimize_on_undefined() const { return CheckFlag(kDeoptimizeOnUndefined); } + bool deoptimize_on_minus_zero() const { + return CheckFlag(kBailoutOnMinusZero); + } virtual Representation RequiredInputRepresentation(int index) { return from(); } @@ -1921,8 +1926,11 @@ class HLoadExternalArrayPointer: public HUnaryOperation { class HCheckMap: public HTemplateInstruction<2> { public: - HCheckMap(HValue* value, Handle<Map> map, HValue* typecheck = NULL) - : map_(map) { + HCheckMap(HValue* value, Handle<Map> map, + HValue* typecheck = NULL, + CompareMapMode mode = REQUIRE_EXACT_MAP) + : map_(map), + mode_(mode) { SetOperandAt(0, value); // If callers don't depend on a typecheck, they can pass in NULL. In that // case we use a copy of the |value| argument as a dummy value. @@ -1930,6 +1938,9 @@ class HCheckMap: public HTemplateInstruction<2> { set_representation(Representation::Tagged()); SetFlag(kUseGVN); SetFlag(kDependsOnMaps); + has_element_transitions_ = + map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, NULL) != NULL || + map->LookupElementsTransitionMap(FAST_ELEMENTS, NULL) != NULL; } virtual Representation RequiredInputRepresentation(int index) { @@ -1940,17 +1951,24 @@ class HCheckMap: public HTemplateInstruction<2> { HValue* value() { return OperandAt(0); } Handle<Map> map() const { return map_; } + CompareMapMode mode() const { return mode_; } DECLARE_CONCRETE_INSTRUCTION(CheckMap) protected: virtual bool DataEquals(HValue* other) { HCheckMap* b = HCheckMap::cast(other); - return map_.is_identical_to(b->map()); + // Two CheckMaps instructions are DataEqual if their maps are identical and + // they have the same mode. The mode comparison can be ignored if the map + // has no elements transitions. + return map_.is_identical_to(b->map()) && + (b->mode() == mode() || !has_element_transitions_); } private: + bool has_element_transitions_; Handle<Map> map_; + CompareMapMode mode_; }; @@ -2985,6 +3003,23 @@ 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 Representation::Tagged(); + } + + DECLARE_CONCRETE_INSTRUCTION(Random) +}; + + class HAdd: public HArithmeticBinaryOperation { public: HAdd(HValue* context, HValue* left, HValue* right) @@ -3138,6 +3173,8 @@ class HBitwise: public HBitwiseBinaryOperation { virtual bool IsCommutative() const { return true; } + virtual HValue* Canonicalize(); + static HInstruction* NewHBitwise(Zone* zone, Token::Value op, HValue* context, |