Fix heap snapshot creation for Harmony collections.

R=yangguo@chromium.org
BUG=v8:2535
TEST=cctest/test-api/Regress2535

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13897 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2013-03-11 11:31:53 +00:00
parent 3e6ffe7362
commit bbc9f5362a
2 changed files with 17 additions and 0 deletions

View File

@ -1563,6 +1563,10 @@ int JSObject::GetHeaderSize() {
return JSDate::kSize;
case JS_ARRAY_TYPE:
return JSArray::kSize;
case JS_SET_TYPE:
return JSSet::kSize;
case JS_MAP_TYPE:
return JSMap::kSize;
case JS_WEAK_MAP_TYPE:
return JSWeakMap::kSize;
case JS_REGEXP_TYPE:

View File

@ -18257,6 +18257,19 @@ THREADED_TEST(Regress157124) {
}
THREADED_TEST(Regress2535) {
i::FLAG_harmony_collections = true;
v8::HandleScope scope;
LocalContext context;
Local<Value> set_value = CompileRun("new Set();");
Local<Object> set_object(Object::Cast(*set_value));
CHECK_EQ(0, set_object->InternalFieldCount());
Local<Value> map_value = CompileRun("new Map();");
Local<Object> map_object(Object::Cast(*map_value));
CHECK_EQ(0, map_object->InternalFieldCount());
}
#ifndef WIN32
class ThreadInterruptTest {
public: