Reviewers: Hannes Payer,
Message:
Hi Hannes, here is the issue we discussed,
--Michael
Description:
Repairs to FLAG_pretenure_call_new.
[email protected]
Please review this at https://codereview.chromium.org/307583002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -16 lines):
M src/objects.cc
M src/type-info.cc
M test/cctest/test-heap.cc
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
277d320588d04ccbdb92a715e6bdc147333beb85..cddb3577828b0d9c7c394371cb001772baddd391
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11217,14 +11217,7 @@ void SharedFunctionInfo::ClearTypeFeedbackInfo() {
// 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);
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index
ca3baa1215ff29afba9e3a11b7c628c3040e4b22..bf4ac788779f6b677bac0bb2c893c10082c22255
100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -133,14 +133,10 @@ KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode(
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);
}
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index
54ddff17500d67e2ff8e7fd542924856bc44da8c..34d8b9e7a4e0841342454e41e7ccca9f11684f63
100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2531,6 +2531,9 @@ TEST(OptimizedPretenuringConstructorCalls) {
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 @@ TEST(OptimizedPretenuringConstructorCalls) {
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -2573,9 +2577,12 @@ TEST(OptimizedPretenuringCallNew) {
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 @@ TEST(OptimizedPretenuringCallNew) {
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -3803,7 +3811,7 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
// 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.