Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: src/hydrogen.cc

Issue 1086863003: Always wrap AllocationSiteContext::current() in a new handle in Crankshaft. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/allocation-site-scopes.h ('K') | « src/allocation-site-scopes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 03bd971a825ce7ceee500e4122265eb8fa70ed5b..ba055405b17692533ec472ca6a76bd7519ea7bc0 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5590,10 +5590,10 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
if (!boilerplate.is_null() &&
IsFastLiteral(boilerplate, kMaxFastLiteralDepth, &max_properties)) {
- AllocationSiteUsageContext usage_context(isolate(), site, false);
- usage_context.EnterNewScope();
- literal = BuildFastLiteral(boilerplate, &usage_context);
- usage_context.ExitScope(site, boilerplate);
+ AllocationSiteUsageContext site_context(isolate(), site, false);
+ site_context.EnterNewScope();
+ literal = BuildFastLiteral(boilerplate, &site_context);
+ site_context.ExitScope(site, boilerplate);
} else {
NoObservableSideEffectsScope no_effects(this);
Handle<FixedArray> closure_literals(closure->literals(), isolate());
@@ -5754,10 +5754,10 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
if (IsFastLiteral(boilerplate_object,
kMaxFastLiteralDepth,
&max_properties)) {
- AllocationSiteUsageContext usage_context(isolate(), site, false);
- usage_context.EnterNewScope();
- literal = BuildFastLiteral(boilerplate_object, &usage_context);
- usage_context.ExitScope(site, boilerplate_object);
+ AllocationSiteUsageContext site_context(isolate(), site, false);
+ site_context.EnterNewScope();
+ literal = BuildFastLiteral(boilerplate_object, &site_context);
+ site_context.ExitScope(site, boilerplate_object);
} else {
NoObservableSideEffectsScope no_effects(this);
// Boilerplate already exists and constant elements are never accessed,
@@ -11081,16 +11081,16 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
boilerplate_object->map()->instance_size());
PretenureFlag pretenure_flag = NOT_TENURED;
- Handle<AllocationSite> site(site_context->current());
+ Handle<AllocationSite> current_site(*site_context->current(), isolate());
if (FLAG_allocation_site_pretenuring) {
- pretenure_flag = site_context->current()->GetPretenureMode();
- AllocationSite::RegisterForDeoptOnTenureChange(site, top_info());
+ pretenure_flag = current_site->GetPretenureMode();
+ AllocationSite::RegisterForDeoptOnTenureChange(current_site, top_info());
}
- AllocationSite::RegisterForDeoptOnTransitionChange(site, top_info());
+ AllocationSite::RegisterForDeoptOnTransitionChange(current_site, top_info());
- HInstruction* object = Add<HAllocate>(object_size_constant, type,
- pretenure_flag, instance_type, site_context->current());
+ HInstruction* object = Add<HAllocate>(
+ object_size_constant, type, pretenure_flag, instance_type, current_site);
// If allocation folding reaches Page::kMaxRegularHeapObjectSize the
// elements array may not get folded into the object. Hence, we set the
@@ -11125,9 +11125,9 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
HValue* object_elements_size = Add<HConstant>(elements_size);
InstanceType instance_type = boilerplate_object->HasFastDoubleElements()
? FIXED_DOUBLE_ARRAY_TYPE : FIXED_ARRAY_TYPE;
- object_elements = Add<HAllocate>(
- object_elements_size, HType::HeapObject(),
- pretenure_flag, instance_type, site_context->current());
+ object_elements =
+ Add<HAllocate>(object_elements_size, HType::HeapObject(),
+ pretenure_flag, instance_type, current_site);
}
BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements);
« src/allocation-site-scopes.h ('K') | « src/allocation-site-scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698