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
parent 3e6ffe73
......@@ -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:
......
......@@ -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:
......
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