We no longer need to recover type cells from the oracle.

We only need the values within them. Function calls to Array from optimized code needed the cell in the past, but no longer.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/141893002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18682 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mvstanton@chromium.org 2014-01-20 09:48:05 +00:00
parent 8dd7dec8c5
commit 04b1baa4c4
10 changed files with 27 additions and 47 deletions

View File

@ -4055,7 +4055,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
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)

View File

@ -756,16 +756,13 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
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();
}
}
}

View File

@ -1837,8 +1837,8 @@ class CallNew V8_FINAL : public Expression {
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_; }
@ -1862,7 +1862,7 @@ class CallNew V8_FINAL : public Expression {
bool is_monomorphic_;
Handle<JSFunction> target_;
ElementsKind elements_kind_;
Handle<Cell> allocation_info_cell_;
Handle<AllocationSite> allocation_site_;
const BailoutId return_id_;
};

View File

@ -2510,10 +2510,9 @@ class HCallNew V8_FINAL : public HBinaryCall {
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(); }
@ -2521,23 +2520,17 @@ class HCallNewArray V8_FINAL : public HBinaryCall {
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_;
};

View File

@ -7944,8 +7944,8 @@ void HOptimizedGraphBuilder::BuildInlinedCallNewArray(CallNew* expr) {
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(
@ -8019,8 +8019,9 @@ bool HOptimizedGraphBuilder::IsCallNewArrayInlineable(CallNew* expr) {
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) {
@ -8159,7 +8160,6 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
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);
@ -8170,7 +8170,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
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);

View File

@ -4290,7 +4290,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
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)

View File

@ -3972,7 +3972,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
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)

View File

@ -74,17 +74,6 @@ Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) {
}
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()) {
@ -214,9 +203,13 @@ Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(TypeFeedbackId id) {
}
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();
}

View File

@ -95,7 +95,7 @@ class TypeFeedbackOracle: public ZoneObject {
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);
@ -145,9 +145,6 @@ class TypeFeedbackOracle: public ZoneObject {
// 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_;

View File

@ -3863,7 +3863,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
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)