Commit d37c1cfc authored by yurys@chromium.org's avatar yurys@chromium.org

Revert "Disable allocation folding when allocations tracking is on"

This reverts r17337. The new test fails on V8 linux - shared: http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20shared/builds/4726/steps/Check/logs/stdio

TBR=mvstanton@chromium.org
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 66bfe593
...@@ -3308,10 +3308,7 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, ...@@ -3308,10 +3308,7 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
HValue* dominator) { HValue* dominator) {
ASSERT(side_effect == kChangesNewSpacePromotion); ASSERT(side_effect == kChangesNewSpacePromotion);
Zone* zone = block()->zone(); Zone* zone = block()->zone();
if (!FLAG_use_allocation_folding || if (!FLAG_use_allocation_folding) return;
isolate()->heap_profiler()->is_tracking_allocations()) {
return;
}
// Try to fold allocations together with their dominating allocations. // Try to fold allocations together with their dominating allocations.
if (!dominator->IsAllocate()) { if (!dominator->IsAllocate()) {
......
...@@ -5300,7 +5300,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5300,7 +5300,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
PretenureFlag pretenure_flag, PretenureFlag pretenure_flag,
InstanceType instance_type) { InstanceType instance_type) {
return new(zone) HAllocate(context, size, type, pretenure_flag, return new(zone) HAllocate(context, size, type, pretenure_flag,
instance_type, zone); instance_type);
} }
// Maximum instance size for which allocations will be inlined. // Maximum instance size for which allocations will be inlined.
...@@ -5373,8 +5373,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5373,8 +5373,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
HValue* size, HValue* size,
HType type, HType type,
PretenureFlag pretenure_flag, PretenureFlag pretenure_flag,
InstanceType instance_type, InstanceType instance_type)
Zone* zone)
: HTemplateInstruction<2>(type), : HTemplateInstruction<2>(type),
dominating_allocate_(NULL), dominating_allocate_(NULL),
filler_free_space_size_(NULL), filler_free_space_size_(NULL),
...@@ -5397,8 +5396,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5397,8 +5396,7 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
// other, i.e., have a pointer to each other. A GC in between these // other, i.e., have a pointer to each other. A GC in between these
// allocations may leave such objects behind in a not completely initialized // allocations may leave such objects behind in a not completely initialized
// state. // state.
if (!FLAG_use_gvn || !FLAG_use_allocation_folding || if (!FLAG_use_gvn || !FLAG_use_allocation_folding) {
zone->isolate()->heap_profiler()->is_tracking_allocations()) {
flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER); flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER);
} }
clear_next_map_word_ = pretenure_flag == NOT_TENURED && clear_next_map_word_ = pretenure_flag == NOT_TENURED &&
......
...@@ -2072,23 +2072,3 @@ TEST(HeapObjectsTracker) { ...@@ -2072,23 +2072,3 @@ TEST(HeapObjectsTracker) {
" a.shift();\n" " a.shift();\n"
"findUntrackedObjects();\n"); "findUntrackedObjects();\n");
} }
// If we don't disable allocation folding when allocations tracking is on, we
// may have untracked allocations.
TEST(DisableAllocationFolding) {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
HeapObjectsTracker tracker;
CompileRun(
"function literal() {"
" return [1];"
"}"
"function modify_literal(literal, v) {"
" literal[0] = v;"
" return literal;"
"}"
"obj = modify_literal(literal(), 1);"
"obj = modify_literal(literal(), 1.5);"
"obj = modify_literal(literal(), 1);");
}
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