Revision: 21553
Author: [email protected]
Date: Wed May 28 08:39:33 2014 UTC
Log: Repairs to FLAG_pretenure_call_new.
[email protected]
Review URL: https://codereview.chromium.org/307583002
http://code.google.com/p/v8/source/detail?r=21553
Modified:
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/type-info.cc
/branches/bleeding_edge/test/cctest/test-heap.cc
=======================================
--- /branches/bleeding_edge/src/objects.cc Tue May 27 14:55:29 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc Wed May 28 08:39:33 2014 UTC
@@ -11217,14 +11217,7 @@
// AllocationSites are not cleared because they do not store
// information that leaks.
break;
- case JS_FUNCTION_TYPE:
- // No need to clear the native context array function.
- if (obj == JSFunction::cast(obj)->context()->native_context()->
- get(Context::ARRAY_FUNCTION_INDEX)) {
- break;
- }
// Fall through...
-
default:
vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap),
SKIP_WRITE_BARRIER);
=======================================
--- /branches/bleeding_edge/src/type-info.cc Mon May 26 13:59:24 2014 UTC
+++ /branches/bleeding_edge/src/type-info.cc Wed May 28 08:39:33 2014 UTC
@@ -133,14 +133,10 @@
Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(int slot) {
Handle<Object> info = GetInfo(slot);
if (info->IsAllocationSite()) {
- ASSERT(!FLAG_pretenuring_call_new);
return
Handle<JSFunction>(isolate()->native_context()->array_function());
- } else {
- return Handle<JSFunction>::cast(info);
}
- ASSERT(info->IsAllocationSite());
- return Handle<JSFunction>(isolate()->native_context()->array_function());
+ return Handle<JSFunction>::cast(info);
}
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Wed May 28 06:42:01
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Wed May 28 08:39:33
2014 UTC
@@ -2531,6 +2531,9 @@
v8::HandleScope scope(CcTest::isolate());
i::ScopedVector<char> source(1024);
+ // Call new is doing slack tracking for the first
+ // JSFunction::kGenerousAllocationCount allocations, and we can't find
+ // mementos during that time.
i::OS::SNPrintF(
source,
"var number_elements = %d;"
@@ -2549,7 +2552,8 @@
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -2573,9 +2577,12 @@
v8::HandleScope scope(CcTest::isolate());
i::ScopedVector<char> source(1024);
+ // Call new is doing slack tracking for the first
+ // JSFunction::kGenerousAllocationCount allocations, and we can't find
+ // mementos during that time.
i::OS::SNPrintF(
source,
- "var number_elements = 100;"
+ "var number_elements = %d;"
"var elements = new Array(number_elements);"
"function g() { this.a = 0; }"
"function f() {"
@@ -2588,7 +2595,8 @@
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -3803,7 +3811,7 @@
// Now make sure that a gc should get rid of the function, even though we
// still have the allocation site alive.
for (int i = 0; i < 4; i++) {
- heap->CollectAllGarbage(false);
+ heap->CollectAllGarbage(Heap::kNoGCFlags);
}
// The site still exists because of our global handle, but the code is no
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.