ASSERT(ToRegister(instr->result()).is(r0));
__ mov(r0, Operand(instr->arity()));
- __ mov(r2, Operand(instr->hydrogen()->property_cell()));
+ __ mov(r2, Operand(factory()->undefined_value()));
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- allocation_info_cell_ =
- oracle->GetCallNewAllocationInfoCell(CallNewFeedbackId());
+ allocation_site_ =
+ oracle->GetCallNewAllocationSite(CallNewFeedbackId());
is_monomorphic_ = oracle->CallNewIsMonomorphic(CallNewFeedbackId());
if (is_monomorphic_) {
target_ = oracle->GetCallNewTarget(CallNewFeedbackId());
- Object* value = allocation_info_cell_->value();
- ASSERT(!value->IsTheHole());
- if (value->IsAllocationSite()) {
- AllocationSite* site = AllocationSite::cast(value);
- elements_kind_ = site->GetElementsKind();
+ if (!allocation_site_.is_null()) {
+ elements_kind_ = allocation_site_->GetElementsKind();
}
}
}
virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; }
Handle<JSFunction> target() const { return target_; }
ElementsKind elements_kind() const { return elements_kind_; }
- Handle<Cell> allocation_info_cell() const {
- return allocation_info_cell_;
+ Handle<AllocationSite> allocation_site() const {
+ return allocation_site_;
}
BailoutId ReturnId() const { return return_id_; }
bool is_monomorphic_;
Handle<JSFunction> target_;
ElementsKind elements_kind_;
- Handle<Cell> allocation_info_cell_;
+ Handle<AllocationSite> allocation_site_;
const BailoutId return_id_;
};
class HCallNewArray V8_FINAL : public HBinaryCall {
public:
- DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray,
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray,
HValue*,
int,
- Handle<Cell>,
ElementsKind);
HValue* context() { return first(); }
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- Handle<Cell> property_cell() const {
- return type_cell_;
- }
-
ElementsKind elements_kind() const { return elements_kind_; }
DECLARE_CONCRETE_INSTRUCTION(CallNewArray)
private:
HCallNewArray(HValue* context, HValue* constructor, int argument_count,
- Handle<Cell> type_cell, ElementsKind elements_kind)
+ ElementsKind elements_kind)
: HBinaryCall(context, constructor, argument_count),
- elements_kind_(elements_kind),
- type_cell_(type_cell) {}
+ elements_kind_(elements_kind) {}
ElementsKind elements_kind_;
- Handle<Cell> type_cell_;
};
HValue* constructor = environment()->ExpressionStackAt(argument_count);
ElementsKind kind = expr->elements_kind();
- Handle<Cell> cell = expr->allocation_info_cell();
- Handle<AllocationSite> site(AllocationSite::cast(cell->value()));
+ Handle<AllocationSite> site = expr->allocation_site();
+ ASSERT(!site.is_null());
// Register on the site for deoptimization if the transition feedback changes.
AllocationSite::AddDependentCompilationInfo(
int argument_count = expr->arguments()->length();
// We should have the function plus array arguments on the environment stack.
ASSERT(environment()->length() >= (argument_count + 1));
- Handle<Cell> cell = expr->allocation_info_cell();
- AllocationSite* site = AllocationSite::cast(cell->value());
+ Handle<AllocationSite> site = expr->allocation_site();
+ ASSERT(!site.is_null());
+
if (site->CanInlineCall()) {
// We also want to avoid inlining in certain 1 argument scenarios.
if (argument_count == 1) {
Handle<JSFunction> array_function(
isolate()->global_context()->array_function(), isolate());
bool use_call_new_array = expr->target().is_identical_to(array_function);
- Handle<Cell> cell = expr->allocation_info_cell();
if (use_call_new_array && IsCallNewArrayInlineable(expr)) {
// Verify we are still calling the array function for our native context.
Add<HCheckValue>(function, array_function);
HBinaryCall* call;
if (use_call_new_array) {
Add<HCheckValue>(function, array_function);
- call = New<HCallNewArray>(function, argument_count, cell,
+ call = New<HCallNewArray>(function, argument_count,
expr->elements_kind());
} else {
call = New<HCallNew>(function, argument_count);
ASSERT(ToRegister(instr->result()).is(eax));
__ Set(eax, Immediate(instr->arity()));
- __ mov(ebx, instr->hydrogen()->property_cell());
+ __ mov(ebx, factory()->undefined_value());
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
ASSERT(ToRegister(instr->result()).is(v0));
__ li(a0, Operand(instr->arity()));
- __ li(a2, Operand(instr->hydrogen()->property_cell()));
+ __ li(a2, Operand(factory()->undefined_value()));
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
}
-Handle<Cell> TypeFeedbackOracle::GetInfoCell(
- TypeFeedbackId ast_id) {
- int entry = dictionary_->FindEntry(IdToKey(ast_id));
- if (entry != UnseededNumberDictionary::kNotFound) {
- Cell* cell = Cell::cast(dictionary_->ValueAt(entry));
- return Handle<Cell>(cell, isolate_);
- }
- return Handle<Cell>::null();
-}
-
-
bool TypeFeedbackOracle::LoadIsUninitialized(TypeFeedbackId id) {
Handle<Object> maybe_code = GetInfo(id);
if (maybe_code->IsCode()) {
}
-Handle<Cell> TypeFeedbackOracle::GetCallNewAllocationInfoCell(
+Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(
TypeFeedbackId id) {
- return GetInfoCell(id);
+ Handle<Object> info = GetInfo(id);
+ if (info->IsAllocationSite()) {
+ return Handle<AllocationSite>::cast(info);
+ }
+ return Handle<AllocationSite>::null();
}
CheckType GetCallCheckType(TypeFeedbackId id);
Handle<JSFunction> GetCallTarget(TypeFeedbackId id);
Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id);
- Handle<Cell> GetCallNewAllocationInfoCell(TypeFeedbackId id);
+ Handle<AllocationSite> GetCallNewAllocationSite(TypeFeedbackId id);
bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
bool LoadIsStub(TypeFeedbackId id, ICStub* stub);
// there is no information.
Handle<Object> GetInfo(TypeFeedbackId id);
- // Return the cell that contains type feedback.
- Handle<Cell> GetInfoCell(TypeFeedbackId id);
-
private:
Handle<Context> native_context_;
Isolate* isolate_;
ASSERT(ToRegister(instr->result()).is(rax));
__ Set(rax, instr->arity());
- __ Move(rbx, instr->hydrogen()->property_cell());
+ __ Move(rbx, factory()->undefined_value());
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)