| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index 9e6f0f0c1cd380dd41eb6c592e8140577a09c10b..ccb790d2ebd46b6d92294da394b7fc3545ae9d49 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -2450,27 +2450,66 @@ class HCallFunction V8_FINAL : public HBinaryCall {
|
| };
|
|
|
|
|
| +class HAllocationMode V8_FINAL BASE_EMBEDDED {
|
| + public:
|
| + HAllocationMode(Handle<AllocationSite> feedback_site,
|
| + HValue* current_site = NULL)
|
| + : current_site_(current_site), feedback_site_(feedback_site),
|
| + pretenure_flag_(NOT_TENURED) {}
|
| + explicit HAllocationMode(HValue* current_site)
|
| + : current_site_(current_site), pretenure_flag_(NOT_TENURED) {}
|
| + explicit HAllocationMode(PretenureFlag pretenure_flag)
|
| + : current_site_(NULL), pretenure_flag_(pretenure_flag) {}
|
| + HAllocationMode()
|
| + : current_site_(NULL), pretenure_flag_(NOT_TENURED) {}
|
| +
|
| + HValue* current_site() const { return current_site_; }
|
| + Handle<AllocationSite> feedback_site() const { return feedback_site_; }
|
| +
|
| + bool CreateAllocationMementos() const V8_WARN_UNUSED_RESULT {
|
| + return current_site() != NULL;
|
| + }
|
| +
|
| + PretenureFlag GetPretenureMode() const V8_WARN_UNUSED_RESULT {
|
| + if (!feedback_site().is_null()) return feedback_site()->GetPretenureMode();
|
| + return pretenure_flag_;
|
| + }
|
| +
|
| + private:
|
| + HValue* current_site_;
|
| + Handle<AllocationSite> feedback_site_;
|
| + PretenureFlag pretenure_flag_;
|
| +};
|
| +
|
| +
|
| class HCallNew V8_FINAL : public HBinaryCall {
|
| public:
|
| - DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallNew, HValue*, int);
|
| + DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNew, HValue*, int,
|
| + HAllocationMode);
|
|
|
| HValue* context() { return first(); }
|
| HValue* constructor() { return second(); }
|
| + HAllocationMode* allocation_mode() { return &mode_; }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CallNew)
|
|
|
| private:
|
| - HCallNew(HValue* context, HValue* constructor, int argument_count)
|
| - : HBinaryCall(context, constructor, argument_count) {}
|
| + HCallNew(HValue* context, HValue* constructor, int argument_count,
|
| + HAllocationMode mode)
|
| + : HBinaryCall(context, constructor, argument_count),
|
| + mode_(mode) {}
|
| +
|
| + HAllocationMode mode_;
|
| };
|
|
|
|
|
| class HCallNewArray V8_FINAL : public HBinaryCall {
|
| public:
|
| - DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray,
|
| + DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray,
|
| HValue*,
|
| int,
|
| - ElementsKind);
|
| + ElementsKind,
|
| + HAllocationMode);
|
|
|
| HValue* context() { return first(); }
|
| HValue* constructor() { return second(); }
|
| @@ -2478,16 +2517,19 @@ class HCallNewArray V8_FINAL : public HBinaryCall {
|
| virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
|
|
| ElementsKind elements_kind() const { return elements_kind_; }
|
| + HAllocationMode* allocation_mode() { return &mode_; }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CallNewArray)
|
|
|
| private:
|
| HCallNewArray(HValue* context, HValue* constructor, int argument_count,
|
| - ElementsKind elements_kind)
|
| + ElementsKind elements_kind, HAllocationMode mode)
|
| : HBinaryCall(context, constructor, argument_count),
|
| - elements_kind_(elements_kind) {}
|
| + elements_kind_(elements_kind),
|
| + mode_(mode) {}
|
|
|
| ElementsKind elements_kind_;
|
| + HAllocationMode mode_;
|
| };
|
|
|
|
|
|
|