| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index bef46df4ec53b5f6b78b0bccaf6781a64a05b1fc..cf2cff7917ee82115c5bac760b243c154414960b 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -49,11 +49,11 @@ class HEnvironment;
|
| class HInferRepresentationPhase;
|
| class HInstruction;
|
| class HLoopInformation;
|
| +class HStoreNamedField;
|
| class HValue;
|
| class LInstruction;
|
| class LChunkBuilder;
|
|
|
| -
|
| #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
|
| V(ArithmeticBinaryOperation) \
|
| V(BinaryOperation) \
|
| @@ -164,6 +164,7 @@ class LChunkBuilder;
|
| V(Shr) \
|
| V(Simulate) \
|
| V(StackCheck) \
|
| + V(StoreCodeEntry) \
|
| V(StoreContextSlot) \
|
| V(StoreGlobalCell) \
|
| V(StoreGlobalGeneric) \
|
| @@ -882,7 +883,7 @@ class HValue : public ZoneObject {
|
| bool Equals(HValue* other);
|
| virtual intptr_t Hashcode();
|
|
|
| - // Compute unique ids upfront that is safe wrt GC and parallel recompilation.
|
| + // Compute unique ids upfront that is safe wrt GC and concurrent compilation.
|
| virtual void FinalizeUniqueValueId() { }
|
|
|
| // Printing support.
|
| @@ -1371,6 +1372,9 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction {
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CompareMap)
|
|
|
| + protected:
|
| + virtual int RedefinedOperandIndex() { return 0; }
|
| +
|
| private:
|
| Handle<Map> map_;
|
| };
|
| @@ -1673,6 +1677,9 @@ class HSimulate V8_FINAL : public HInstruction {
|
| void MergeWith(ZoneList<HSimulate*>* list);
|
| bool is_candidate_for_removal() { return removable_ == REMOVABLE_SIMULATE; }
|
|
|
| + // Replay effects of this instruction on the given environment.
|
| + void ReplayEnvironment(HEnvironment* env);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Simulate)
|
|
|
| #ifdef DEBUG
|
| @@ -2575,6 +2582,8 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
|
| return true;
|
| }
|
|
|
| + virtual int RedefinedOperandIndex() { return 0; }
|
| +
|
| private:
|
| void Add(Handle<Map> map, Zone* zone) {
|
| map_set_.Add(map, zone);
|
| @@ -2603,6 +2612,7 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
|
| omit_ = true;
|
| for (int i = 0; i < map_set_.length(); i++) {
|
| Handle<Map> map = map_set_.at(i);
|
| + if (!map->CanTransition()) continue;
|
| map->AddDependentCompilationInfo(DependentCode::kPrototypeCheckGroup,
|
| info);
|
| }
|
| @@ -2699,6 +2709,8 @@ class HCheckInstanceType V8_FINAL : public HUnaryOperation {
|
| return check_ == b->check_;
|
| }
|
|
|
| + virtual int RedefinedOperandIndex() { return 0; }
|
| +
|
| private:
|
| enum Check {
|
| IS_SPEC_OBJECT,
|
| @@ -3200,8 +3212,8 @@ class HArgumentsObject V8_FINAL : public HDematerializedObject {
|
|
|
| class HCapturedObject V8_FINAL : public HDematerializedObject {
|
| public:
|
| - HCapturedObject(int length, Zone* zone)
|
| - : HDematerializedObject(length, zone) {
|
| + HCapturedObject(int length, int id, Zone* zone)
|
| + : HDematerializedObject(length, zone), capture_id_(id) {
|
| set_representation(Representation::Tagged());
|
| values_.AddBlock(NULL, length, zone); // Resize list.
|
| }
|
| @@ -3211,8 +3223,15 @@ class HCapturedObject V8_FINAL : public HDematerializedObject {
|
| // properties or elements backing store are not tracked here.
|
| const ZoneList<HValue*>* values() const { return &values_; }
|
| int length() const { return values_.length(); }
|
| + int capture_id() const { return capture_id_; }
|
| +
|
| + // Replay effects of this instruction on the given environment.
|
| + void ReplayEnvironment(HEnvironment* env);
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CapturedObject)
|
| +
|
| + private:
|
| + int capture_id_;
|
| };
|
|
|
|
|
| @@ -3222,8 +3241,31 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
|
| DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation);
|
| DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double);
|
| DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>);
|
| + DECLARE_INSTRUCTION_FACTORY_P2(HConstant, Handle<Map>, UniqueValueId);
|
| DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference);
|
|
|
| + static HConstant* CreateAndInsertAfter(Zone* zone,
|
| + HValue* context,
|
| + int32_t value,
|
| + Representation representation,
|
| + HInstruction* instruction) {
|
| + HConstant* new_constant =
|
| + HConstant::New(zone, context, value, representation);
|
| + new_constant->InsertAfter(instruction);
|
| + return new_constant;
|
| + }
|
| +
|
| + static HConstant* CreateAndInsertBefore(Zone* zone,
|
| + HValue* context,
|
| + int32_t value,
|
| + Representation representation,
|
| + HInstruction* instruction) {
|
| + HConstant* new_constant =
|
| + HConstant::New(zone, context, value, representation);
|
| + new_constant->InsertBefore(instruction);
|
| + return new_constant;
|
| + }
|
| +
|
| Handle<Object> handle() {
|
| if (handle_.is_null()) {
|
| Factory* factory = Isolate::Current()->factory();
|
| @@ -3236,10 +3278,10 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
|
| return handle_;
|
| }
|
|
|
| - bool InstanceOf(Handle<Map> map) {
|
| + bool HasMap(Handle<Map> map) {
|
| Handle<Object> constant_object = handle();
|
| - return constant_object->IsJSObject() &&
|
| - Handle<JSObject>::cast(constant_object)->map() == *map;
|
| + return constant_object->IsHeapObject() &&
|
| + Handle<HeapObject>::cast(constant_object)->map() == *map;
|
| }
|
|
|
| bool IsSpecialDouble() const {
|
| @@ -3426,6 +3468,8 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
|
| bool is_not_in_new_space,
|
| bool is_cell,
|
| bool boolean_value);
|
| + HConstant(Handle<Map> handle,
|
| + UniqueValueId unique_id);
|
| explicit HConstant(ExternalReference reference);
|
|
|
| void Initialize(Representation r);
|
| @@ -5093,10 +5137,6 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
|
| flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED);
|
| }
|
|
|
| - void UpdateSize(HValue* size) {
|
| - SetOperandAt(1, size);
|
| - }
|
| -
|
| virtual void HandleSideEffectDominator(GVNFlag side_effect,
|
| HValue* dominator) V8_OVERRIDE;
|
|
|
| @@ -5118,7 +5158,9 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
|
| HType type,
|
| PretenureFlag pretenure_flag,
|
| InstanceType instance_type)
|
| - : HTemplateInstruction<2>(type) {
|
| + : HTemplateInstruction<2>(type),
|
| + dominating_allocate_(NULL),
|
| + filler_free_space_size_(NULL) {
|
| SetOperandAt(0, context);
|
| SetOperandAt(1, size);
|
| set_representation(Representation::Tagged());
|
| @@ -5135,12 +5177,57 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
|
| }
|
| }
|
|
|
| + void UpdateSize(HValue* size) {
|
| + SetOperandAt(1, size);
|
| + }
|
| +
|
| + HAllocate* GetFoldableDominator(HAllocate* dominator);
|
| +
|
| + void UpdateFreeSpaceFiller(int32_t filler_size);
|
| +
|
| + void CreateFreeSpaceFiller(int32_t filler_size);
|
| +
|
| + bool IsFoldable(HAllocate* allocate) {
|
| + return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) ||
|
| + (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) ||
|
| + (IsOldPointerSpaceAllocation() &&
|
| + allocate->IsOldPointerSpaceAllocation());
|
| + }
|
| +
|
| Flags flags_;
|
| Handle<Map> known_initial_map_;
|
| + HAllocate* dominating_allocate_;
|
| + HStoreNamedField* filler_free_space_size_;
|
| };
|
|
|
|
|
| -class HInnerAllocatedObject V8_FINAL : public HTemplateInstruction<1> {
|
| +class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> {
|
| + public:
|
| + static HStoreCodeEntry* New(Zone* zone,
|
| + HValue* context,
|
| + HValue* function,
|
| + HValue* code) {
|
| + return new(zone) HStoreCodeEntry(function, code);
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + HValue* function() { return OperandAt(0); }
|
| + HValue* code_object() { return OperandAt(1); }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry)
|
| +
|
| + private:
|
| + HStoreCodeEntry(HValue* function, HValue* code) {
|
| + SetOperandAt(0, function);
|
| + SetOperandAt(1, code);
|
| + }
|
| +};
|
| +
|
| +
|
| +class HInnerAllocatedObject V8_FINAL: public HTemplateInstruction<1> {
|
| public:
|
| static HInnerAllocatedObject* New(Zone* zone,
|
| HValue* context,
|
| @@ -5449,6 +5536,14 @@ class HObjectAccess V8_FINAL {
|
| return HObjectAccess(kElementsPointer, JSObject::kElementsOffset);
|
| }
|
|
|
| + static HObjectAccess ForLiteralsPointer() {
|
| + return HObjectAccess(kInobject, JSFunction::kLiteralsOffset);
|
| + }
|
| +
|
| + static HObjectAccess ForNextFunctionLinkPointer() {
|
| + return HObjectAccess(kInobject, JSFunction::kNextFunctionLinkOffset);
|
| + }
|
| +
|
| static HObjectAccess ForArrayLength(ElementsKind elements_kind) {
|
| return HObjectAccess(
|
| kArrayLengths,
|
| @@ -5493,6 +5588,35 @@ class HObjectAccess V8_FINAL {
|
| return HObjectAccess(kInobject, JSFunction::kPrototypeOrInitialMapOffset);
|
| }
|
|
|
| + static HObjectAccess ForSharedFunctionInfoPointer() {
|
| + return HObjectAccess(kInobject, JSFunction::kSharedFunctionInfoOffset);
|
| + }
|
| +
|
| + static HObjectAccess ForCodeEntryPointer() {
|
| + return HObjectAccess(kInobject, JSFunction::kCodeEntryOffset);
|
| + }
|
| +
|
| + static HObjectAccess ForCodeOffset() {
|
| + return HObjectAccess(kInobject, SharedFunctionInfo::kCodeOffset);
|
| + }
|
| +
|
| + static HObjectAccess ForFirstCodeSlot() {
|
| + return HObjectAccess(kInobject, SharedFunctionInfo::kFirstCodeSlot);
|
| + }
|
| +
|
| + static HObjectAccess ForFirstContextSlot() {
|
| + return HObjectAccess(kInobject, SharedFunctionInfo::kFirstContextSlot);
|
| + }
|
| +
|
| + static HObjectAccess ForOptimizedCodeMap() {
|
| + return HObjectAccess(kInobject,
|
| + SharedFunctionInfo::kOptimizedCodeMapOffset);
|
| + }
|
| +
|
| + static HObjectAccess ForFunctionContextPointer() {
|
| + return HObjectAccess(kInobject, JSFunction::kContextOffset);
|
| + }
|
| +
|
| static HObjectAccess ForMap() {
|
| return HObjectAccess(kMaps, JSObject::kMapOffset);
|
| }
|
| @@ -5523,6 +5647,8 @@ class HObjectAccess V8_FINAL {
|
| // Create an access to an in-object property in a JSArray.
|
| static HObjectAccess ForJSArrayOffset(int offset);
|
|
|
| + static HObjectAccess ForContextSlot(int index);
|
| +
|
| // Create an access to the backing store of an object.
|
| static HObjectAccess ForBackingStoreOffset(int offset,
|
| Representation representation = Representation::Tagged());
|
| @@ -5585,20 +5711,12 @@ class HObjectAccess V8_FINAL {
|
| };
|
|
|
|
|
| -class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> {
|
| +class HLoadNamedField V8_FINAL : public HTemplateInstruction<1> {
|
| public:
|
| DECLARE_INSTRUCTION_FACTORY_P2(HLoadNamedField, HValue*, HObjectAccess);
|
| - DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, HObjectAccess,
|
| - HValue*);
|
|
|
| HValue* object() { return OperandAt(0); }
|
| - HValue* typecheck() {
|
| - ASSERT(HasTypeCheck());
|
| - return OperandAt(1);
|
| - }
|
| -
|
| - bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
|
| - void ClearTypeCheck() { SetOperandAt(1, object()); }
|
| + bool HasTypeCheck() { return object()->IsCheckMaps(); }
|
| HObjectAccess access() const { return access_; }
|
| Representation field_representation() const {
|
| return access_.representation();
|
| @@ -5624,13 +5742,9 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> {
|
| }
|
|
|
| private:
|
| - HLoadNamedField(HValue* object,
|
| - HObjectAccess access,
|
| - HValue* typecheck = NULL)
|
| - : access_(access) {
|
| + HLoadNamedField(HValue* object, HObjectAccess access) : access_(access) {
|
| ASSERT(object != NULL);
|
| SetOperandAt(0, object);
|
| - SetOperandAt(1, typecheck != NULL ? typecheck : object);
|
|
|
| Representation representation = access.representation();
|
| if (representation.IsSmi()) {
|
| @@ -5995,6 +6109,10 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
|
| return access_.representation();
|
| }
|
|
|
| + void UpdateValue(HValue* value) {
|
| + SetOperandAt(1, value);
|
| + }
|
| +
|
| private:
|
| HStoreNamedField(HValue* obj,
|
| HObjectAccess access,
|
|
|