Commit f01dc250 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Handlify AllocationSite AddDependentCompilationInfo.

BUG=
R=mvstanton@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a5535f58
......@@ -7907,10 +7907,11 @@ void HOptimizedGraphBuilder::BuildInlinedCallNewArray(CallNew* expr) {
ElementsKind kind = expr->elements_kind();
Handle<Cell> cell = expr->allocation_info_cell();
AllocationSite* site = AllocationSite::cast(cell->value());
Handle<AllocationSite> site(AllocationSite::cast(cell->value()));
// Register on the site for deoptimization if the cell value changes.
site->AddDependentCompilationInfo(AllocationSite::TRANSITIONS, top_info());
AllocationSite::AddDependentCompilationInfo(
site, AllocationSite::TRANSITIONS, top_info());
HInstruction* cell_instruction = Add<HConstant>(cell);
// In the single constant argument case, we may have to adjust elements kind
......@@ -8925,8 +8926,9 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Register the dependent code with the allocation site.
if (!allocation_mode.feedback_site().is_null()) {
ASSERT(!graph()->info()->IsStub());
allocation_mode.feedback_site()->AddDependentCompilationInfo(
AllocationSite::TENURING, top_info());
Handle<AllocationSite> site(allocation_mode.feedback_site());
AllocationSite::AddDependentCompilationInfo(
site, AllocationSite::TENURING, top_info());
}
// Inline string addition if we know that we'll create a cons string.
......@@ -9502,8 +9504,9 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode();
if (FLAG_allocation_site_pretenuring) {
pretenure_flag = site_context->current()->GetPretenureMode();
site_context->current()->AddDependentCompilationInfo(
AllocationSite::TENURING, top_info());
Handle<AllocationSite> site(site_context->current());
AllocationSite::AddDependentCompilationInfo(
site, AllocationSite::TENURING, top_info());
}
HInstruction* object = Add<HAllocate>(object_size_constant, type,
......
......@@ -12844,22 +12844,16 @@ MaybeObject* AllocationSite::DigestTransitionFeedback(ElementsKind to_kind) {
}
void AllocationSite::AddDependentCompilationInfo(Reason reason,
// static
void AllocationSite::AddDependentCompilationInfo(Handle<AllocationSite> site,
Reason reason,
CompilationInfo* info) {
DependentCode::DependencyGroup group = ToDependencyGroup(reason);
Handle<DependentCode> dep(dependent_code());
DependentCode::DependencyGroup group = site->ToDependencyGroup(reason);
Handle<DependentCode> dep(site->dependent_code());
Handle<DependentCode> codes =
DependentCode::Insert(dep, group, info->object_wrapper());
if (*codes != dependent_code()) set_dependent_code(*codes);
info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone());
}
void AllocationSite::AddDependentCode(Reason reason, Handle<Code> code) {
DependentCode::DependencyGroup group = ToDependencyGroup(reason);
Handle<DependentCode> codes = DependentCode::Insert(
Handle<DependentCode>(dependent_code()), group, code);
if (*codes != dependent_code()) set_dependent_code(*codes);
if (*codes != site->dependent_code()) site->set_dependent_code(*codes);
info->dependencies(group)->Add(Handle<HeapObject>(site), info->zone());
}
......@@ -16636,14 +16630,6 @@ void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
}
void PropertyCell::AddDependentCode(Handle<Code> code) {
Handle<DependentCode> codes = DependentCode::Insert(
Handle<DependentCode>(dependent_code()),
DependentCode::kPropertyCellChangedGroup, code);
if (*codes != dependent_code()) set_dependent_code(*codes);
}
const char* GetBailoutReason(BailoutReason reason) {
ASSERT(reason < kLastErrorMessage);
#define ERROR_MESSAGES_TEXTS(C, T) T,
......
......@@ -8244,8 +8244,9 @@ class AllocationSite: public Struct {
TRANSITIONS
};
void AddDependentCompilationInfo(Reason reason, CompilationInfo* info);
void AddDependentCode(Reason reason, Handle<Code> code);
static void AddDependentCompilationInfo(Handle<AllocationSite> site,
Reason reason,
CompilationInfo* info);
DECLARE_PRINTER(AllocationSite)
DECLARE_VERIFIER(AllocationSite)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment