#ifndef V8_HYDROGEN_INSTRUCTIONS_H_
#define V8_HYDROGEN_INSTRUCTIONS_H_
+#include <iosfwd>
+
#include "src/v8.h"
#include "src/allocation.h"
#include "src/base/bits.h"
+#include "src/bit-vector.h"
#include "src/code-stubs.h"
#include "src/conversions.h"
-#include "src/data-flow.h"
#include "src/deoptimizer.h"
-#include "src/feedback-slots.h"
#include "src/hydrogen-types.h"
#include "src/small-pointer-list.h"
#include "src/unique.h"
class HValue;
class LInstruction;
class LChunkBuilder;
-class OStream;
#define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
V(ArithmeticBinaryOperation) \
V(Typeof) \
V(TypeofIsAndBranch) \
V(UnaryMathOperation) \
- V(NullarySIMDOperation) \
- V(UnarySIMDOperation) \
- V(BinarySIMDOperation) \
- V(TernarySIMDOperation) \
- V(QuarternarySIMDOperation) \
V(UnknownOSRValue) \
V(UseConst) \
V(WrapReceiver)
};
-OStream& operator<<(OStream& os, const HSourcePosition& p);
+std::ostream& operator<<(std::ostream& os, const HSourcePosition& p);
class HValue : public ZoneObject {
HType t = type();
if (t.IsSmi()) return Representation::Smi();
if (t.IsHeapNumber()) return Representation::Double();
- if (t.IsFloat32x4()) return Representation::Float32x4();
- if (t.IsFloat64x2()) return Representation::Float64x2();
- if (t.IsInt32x4()) return Representation::Int32x4();
if (t.IsHeapObject()) return r;
return Representation::None();
}
HType type() const { return type_; }
void set_type(HType new_type) {
- // TODO(ningxin): for SIMD ops, the initial type is None which
- // hit the following ASSERT.
- // DCHECK(new_type.IsSubtypeOf(type_));
+ DCHECK(new_type.IsSubtypeOf(type_));
type_ = new_type;
}
virtual void FinalizeUniqueness() { }
// Printing support.
- virtual OStream& PrintTo(OStream& os) const = 0; // NOLINT
+ virtual std::ostream& PrintTo(std::ostream& os) const = 0; // NOLINT
const char* Mnemonic() const;
result.Remove(kOsrEntries);
return result;
}
- friend OStream& operator<<(OStream& os, const ChangesOf& v);
+ friend std::ostream& operator<<(std::ostream& os, const ChangesOf& v);
// A flag mask of all side effects that can make observable changes in
// an executing program (i.e. are not safe to repeat, move or remove);
};
-OStream& operator<<(OStream& os, const HValue& v);
-OStream& operator<<(OStream& os, const NameOf& v);
-OStream& operator<<(OStream& os, const TypeOf& v);
-OStream& operator<<(OStream& os, const ChangesOf& v);
+std::ostream& operator<<(std::ostream& os, const HValue& v);
+std::ostream& operator<<(std::ostream& os, const NameOf& v);
+std::ostream& operator<<(std::ostream& os, const TypeOf& v);
+std::ostream& operator<<(std::ostream& os, const ChangesOf& v);
#define DECLARE_INSTRUCTION_FACTORY_P0(I) \
return new(zone) I(p1, p2, p3, p4, p5, p6); \
}
-#define DECLARE_INSTRUCTION_FACTORY_P7(I, P1, P2, P3, P4, P5, P6, P7) \
- static I* New(Zone* zone, \
- HValue* context, \
- P1 p1, \
- P2 p2, \
- P3 p3, \
- P4 p4, \
- P5 p5, \
- P6 p6, \
- P7 p7) { \
- return new(zone) I(p1, p2, p3, p4, p5, p6, p7); \
- }
-
#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P0(I) \
static I* New(Zone* zone, HValue* context) { \
return new(zone) I(context); \
HInstruction* next() const { return next_; }
HInstruction* previous() const { return previous_; }
- virtual OStream& PrintTo(OStream& os) const OVERRIDE; // NOLINT
- virtual OStream& PrintDataTo(OStream& os) const; // NOLINT
+ virtual std::ostream& PrintTo(std::ostream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT
bool IsLinked() const { return block() != NULL; }
void Unlink();
virtual int SuccessorCount() const = 0;
virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual bool KnownSuccessorBlock(HBasicBlock** block) {
*block = NULL;
return Representation::None();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(DummyUse);
};
return Representation::None();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(Goto)
};
SetSuccessorAt(1, false_target);
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* value() const { return OperandAt(0); }
};
virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
ToBooleanStub::Types expected_input_types() const {
return expected_input_types_;
return false;
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
static const int kNoKnownSuccessorIndex = -1;
int known_successor_index() const { return known_successor_index_; }
DECLARE_CONCRETE_INSTRUCTION(CompareMap)
protected:
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
HCompareMap(HValue* value,
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* value() const { return OperandAt(0); }
HValue* context() const { return OperandAt(1); }
}
HValue* value() const { return OperandAt(0); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
};
return representation(); // Same as the output representation.
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(ForceRepresentation)
if (value->representation().IsSmi() || value->type().IsSmi()) {
set_type(HType::Smi());
} else {
- if (to.IsFloat32x4()) {
- set_type(HType::Float32x4());
- } else if (to.IsFloat64x2()) {
- set_type(HType::Float64x2());
- } else if (to.IsInt32x4()) {
- set_type(HType::Int32x4());
- } else {
- set_type(HType::TaggedNumber());
- }
+ set_type(HType::TaggedNumber());
if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion);
}
}
virtual Range* InferRange(Zone* zone) OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(Change)
done_with_replay_(false) {}
~HSimulate() {}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
bool HasAstId() const { return !ast_id_.IsNone(); }
BailoutId ast_id() const { return ast_id_; }
return Representation::None();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
#ifdef DEBUG
void set_closure(Handle<JSFunction> closure) {
void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone);
ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
Handle<JSFunction> closure() const { return closure_; }
HConstant* closure_context() const { return closure_context_; }
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* value() const { return OperandAt(0); }
};
SetOperandAt(1, second);
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(
int index) FINAL OVERRIDE {
HValue* function() const { return OperandAt(0); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(
int index) FINAL OVERRIDE {
return OperandAt(0);
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
private:
// The argument count includes the receiver.
HValue* context() { return first(); }
HValue* constructor() { return second(); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
ElementsKind elements_kind() const { return elements_kind_; }
const Runtime::Function*,
int);
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* context() { return OperandAt(0); }
const Runtime::Function* function() const { return c_function_; }
HValue* context() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
if (index == 0) {
// TODO(bmeurer): We'll need kDependsOnRoots once we add the
// corresponding HStoreRoot instruction.
SetDependsOnFlag(kCalls);
+ set_representation(Representation::Tagged());
}
virtual bool IsDeletable() const OVERRIDE { return true; }
return HType::HeapObject();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* value() const { return OperandAt(0); }
HValue* typecheck() const { return OperandAt(1); }
return this->maps()->Equals(HCheckMaps::cast(other)->maps());
}
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
HCheckMaps(HValue* value, const UniqueSet<Map>* maps, bool maps_are_stable)
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual HValue* Canonicalize() OVERRIDE;
DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check);
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
return check_ == b->check_;
}
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
const char* GetCheckName() const;
induction_variable_data_ = InductionVariableData::ExaminePhi(this);
}
- virtual OStream& PrintTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintTo(std::ostream& os) const OVERRIDE; // NOLINT
#ifdef DEBUG
virtual void Verify() OVERRIDE;
// Replay effects of this instruction on the given environment.
void ReplayEnvironment(HEnvironment* env);
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(CapturedObject)
}
virtual bool EmitAtUses() OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HConstant* CopyToRepresentation(Representation r, Zone* zone) const;
Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone);
Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone);
virtual bool IsCommutative() const { return false; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
if (index == 0) return Representation::Tagged();
virtual HValue* Canonicalize() OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
bool known_function() const { return known_function_; }
DECLARE_CONCRETE_INSTRUCTION(WrapReceiver)
public:
DECLARE_INSTRUCTION_FACTORY_P3(HAccessArgumentsAt, HValue*, HValue*, HValue*);
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
// The arguments elements is considered tagged.
class HBoundsCheck FINAL : public HTemplateInstruction<2> {
public:
DECLARE_INSTRUCTION_FACTORY_P2(HBoundsCheck, HValue*, HValue*);
- DECLARE_INSTRUCTION_FACTORY_P4(HBoundsCheck, HValue*, HValue*,
- BuiltinFunctionId, ElementsKind);
bool skip_check() const { return skip_check_; }
void set_skip_check() { skip_check_ = true; }
return representation();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual void InferRepresentation(
HInferRepresentationPhase* h_infer) OVERRIDE;
HValue* length() const { return OperandAt(1); }
bool allow_equality() const { return allow_equality_; }
void set_allow_equality(bool v) { allow_equality_ = v; }
- BuiltinFunctionId op() const { return op_; }
- ElementsKind element_kind() const { return element_kind_; }
virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
virtual bool IsPurelyInformativeDefinition() OVERRIDE {
int offset_;
int scale_;
bool allow_equality_;
- BuiltinFunctionId op_;
- ElementsKind element_kind_;
private:
// Normally HBoundsCheck should be created using the
// HGraphBuilder::AddBoundsCheck() helper.
// However when building stubs, where we know that the arguments are Int32,
// it makes sense to invoke this constructor directly.
- HBoundsCheck(HValue* index, HValue* length,
- BuiltinFunctionId op = kNumberOfBuiltinFunction,
- ElementsKind element_kind = EXTERNAL_INT8_ELEMENTS)
+ HBoundsCheck(HValue* index, HValue* length)
: skip_check_(false),
base_(NULL), offset_(0), scale_(0),
- allow_equality_(false), op_(op),
- element_kind_(element_kind) {
+ allow_equality_(false) {
SetOperandAt(0, index);
SetOperandAt(1, length);
SetFlag(kFlexibleRepresentation);
return representation();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
virtual bool IsPurelyInformativeDefinition() OVERRIDE { return true; }
return r;
}
- virtual void initialize_output_representation(Representation observed) {
+ virtual void initialize_output_representation(
+ Representation observed) OVERRIDE {
if (observed.IsDouble()) observed = Representation::Integer32();
HBinaryOperation::initialize_output_representation(observed);
}
}
Token::Value token() const { return token_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(CompareGeneric)
virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
void SetOperandPositions(Zone* zone,
HSourcePosition left_pos,
HValue* left() const { return OperandAt(0); }
HValue* right() const { return OperandAt(1); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch)
protected:
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
- HIsStringAndBranch(HValue* value,
- HBasicBlock* true_target = NULL,
+ HIsStringAndBranch(HValue* value, HBasicBlock* true_target = NULL,
HBasicBlock* false_target = NULL)
- : HUnaryControlInstruction(value, true_target, false_target),
- known_successor_index_(kNoKnownSuccessorIndex) { }
+ : HUnaryControlInstruction(value, true_target, false_target),
+ known_successor_index_(kNoKnownSuccessorIndex) {
+ set_representation(Representation::Tagged());
+ }
int known_successor_index_;
};
protected:
virtual bool DataEquals(HValue* other) OVERRIDE { return true; }
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
HIsSmiAndBranch(HValue* value,
HValue* right() { return OperandAt(2); }
Token::Value token() const { return token_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
InstanceType from() { return from_; }
InstanceType to() { return to_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
Handle<String> class_name() const { return class_name_; }
DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>);
Handle<String> type_literal() const { return type_literal_.handle(); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch)
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(InstanceOf)
virtual HValue* Canonicalize() OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(Bitwise)
unsigned index() const { return index_; }
ParameterKind kind() const { return kind_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::None();
HValue* context() { return value(); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(CallStub)
HValue* name() const { return OperandAt(2); }
Code::Flags flags() const { return flags_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache)
public:
DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int);
- virtual OStream& PrintDataTo(OStream& os) const; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::None();
Unique<Cell> cell() const { return cell_; }
bool RequiresHoleCheck() const;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual intptr_t Hashcode() OVERRIDE {
return cell_.Hashcode();
HValue* global_object() { return OperandAt(1); }
Handle<String> name() const { return name_; }
bool for_typeof() const { return for_typeof_; }
- int slot() const {
- DCHECK(FLAG_vector_ics &&
- slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot);
+ FeedbackVectorICSlot slot() const {
+ DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
return slot_;
}
- Handle<FixedArray> feedback_vector() const { return feedback_vector_; }
- void SetVectorAndSlot(Handle<FixedArray> vector, int slot) {
+ Handle<TypeFeedbackVector> feedback_vector() const {
+ return feedback_vector_;
+ }
+ void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
+ FeedbackVectorICSlot slot) {
DCHECK(FLAG_vector_ics);
feedback_vector_ = vector;
slot_ = slot;
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
private:
HLoadGlobalGeneric(HValue* context, HValue* global_object,
Handle<String> name, bool for_typeof)
- : name_(name), for_typeof_(for_typeof),
- slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) {
+ : name_(name),
+ for_typeof_(for_typeof),
+ slot_(FeedbackVectorICSlot::Invalid()) {
SetOperandAt(0, context);
SetOperandAt(1, global_object);
set_representation(Representation::Tagged());
Handle<String> name_;
bool for_typeof_;
- Handle<FixedArray> feedback_vector_;
- int slot_;
+ Handle<TypeFeedbackVector> feedback_vector_;
+ FeedbackVectorICSlot slot_;
};
virtual bool HandleSideEffectDominator(GVNFlag side_effect,
HValue* dominator) OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(Allocate)
return new(zone) HStoreCodeEntry(function, code);
}
- virtual Representation RequiredInputRepresentation(int index) {
+ virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
}
return index == 0 ? Representation::Tagged() : Representation::Integer32();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject)
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell)
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot)
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot)
Representation::Integer32());
}
- static HObjectAccess ForSIMD128Double0() {
- return HObjectAccess(
- kDouble, Float32x4::kValueOffset, Representation::Double());
- }
-
- static HObjectAccess ForSIMD128Double1() {
- return HObjectAccess(kDouble,
- Float32x4::kValueOffset + kDoubleSize,
- Representation::Double());
- }
-
static HObjectAccess ForElementsPointer() {
return HObjectAccess(kElementsPointer, JSObject::kElementsOffset);
}
Representation::UInteger16());
}
- static HObjectAccess ForMapPrototype() {
- return HObjectAccess(kInobject, Map::kPrototypeOffset);
- }
-
static HObjectAccess ForPropertyCellValue() {
return HObjectAccess(kInobject, PropertyCell::kValueOffset);
}
friend class HLoadNamedField;
friend class HStoreNamedField;
friend class SideEffectsTracker;
- friend OStream& operator<<(OStream& os, const HObjectAccess& access);
+ friend std::ostream& operator<<(std::ostream& os,
+ const HObjectAccess& access);
inline Portion portion() const {
return PortionField::decode(value_);
};
-OStream& operator<<(OStream& os, const HObjectAccess& access);
+std::ostream& operator<<(std::ostream& os, const HObjectAccess& access);
class HLoadNamedField FINAL : public HTemplateInstruction<2> {
return !access().IsInobject() || access().offset() >= size;
}
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- if (index == 0 && access().IsExternalMemory()) {
+ if (index == 0) {
// object must be external in case of external memory access
- return Representation::External();
+ return access().IsExternalMemory() ? Representation::External()
+ : Representation::Tagged();
}
- return Representation::Tagged();
+ DCHECK(index == 1);
+ return Representation::None();
}
virtual Range* InferRange(Zone* zone) OVERRIDE;
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
bool CanBeReplacedWith(HValue* other) const {
if (!CheckFlag(HValue::kCantBeReplaced)) return false;
HValue* object() const { return OperandAt(1); }
Handle<Object> name() const { return name_; }
- int slot() const {
- DCHECK(FLAG_vector_ics &&
- slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot);
+ FeedbackVectorICSlot slot() const {
+ DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
return slot_;
}
- Handle<FixedArray> feedback_vector() const { return feedback_vector_; }
- void SetVectorAndSlot(Handle<FixedArray> vector, int slot) {
+ Handle<TypeFeedbackVector> feedback_vector() const {
+ return feedback_vector_;
+ }
+ void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
+ FeedbackVectorICSlot slot) {
DCHECK(FLAG_vector_ics);
feedback_vector_ = vector;
slot_ = slot;
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
private:
HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name)
- : name_(name),
- slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) {
+ : name_(name), slot_(FeedbackVectorICSlot::Invalid()) {
SetOperandAt(0, context);
SetOperandAt(1, object);
set_representation(Representation::Tagged());
}
Handle<Object> name_;
- Handle<FixedArray> feedback_vector_;
- int slot_;
+ Handle<TypeFeedbackVector> feedback_vector_;
+ FeedbackVectorICSlot slot_;
};
ElementsKind, LoadKeyedHoleMode);
DECLARE_INSTRUCTION_FACTORY_P6(HLoadKeyed, HValue*, HValue*, HValue*,
ElementsKind, LoadKeyedHoleMode, int);
- DECLARE_INSTRUCTION_FACTORY_P7(HLoadKeyed, HValue*, HValue*, HValue*,
- ElementsKind, LoadKeyedHoleMode, int,
- BuiltinFunctionId);
bool is_external() const {
return IsExternalArrayElementsKind(elements_kind());
}
bool HasDependency() const { return OperandAt(0) != OperandAt(2); }
uint32_t base_offset() const { return BaseOffsetField::decode(bit_field_); }
- bool TryIncreaseBaseOffset(uint32_t increase_by_value);
- BuiltinFunctionId op() {return op_;}
- HValue* GetKey() { return key(); }
- void SetKey(HValue* key) { SetOperandAt(1, key); }
- bool IsDehoisted() const { return IsDehoistedField::decode(bit_field_); }
- void SetDehoisted(bool is_dehoisted) {
+ bool TryIncreaseBaseOffset(uint32_t increase_by_value) OVERRIDE;
+ HValue* GetKey() OVERRIDE { return key(); }
+ void SetKey(HValue* key) OVERRIDE { SetOperandAt(1, key); }
+ bool IsDehoisted() const OVERRIDE {
+ return IsDehoistedField::decode(bit_field_);
+ }
+ void SetDehoisted(bool is_dehoisted) OVERRIDE {
bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted);
}
virtual ElementsKind elements_kind() const OVERRIDE {
return RequiredInputRepresentation(index);
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
bool UsesMustHandleHole() const;
bool AllUsesCanTreatHoleAsNaN() const;
HValue* dependency,
ElementsKind elements_kind,
LoadKeyedHoleMode mode = NEVER_RETURN_HOLE,
- int offset = kDefaultKeyedHeaderOffsetSentinel,
- BuiltinFunctionId op = kNumberOfBuiltinFunction)
- : bit_field_(0), op_(op) {
+ int offset = kDefaultKeyedHeaderOffsetSentinel)
+ : bit_field_(0) {
offset = offset == kDefaultKeyedHeaderOffsetSentinel
? GetDefaultHeaderSizeForElementsKind(elements_kind)
: offset;
SetDependsOnFlag(kDoubleArrayElements);
}
} else {
- if (op_ == kFloat32ArrayGetFloat32x4XYZW ||
- op_ == kFloat32ArrayGetFloat32x4X ||
- op_ == kFloat32ArrayGetFloat32x4XY ||
- op_ == kFloat32ArrayGetFloat32x4XYZ ||
- op_ == kInt8ArrayGetFloat32x4XYZW ||
- op_ == kInt8ArrayGetFloat32x4X ||
- op_ == kInt8ArrayGetFloat32x4XY ||
- op_ == kInt8ArrayGetFloat32x4XYZ) {
- set_representation(Representation::Float32x4());
- } else if (op_ == kFloat64ArrayGetFloat64x2XY ||
- op_ == kFloat64ArrayGetFloat64x2X ||
- op_ == kInt8ArrayGetFloat64x2XY ||
- op_ == kInt8ArrayGetFloat64x2X) {
- set_representation(Representation::Float64x2());
- } else if (op_ == kInt32ArrayGetInt32x4XYZW ||
- op_ == kInt32ArrayGetInt32x4X ||
- op_ == kInt32ArrayGetInt32x4XY ||
- op_ == kInt32ArrayGetInt32x4XYZ ||
- op_ == kInt8ArrayGetInt32x4XYZW ||
- op_ == kInt8ArrayGetInt32x4X ||
- op_ == kInt8ArrayGetInt32x4XY ||
- op_ == kInt8ArrayGetInt32x4XYZ) {
- set_representation(Representation::Int32x4());
- } else if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
+ if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
elements_kind == FLOAT32_ELEMENTS ||
elements_kind == FLOAT64_ELEMENTS) {
set_representation(Representation::Double());
- } else if (IsFloat32x4ElementsKind(elements_kind)) {
- set_representation(CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Float32x4() : Representation::Tagged());
- } else if (IsFloat64x2ElementsKind(elements_kind)) {
- set_representation(CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Float64x2() : Representation::Tagged());
- } else if (IsInt32x4ElementsKind(elements_kind)) {
- set_representation(CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Int32x4() : Representation::Tagged());
} else {
set_representation(Representation::Integer32());
}
public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted>
{}; // NOLINT
uint32_t bit_field_;
- BuiltinFunctionId op_;
};
HValue* object() const { return OperandAt(0); }
HValue* key() const { return OperandAt(1); }
HValue* context() const { return OperandAt(2); }
- int slot() const {
- DCHECK(FLAG_vector_ics &&
- slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot);
+ FeedbackVectorICSlot slot() const {
+ DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
return slot_;
}
- Handle<FixedArray> feedback_vector() const { return feedback_vector_; }
- void SetVectorAndSlot(Handle<FixedArray> vector, int slot) {
+ Handle<TypeFeedbackVector> feedback_vector() const {
+ return feedback_vector_;
+ }
+ void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
+ FeedbackVectorICSlot slot) {
DCHECK(FLAG_vector_ics);
feedback_vector_ = vector;
slot_ = slot;
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
// tagged[tagged]
private:
HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key)
- : slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) {
+ : slot_(FeedbackVectorICSlot::Invalid()) {
set_representation(Representation::Tagged());
SetOperandAt(0, obj);
SetOperandAt(1, key);
SetAllSideEffects();
}
- Handle<FixedArray> feedback_vector_;
- int slot_;
+ Handle<TypeFeedbackVector> feedback_vector_;
+ FeedbackVectorICSlot slot_;
};
dominator_ = dominator;
return false;
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
HValue* object() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
Handle<String> name() const { return name_; }
StrictMode strict_mode() const { return strict_mode_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
ElementsKind, StoreFieldOrKeyedMode);
DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*,
ElementsKind, StoreFieldOrKeyedMode, int);
- DECLARE_INSTRUCTION_FACTORY_P7(HStoreKeyed, HValue*, HValue*, HValue*,
- ElementsKind, StoreFieldOrKeyedMode, int,
- BuiltinFunctionId);
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
// kind_fast: tagged[int32] = tagged
}
DCHECK_EQ(index, 2);
- if (op_ == kFloat32ArraySetFloat32x4XYZW ||
- op_ == kFloat32ArraySetFloat32x4X ||
- op_ == kFloat32ArraySetFloat32x4XY ||
- op_ == kFloat32ArraySetFloat32x4XYZ ||
- op_ == kInt8ArraySetFloat32x4XYZW ||
- op_ == kInt8ArraySetFloat32x4X ||
- op_ == kInt8ArraySetFloat32x4XY ||
- op_ == kInt8ArraySetFloat32x4XYZ) {
- return Representation::Float32x4();
- } else if (op_ == kFloat64ArraySetFloat64x2XY ||
- op_ == kFloat64ArraySetFloat64x2X ||
- op_ == kInt8ArraySetFloat64x2XY ||
- op_ == kInt8ArraySetFloat64x2X) {
- return Representation::Float64x2();
- } else if (op_ == kInt32ArraySetInt32x4XYZW ||
- op_ == kInt32ArraySetInt32x4X ||
- op_ == kInt32ArraySetInt32x4XY ||
- op_ == kInt32ArraySetInt32x4XYZ ||
- op_ == kInt8ArraySetInt32x4XYZW ||
- op_ == kInt8ArraySetInt32x4X ||
- op_ == kInt8ArraySetInt32x4XY ||
- op_ == kInt8ArraySetInt32x4XYZ) {
- return Representation::Int32x4();
- }
return RequiredValueRepresentation(elements_kind_, store_mode_);
}
return Representation::Integer32();
}
- if (IsFloat32x4ElementsKind(kind)) {
- return CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Float32x4() : Representation::Tagged();
- }
- if (IsFloat64x2ElementsKind(kind)) {
- return CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Float64x2() : Representation::Tagged();
- }
- if (IsInt32x4ElementsKind(kind)) {
- return CpuFeatures::SupportsSIMD128InCrankshaft() ?
- Representation::Int32x4() : Representation::Tagged();
- }
-
if (IsFastSmiElementsKind(kind)) {
return Representation::Smi();
}
if (IsUninitialized()) {
return Representation::None();
}
- if (op_ == kFloat32ArraySetFloat32x4XYZW ||
- op_ == kFloat32ArraySetFloat32x4X ||
- op_ == kFloat32ArraySetFloat32x4XY ||
- op_ == kFloat32ArraySetFloat32x4XYZ ||
- op_ == kInt8ArraySetFloat32x4XYZW ||
- op_ == kInt8ArraySetFloat32x4X ||
- op_ == kInt8ArraySetFloat32x4XY ||
- op_ == kInt8ArraySetFloat32x4XYZ) {
- return Representation::Float32x4();
- } else if (op_ == kFloat64ArraySetFloat64x2XY ||
- op_ == kFloat64ArraySetFloat64x2X ||
- op_ == kInt8ArraySetFloat64x2XY ||
- op_ == kInt8ArraySetFloat64x2X) {
- return Representation::Float64x2();
- } else if (op_ == kInt32ArraySetInt32x4XYZW ||
- op_ == kInt32ArraySetInt32x4X ||
- op_ == kInt32ArraySetInt32x4XY ||
- op_ == kInt32ArraySetInt32x4XYZ ||
- op_ == kInt8ArraySetInt32x4XYZW ||
- op_ == kInt8ArraySetInt32x4X ||
- op_ == kInt8ArraySetInt32x4XY ||
- op_ == kInt8ArraySetInt32x4XYZ) {
- return Representation::Int32x4();
- }
Representation r = RequiredValueRepresentation(elements_kind_, store_mode_);
// For fast object elements kinds, don't assume anything.
if (r.IsTagged()) return Representation::None();
return r;
}
- BuiltinFunctionId op() const { return op_; }
HValue* elements() const { return OperandAt(0); }
HValue* key() const { return OperandAt(1); }
HValue* value() const { return OperandAt(2); }
return IsFastSmiElementsKind(elements_kind_);
}
StoreFieldOrKeyedMode store_mode() const { return store_mode_; }
- ElementsKind elements_kind() const { return elements_kind_; }
+ ElementsKind elements_kind() const OVERRIDE { return elements_kind_; }
uint32_t base_offset() const { return base_offset_; }
- bool TryIncreaseBaseOffset(uint32_t increase_by_value);
- HValue* GetKey() { return key(); }
- void SetKey(HValue* key) { SetOperandAt(1, key); }
- bool IsDehoisted() const { return is_dehoisted_; }
- void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; }
+ bool TryIncreaseBaseOffset(uint32_t increase_by_value) OVERRIDE;
+ HValue* GetKey() OVERRIDE { return key(); }
+ void SetKey(HValue* key) OVERRIDE { SetOperandAt(1, key); }
+ bool IsDehoisted() const OVERRIDE { return is_dehoisted_; }
+ void SetDehoisted(bool is_dehoisted) OVERRIDE {
+ is_dehoisted_ = is_dehoisted;
+ }
bool IsUninitialized() { return is_uninitialized_; }
void SetUninitialized(bool is_uninitialized) {
is_uninitialized_ = is_uninitialized;
bool NeedsCanonicalization();
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(StoreKeyed)
HStoreKeyed(HValue* obj, HValue* key, HValue* val,
ElementsKind elements_kind,
StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE,
- int offset = kDefaultKeyedHeaderOffsetSentinel,
- BuiltinFunctionId op = kNumberOfBuiltinFunction)
+ int offset = kDefaultKeyedHeaderOffsetSentinel)
: elements_kind_(elements_kind),
base_offset_(offset == kDefaultKeyedHeaderOffsetSentinel
? GetDefaultHeaderSizeForElementsKind(elements_kind)
is_dehoisted_(false),
is_uninitialized_(false),
store_mode_(store_mode),
- dominator_(NULL),
- op_(op) {
+ dominator_(NULL) {
SetOperandAt(0, obj);
SetOperandAt(1, key);
SetOperandAt(2, val);
bool is_uninitialized_ : 1;
StoreFieldOrKeyedMode store_mode_: 1;
HValue* dominator_;
- BuiltinFunctionId op_;
};
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric)
ElementsKind from_kind() const { return from_kind_; }
ElementsKind to_kind() const { return to_kind_; }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind)
transitioned_map_ == instr->transitioned_map_;
}
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
private:
HTransitionElementsKind(HValue* context,
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(StringAdd)
HValue*,
HValue*);
- virtual Representation RequiredInputRepresentation(int index) {
+ virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
// The index is supposed to be Integer32.
return index == 2
? Representation::Integer32()
HValue* context() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual HType CalculateInferredType() OVERRIDE {
if (value()->type().IsHeapObject()) return value()->type();
DECLARE_CONCRETE_INSTRUCTION(CheckMapValue)
protected:
- virtual int RedefinedOperandIndex() { return 0; }
+ virtual int RedefinedOperandIndex() OVERRIDE { return 0; }
virtual bool DataEquals(HValue* other) OVERRIDE {
return true;
HValue* context() const { return OperandAt(0); }
HValue* enumerable() const { return OperandAt(1); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual HType CalculateInferredType() OVERRIDE {
return HType::Tagged();
index_cache_ = index_cache;
}
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual HType CalculateInferredType() OVERRIDE {
return HType::Tagged();
HValue* object() const { return OperandAt(0); }
HValue* index() const { return OperandAt(1); }
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
virtual HType CalculateInferredType() OVERRIDE {
return HType::Tagged();
HValue* context() { return OperandAt(0); }
- virtual Representation RequiredInputRepresentation(int index) {
+ virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
}
HValue* function() const { return OperandAt(1); }
Handle<ScopeInfo> scope_info() const { return scope_info_; }
- virtual Representation RequiredInputRepresentation(int index) {
+ virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
return Representation::Tagged();
}
- virtual OStream& PrintDataTo(OStream& os) const; // NOLINT
+ virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext)
};
-class HNullarySIMDOperation FINAL : public HTemplateInstruction<1> {
- public:
- static HInstruction* New(Zone* zone,
- HValue* context,
- BuiltinFunctionId op);
-
- HValue* context() { return OperandAt(0); }
-
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE;
-
- virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- return Representation::Tagged();
- }
-
- BuiltinFunctionId op() const { return op_; }
- const char* OpName() const;
-
- DECLARE_CONCRETE_INSTRUCTION(NullarySIMDOperation)
-
- protected:
- virtual bool DataEquals(HValue* other) OVERRIDE {
- HNullarySIMDOperation* b = HNullarySIMDOperation::cast(other);
- return op_ == b->op();
- }
-
- private:
- HNullarySIMDOperation(HValue* context, BuiltinFunctionId op)
- : HTemplateInstruction<1>(HType::None()), op_(op) {
- SetOperandAt(0, context);
- switch (op) {
-#define SIMD_NULLARY_OPERATION_CASE_ITEM(p1, p2, name, representation) \
- case k##name: \
- set_representation(Representation::representation()); \
- set_type(HType::FromRepresentation(representation_)); \
- break;
-SIMD_NULLARY_OPERATIONS(SIMD_NULLARY_OPERATION_CASE_ITEM)
-#undef SIMD_NULLARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- }
- SetFlag(kUseGVN);
- }
-
- virtual bool IsDeletable() const OVERRIDE { return true; }
-
- BuiltinFunctionId op_;
-};
-
-
-class HUnarySIMDOperation FINAL : public HTemplateInstruction<2> {
- public:
- static HInstruction* New(Zone* zone,
- HValue* context,
- HValue* value,
- BuiltinFunctionId op,
- Representation to = Representation::Float32x4());
-
- HValue* context() { return OperandAt(0); }
- HValue* value() const { return OperandAt(1); }
-
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE;
-
- virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- if (index == 0) {
- return Representation::Tagged();
- } else if (op_ == kSIMD128Change) {
- return value()->representation();
- } else {
- switch (op_) {
-#define SIMD_UNARY_OPERATION_CASE_ITEM(p1, p2, name, p4, representation) \
- case k##name: \
- return Representation::representation();
-SIMD_UNARY_OPERATIONS(SIMD_UNARY_OPERATION_CASE_ITEM)
-SIMD_UNARY_OPERATIONS_FOR_PROPERTY_ACCESS(SIMD_UNARY_OPERATION_CASE_ITEM)
-#undef SIMD_UNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- return Representation::None();
- }
- }
- }
-
- BuiltinFunctionId op() const { return op_; }
- const char* OpName() const;
-
- DECLARE_CONCRETE_INSTRUCTION(UnarySIMDOperation)
-
- protected:
- virtual bool DataEquals(HValue* other) OVERRIDE {
- HUnarySIMDOperation* b = HUnarySIMDOperation::cast(other);
- return op_ == b->op();
- }
-
- private:
- HUnarySIMDOperation(HValue* context, HValue* value, BuiltinFunctionId op,
- Representation to = Representation::Float32x4())
- : HTemplateInstruction<2>(HType::None()), op_(op) {
- SetOperandAt(0, context);
- SetOperandAt(1, value);
- switch (op) {
- case kSIMD128Change:
- set_representation(to);
- set_type(HType::FromRepresentation(to));
- break;
-#define SIMD_UNARY_OPERATION_CASE_ITEM(p1, p2, name, representation, p5) \
- case k##name: \
- set_representation(Representation::representation()); \
- set_type(HType::FromRepresentation(representation_)); \
- if (Representation::p5().IsInteger32()) { \
- SetFlag(kTruncatingToInt32); \
- } \
- break;
-SIMD_UNARY_OPERATIONS(SIMD_UNARY_OPERATION_CASE_ITEM)
-SIMD_UNARY_OPERATIONS_FOR_PROPERTY_ACCESS(SIMD_UNARY_OPERATION_CASE_ITEM)
-#undef SIMD_UNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- }
- SetFlag(kUseGVN);
- }
-
- virtual bool IsDeletable() const OVERRIDE { return true; }
-
- BuiltinFunctionId op_;
-};
-
-
-class HBinarySIMDOperation FINAL : public HTemplateInstruction<3> {
- public:
- static HInstruction* New(Zone* zone,
- HValue* context,
- HValue* left,
- HValue* right,
- BuiltinFunctionId op);
-
- HValue* context() { return OperandAt(0); }
- HValue* left() const { return OperandAt(1); }
- HValue* right() const { return OperandAt(2); }
-
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE;
-
- virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- if (index == 0) {
- return Representation::Tagged();
- } else {
- switch (op_) {
-#define SIMD_BINARY_OPERATION_CASE_ITEM(p1, p2, name, p4, left_representation, \
- right_representation) \
- case k##name: \
- return index == 1 ? Representation::left_representation() \
- : Representation::right_representation(); \
- break;
-SIMD_BINARY_OPERATIONS(SIMD_BINARY_OPERATION_CASE_ITEM)
-#undef SIMD_BINARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- return Representation::None();
- }
- }
- }
-
- BuiltinFunctionId op() const { return op_; }
- const char* OpName() const;
-
- DECLARE_CONCRETE_INSTRUCTION(BinarySIMDOperation)
-
- protected:
- virtual bool DataEquals(HValue* other) OVERRIDE {
- HBinarySIMDOperation* b = HBinarySIMDOperation::cast(other);
- return op_ == b->op();
- }
-
- private:
- HBinarySIMDOperation(HValue* context, HValue* left, HValue* right,
- BuiltinFunctionId op)
- : HTemplateInstruction<3>(HType::None()), op_(op) {
- SetOperandAt(0, context);
- SetOperandAt(1, left);
- SetOperandAt(2, right);
- switch (op) {
-#define SIMD_BINARY_OPERATION_CASE_ITEM(p1, p2, name, representation, p5, p6) \
- case k##name: \
- set_representation(Representation::representation()); \
- set_type(HType::FromRepresentation(representation_)); \
- if (Representation::p5().IsInteger32() || \
- Representation::p6().IsInteger32()) { \
- SetFlag(kTruncatingToInt32); \
- } \
- break;
-SIMD_BINARY_OPERATIONS(SIMD_BINARY_OPERATION_CASE_ITEM)
-#undef SIMD_BINARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- }
- SetFlag(kUseGVN);
- }
-
- virtual bool IsDeletable() const OVERRIDE { return true; }
-
- BuiltinFunctionId op_;
-};
-
-
-class HTernarySIMDOperation FINAL : public HTemplateInstruction<4> {
- public:
- static HInstruction* New(Zone* zone,
- HValue* context,
- HValue* first,
- HValue* second,
- HValue* third,
- BuiltinFunctionId op);
-
- HValue* context() { return OperandAt(0); }
- HValue* first() const { return OperandAt(1); }
- HValue* second() const { return OperandAt(2); }
- HValue* third() const { return OperandAt(3); }
-
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE;
-
- virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- if (index == 0) {
- return Representation::Tagged();
- } else {
- switch (op_) {
-#define SIMD_TERNARY_OPERATION_CASE_ITEM(p1, p2, name, p4, \
- first_representation, second_representation, third_representation) \
- case k##name: \
- switch (index) { \
- case 1: return Representation::first_representation(); \
- case 2: return Representation::second_representation(); \
- case 3: return Representation::third_representation(); \
- default: \
- UNREACHABLE(); \
- return Representation::None(); \
- }
-SIMD_TERNARY_OPERATIONS(SIMD_TERNARY_OPERATION_CASE_ITEM)
-#undef SIMD_TERNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- return Representation::None();
- }
- }
- }
-
- BuiltinFunctionId op() const { return op_; }
- const char* OpName() const;
-
- DECLARE_CONCRETE_INSTRUCTION(TernarySIMDOperation)
-
- protected:
- virtual bool DataEquals(HValue* other) OVERRIDE {
- HTernarySIMDOperation* b = HTernarySIMDOperation::cast(other);
- return op_ == b->op();
- }
-
- private:
- HTernarySIMDOperation(HValue* context, HValue* first, HValue* second,
- HValue* third, BuiltinFunctionId op)
- : HTemplateInstruction<4>(HType::None()), op_(op) {
- SetOperandAt(0, context);
- SetOperandAt(1, first);
- SetOperandAt(2, second);
- SetOperandAt(3, third);
- switch (op) {
-#define SIMD_TERNARY_OPERATION_CASE_ITEM(p1, p2, name, representation, p5, \
- p6, p7) \
- case k##name: \
- set_representation(Representation::representation()); \
- set_type(HType::FromRepresentation(representation_)); \
- if (Representation::p5().IsInteger32() || \
- Representation::p6().IsInteger32() || \
- Representation::p7().IsInteger32()) { \
- SetFlag(kTruncatingToInt32); \
- } \
- break;
-SIMD_TERNARY_OPERATIONS(SIMD_TERNARY_OPERATION_CASE_ITEM)
-#undef SIMD_TERNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- }
- SetFlag(kUseGVN);
- }
-
- virtual bool IsDeletable() const OVERRIDE { return true; }
-
- BuiltinFunctionId op_;
-};
-
-
-class HQuarternarySIMDOperation FINAL : public HTemplateInstruction<5> {
- public:
- static HInstruction* New(Zone* zone,
- HValue* context,
- HValue* x,
- HValue* y,
- HValue* z,
- HValue* w,
- BuiltinFunctionId op);
-
- HValue* context() { return OperandAt(0); }
- HValue* x() const { return OperandAt(1); }
- HValue* y() const { return OperandAt(2); }
- HValue* z() const { return OperandAt(3); }
- HValue* w() const { return OperandAt(4); }
-
- virtual OStream& PrintDataTo(OStream& os) const OVERRIDE;
-
- virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
- if (index == 0) {
- return Representation::Tagged();
- } else {
- switch (op_) {
-#define SIMD_QUARTERNARY_OPERATION_CASE_ITEM(p1, p2, name, p4, \
- first_representation, second_representation, third_representation, \
- fourth_representation) \
- case k##name: \
- switch (index) { \
- case 1: return Representation::first_representation(); \
- case 2: return Representation::second_representation(); \
- case 3: return Representation::third_representation(); \
- case 4: return Representation::fourth_representation(); \
- default: \
- UNREACHABLE(); \
- return Representation::None(); \
- }
-SIMD_QUARTERNARY_OPERATIONS(SIMD_QUARTERNARY_OPERATION_CASE_ITEM)
-#undef SIMD_QUARTERNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- return Representation::None();
- }
- }
- }
-
- BuiltinFunctionId op() const { return op_; }
- const char* OpName() const;
-
- DECLARE_CONCRETE_INSTRUCTION(QuarternarySIMDOperation)
-
- protected:
- virtual bool DataEquals(HValue* other) OVERRIDE {
- HQuarternarySIMDOperation* b = HQuarternarySIMDOperation::cast(other);
- return op_ == b->op();
- }
-
- private:
- HQuarternarySIMDOperation(HValue* context, HValue* x, HValue* y, HValue* z,
- HValue* w, BuiltinFunctionId op)
- : HTemplateInstruction<5>(HType::None()), op_(op) {
- SetOperandAt(0, context);
- SetOperandAt(1, x);
- SetOperandAt(2, y);
- SetOperandAt(3, z);
- SetOperandAt(4, w);
- switch (op) {
-#define SIMD_QUARTERNARY_OPERATION_CASE_ITEM(p1, p2, name, representation, p5, \
- p6, p7, p8) \
- case k##name: \
- set_representation(Representation::representation()); \
- set_type(HType::FromRepresentation(representation_)); \
- if (Representation::p5().IsInteger32() || \
- Representation::p6().IsInteger32() || \
- Representation::p7().IsInteger32() || \
- Representation::p8().IsInteger32()) { \
- SetFlag(kTruncatingToInt32); \
- } \
- break;
-SIMD_QUARTERNARY_OPERATIONS(SIMD_QUARTERNARY_OPERATION_CASE_ITEM)
-#undef SIMD_QUARTERNARY_OPERATION_CASE_ITEM
- default:
- UNREACHABLE();
- }
- SetFlag(kUseGVN);
- }
-
- virtual bool IsDeletable() const OVERRIDE { return true; }
-
- BuiltinFunctionId op_;
-};
-
#undef DECLARE_INSTRUCTION
#undef DECLARE_CONCRETE_INSTRUCTION