v8
3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
|
#include <ctype.h>
#include "v8.h"
#include "cctest.h"
#include "hashmap.h"
#include "heap-profiler.h"
#include "snapshot.h"
#include "debug.h"
#include "utils-inl.h"
#include "../include/v8-profiler.h"
Go to the source code of this file.
Data Structures | |
class | GraphWithImplicitRefs |
Macros | |
#define | CHECK_EQ_SNAPSHOT_OBJECT_ID(a, b) CHECK_EQ(static_cast<int32_t>(a), static_cast<int32_t>(b)) |
#define | CHECK_NE_SNAPSHOT_OBJECT_ID(a, b) CHECK((a) != (b)) |
#define | STRING_LITERAL_FOR_TEST "\"String \\n\\r\\u0008\\u0081\\u0101\\u0801\\u8001\"" |
Functions | |
TEST (HeapSnapshot) | |
TEST (HeapSnapshotObjectSizes) | |
TEST (BoundFunctionInSnapshot) | |
TEST (HeapSnapshotEntryChildren) | |
TEST (HeapSnapshotCodeObjects) | |
TEST (HeapSnapshotHeapNumbers) | |
TEST (HeapSnapshotSlicedString) | |
TEST (HeapSnapshotInternalReferences) | |
TEST (HeapEntryIdsAndArrayShift) | |
TEST (HeapEntryIdsAndGC) | |
TEST (HeapSnapshotRootPreservedAfterSorting) | |
TEST (HeapSnapshotJSONSerialization) | |
TEST (HeapSnapshotJSONSerializationAborting) | |
TEST (HeapSnapshotObjectsStats) | |
TEST (HeapSnapshotGetNodeById) | |
TEST (HeapSnapshotGetSnapshotObjectId) | |
TEST (HeapSnapshotUnknownSnapshotObjectId) | |
TEST (TakeHeapSnapshotAborting) | |
TEST (HeapSnapshotRetainedObjectInfo) | |
TEST (HeapSnapshotImplicitReferences) | |
TEST (DeleteAllHeapSnapshots) | |
TEST (DeleteHeapSnapshot) | |
TEST (DocumentURL) | |
TEST (DocumentWithException) | |
TEST (DocumentURLWithException) | |
TEST (NoHandleLeaks) | |
TEST (NodesIteration) | |
TEST (GetHeapValue) | |
TEST (GetHeapValueForDeletedObject) | |
TEST (GetConstructorName) | |
TEST (FastCaseGetter) | |
TEST (HiddenPropertiesFastCase) | |
bool | HasWeakEdge (const v8::HeapGraphNode *node) |
bool | HasWeakGlobalHandle () |
TEST (WeakGlobalHandle) | |
TEST (WeakNativeContextRefs) | |
TEST (SfiAndJsFunctionWeakRefs) | |
TEST (PersistentHandleCount) | |
TEST (AllStrongGcRootsHaveNames) | |
TEST (NoRefsToNonEssentialEntries) | |
TEST (MapHasDescriptorsAndTransitions) | |
#define CHECK_EQ_SNAPSHOT_OBJECT_ID | ( | a, | |
b | |||
) | CHECK_EQ(static_cast<int32_t>(a), static_cast<int32_t>(b)) |
Definition at line 358 of file test-heap-profiler.cc.
Referenced by TEST().
#define CHECK_NE_SNAPSHOT_OBJECT_ID | ( | a, | |
b | |||
) | CHECK((a) != (b)) |
Definition at line 360 of file test-heap-profiler.cc.
Referenced by TEST().
#define STRING_LITERAL_FOR_TEST "\"String \\n\\r\\u0008\\u0081\\u0101\\u0801\\u8001\"" |
Referenced by TEST().
bool HasWeakEdge | ( | const v8::HeapGraphNode * | node | ) |
Definition at line 1483 of file test-heap-profiler.cc.
References HeapGraphNode::GetChild(), HeapGraphNode::GetChildrenCount(), HeapGraphEdge::GetType(), and HeapGraphEdge::kWeak.
Referenced by HasWeakGlobalHandle(), and TEST().
bool HasWeakGlobalHandle | ( | ) |
Definition at line 1492 of file test-heap-profiler.cc.
References CHECK_NE, HeapSnapshot::GetRoot(), HasWeakEdge(), HeapGraphNode::kObject, NULL, and HeapProfiler::TakeSnapshot().
Referenced by TEST().
TEST | ( | HeapSnapshot | ) |
Definition at line 104 of file test-heap-profiler.cc.
References CHECK, CHECK_NE, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotObjectSizes | ) |
Definition at line 138 of file test-heap-profiler.cc.
References CHECK_NE, HeapGraphNode::GetSelfSize(), HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | BoundFunctionInSnapshot | ) |
Definition at line 169 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, HeapGraphNode::GetName(), HeapGraphNode::kArray, HeapGraphNode::kClosure, HeapGraphEdge::kInternal, HeapGraphNode::kObject, HeapGraphEdge::kProperty, HeapGraphEdge::kShortcut, String::New(), NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotEntryChildren | ) |
Definition at line 206 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapGraphNode::GetChild(), HeapGraphNode::GetChildrenCount(), HeapGraphEdge::GetFromNode(), HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotCodeObjects | ) |
Definition at line 230 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, HeapGraphNode::GetChild(), HeapGraphNode::GetChildrenCount(), HeapGraphEdge::GetToNode(), HeapGraphNode::GetType(), HeapGraphNode::kArray, HeapGraphNode::kClosure, HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotHeapNumbers | ) |
Definition at line 295 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapGraphNode::GetType(), HeapGraphNode::kHeapNumber, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotSlicedString | ) |
Definition at line 311 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotInternalReferences | ) |
Definition at line 334 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, Object::GetPrototype(), Context::Global(), Object::InternalFieldCount(), HeapGraphEdge::kInternal, Object::New(), ObjectTemplate::New(), NULL, Object::SetInternalField(), ObjectTemplate::SetInternalFieldCount(), and HeapProfiler::TakeSnapshot().
TEST | ( | HeapEntryIdsAndArrayShift | ) |
Definition at line 363 of file test-heap-profiler.cc.
References CHECK_EQ_SNAPSHOT_OBJECT_ID, CHECK_NE, CHECK_NE_SNAPSHOT_OBJECT_ID, HeapGraphNode::GetId(), HEAP, HeapGraphEdge::kInternal, Heap::kNoGCFlags, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapEntryIdsAndGC | ) |
Definition at line 409 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ_SNAPSHOT_OBJECT_ID, CHECK_GT, CHECK_NE, CHECK_NE_SNAPSHOT_OBJECT_ID, HeapGraphNode::GetId(), HeapSnapshot::GetMaxSnapshotJSObjectId(), HEAP, Heap::kNoGCFlags, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotRootPreservedAfterSorting | ) |
Definition at line 471 of file test-heap-profiler.cc.
References CHECK_EQ, HeapSnapshot::GetRoot(), HeapSnapshot::GetSortedEntriesList(), snapshot(), and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotJSONSerialization | ) |
Definition at line 529 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_GT, Object::Get(), Context::Global(), Handle< T >::IsEmpty(), HeapSnapshot::kJSON, String::NewExternal(), HeapSnapshot::Serialize(), STRING_LITERAL_FOR_TEST, HeapProfiler::TakeSnapshot(), and Value::ToNumber().
TEST | ( | HeapSnapshotJSONSerializationAborting | ) |
Definition at line 631 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_GT, HeapSnapshot::kJSON, HeapSnapshot::Serialize(), and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotObjectsStats | ) |
Definition at line 712 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_EQ_SNAPSHOT_OBJECT_ID, CHECK_GT, CHECK_LT, HEAP, Heap::kNoGCFlags, Array::Length(), Object::New(), Object::Set(), HeapProfiler::StartHeapObjectsTracking(), and HeapProfiler::StopHeapObjectsTracking().
TEST | ( | HeapSnapshotGetNodeById | ) |
Definition at line 865 of file test-heap-profiler.cc.
References CHECK_EQ, HeapSnapshot::GetNodeById(), HeapSnapshot::GetRoot(), NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotGetSnapshotObjectId | ) |
Definition at line 878 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, HeapGraphNode::GetId(), HeapProfiler::GetSnapshotObjectId(), Context::Global(), Handle< T >::IsEmpty(), Value::IsObject(), HeapGraphEdge::kProperty, HeapProfiler::kUnknownObjectId, String::New(), and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotUnknownSnapshotObjectId | ) |
Definition at line 902 of file test-heap-profiler.cc.
References CHECK_EQ, HeapSnapshot::GetNodeById(), HeapProfiler::kUnknownObjectId, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | TakeHeapSnapshotAborting | ) |
Definition at line 935 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_GT, CHECK_NE, HeapProfiler::GetSnapshotsCount(), HeapSnapshot::kFull, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotRetainedObjectInfo | ) |
Definition at line 1046 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, HeapProfiler::DefineWrapperClass(), HeapGraphNode::GetChildrenCount(), HeapSnapshot::GetRoot(), HeapGraphEdge::kInternal, HeapGraphNode::kNative, HeapGraphNode::kString, HeapGraphNode::kSynthetic, Persistent< T >::New(), NULL, Persistent< T >::SetWrapperClassId(), and HeapProfiler::TakeSnapshot().
TEST | ( | HeapSnapshotImplicitReferences | ) |
Definition at line 1141 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, GraphWithImplicitRefs::gcPrologue(), HeapGraphEdge::GetName(), HeapGraphEdge::GetType(), HeapGraphNode::GetType(), HeapGraphEdge::kInternal, HeapGraphNode::kObject, HeapGraphEdge::kProperty, NULL, V8::SetGlobalGCPrologueCallback(), and HeapProfiler::TakeSnapshot().
TEST | ( | DeleteAllHeapSnapshots | ) |
Definition at line 1173 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapProfiler::DeleteAllSnapshots(), HeapProfiler::GetSnapshotsCount(), NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | DeleteHeapSnapshot | ) |
Definition at line 1192 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapProfiler::FindSnapshot(), HeapProfiler::GetSnapshotsCount(), HeapSnapshot::GetUid(), NULL, v8::internal::s1, v8::internal::s2, v8::internal::s3, and HeapProfiler::TakeSnapshot().
TEST | ( | DocumentURL | ) |
Definition at line 1231 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | DocumentWithException | ) |
Definition at line 1247 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | DocumentURLWithException | ) |
Definition at line 1263 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | NoHandleLeaks | ) |
Definition at line 1281 of file test-heap-profiler.cc.
References CHECK_EQ, HandleScope::NumberOfHandles(), and HeapProfiler::TakeSnapshot().
TEST | ( | NodesIteration | ) |
Definition at line 1295 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapSnapshot::GetNode(), HeapSnapshot::GetNodesCount(), NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | GetHeapValue | ) |
Definition at line 1313 of file test-heap-profiler.cc.
References Local< T >::As(), CHECK, HeapGraphNode::GetHeapValue(), Context::Global(), Value::IsObject(), HeapGraphEdge::kProperty, and HeapProfiler::TakeSnapshot().
TEST | ( | GetHeapValueForDeletedObject | ) |
Definition at line 1343 of file test-heap-profiler.cc.
References CHECK, HeapGraphNode::GetHeapValue(), Value::IsObject(), Value::IsUndefined(), HeapGraphEdge::kProperty, and HeapProfiler::TakeSnapshot().
TEST | ( | GetConstructorName | ) |
Definition at line 1378 of file test-heap-profiler.cc.
References Local< T >::As(), CHECK_EQ, Object::Get(), V8HeapExplorer::GetConstructorName(), and Context::Global().
TEST | ( | FastCaseGetter | ) |
Definition at line 1425 of file test-heap-profiler.cc.
References CHECK_NE, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | HiddenPropertiesFastCase | ) |
Definition at line 1452 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, Context::Global(), Handle< T >::IsEmpty(), Value::IsObject(), HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, String::New(), NULL, HeapProfiler::TakeSnapshot(), and Value::ToObject().
TEST | ( | WeakGlobalHandle | ) |
Definition at line 1510 of file test-heap-profiler.cc.
References CHECK, HasWeakGlobalHandle(), Persistent< T >::MakeWeak(), Persistent< T >::New(), Object::New(), and NULL.
TEST | ( | WeakNativeContextRefs | ) |
Definition at line 1524 of file test-heap-profiler.cc.
References CHECK, CHECK_NE, HeapSnapshot::GetRoot(), HasWeakEdge(), HeapGraphNode::kHidden, HeapGraphNode::kObject, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | SfiAndJsFunctionWeakRefs | ) |
Definition at line 1543 of file test-heap-profiler.cc.
References CHECK, CHECK_NE, HasWeakEdge(), HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | PersistentHandleCount | ) |
Definition at line 1588 of file test-heap-profiler.cc.
References CHECK_EQ, Persistent< T >::Dispose(), HeapProfiler::GetPersistentHandleCount(), and Persistent< T >::New().
TEST | ( | AllStrongGcRootsHaveNames | ) |
Definition at line 1622 of file test-heap-profiler.cc.
References CHECK, CHECK_EQ, CHECK_NE, HeapGraphNode::GetChild(), HeapGraphNode::GetChildrenCount(), HeapGraphEdge::GetName(), HeapSnapshot::GetRoot(), HeapGraphEdge::GetType(), HeapGraphEdge::kInternal, HeapGraphNode::kObject, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | NoRefsToNonEssentialEntries | ) |
Definition at line 1644 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().
TEST | ( | MapHasDescriptorsAndTransitions | ) |
Definition at line 1663 of file test-heap-profiler.cc.
References CHECK_EQ, CHECK_NE, HeapGraphEdge::kInternal, HeapGraphEdge::kProperty, NULL, and HeapProfiler::TakeSnapshot().