OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests for heap profiler | 3 // Tests for heap profiler |
4 | 4 |
5 #include <ctype.h> | 5 #include <ctype.h> |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 | 8 |
9 #include "cctest.h" | 9 #include "cctest.h" |
10 #include "hashmap.h" | 10 #include "hashmap.h" |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); | 1461 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
1462 const v8::HeapGraphNode* c = | 1462 const v8::HeapGraphNode* c = |
1463 GetProperty(global, v8::HeapGraphEdge::kProperty, "c"); | 1463 GetProperty(global, v8::HeapGraphEdge::kProperty, "c"); |
1464 CHECK_NE(NULL, c); | 1464 CHECK_NE(NULL, c); |
1465 const v8::HeapGraphNode* hidden_props = | 1465 const v8::HeapGraphNode* hidden_props = |
1466 GetProperty(c, v8::HeapGraphEdge::kInternal, "hidden_properties"); | 1466 GetProperty(c, v8::HeapGraphEdge::kInternal, "hidden_properties"); |
1467 CHECK_EQ(NULL, hidden_props); | 1467 CHECK_EQ(NULL, hidden_props); |
1468 | 1468 |
1469 v8::Handle<v8::Value> cHandle = env->Global()->Get(v8::String::New("c")); | 1469 v8::Handle<v8::Value> cHandle = env->Global()->Get(v8::String::New("c")); |
1470 CHECK(!cHandle.IsEmpty() && cHandle->IsObject()); | 1470 CHECK(!cHandle.IsEmpty() && cHandle->IsObject()); |
1471 cHandle->ToObject()->GetIdentityHash(); | 1471 cHandle->ToObject()->SetHiddenValue(v8_str("key"), v8_str("val")); |
1472 | 1472 |
1473 snapshot = v8::HeapProfiler::TakeSnapshot( | 1473 snapshot = v8::HeapProfiler::TakeSnapshot( |
1474 v8_str("HiddenPropertiesFastCase2")); | 1474 v8_str("HiddenPropertiesFastCase2")); |
1475 global = GetGlobalObject(snapshot); | 1475 global = GetGlobalObject(snapshot); |
1476 c = GetProperty(global, v8::HeapGraphEdge::kProperty, "c"); | 1476 c = GetProperty(global, v8::HeapGraphEdge::kProperty, "c"); |
1477 CHECK_NE(NULL, c); | 1477 CHECK_NE(NULL, c); |
1478 hidden_props = GetProperty(c, v8::HeapGraphEdge::kInternal, | 1478 hidden_props = GetProperty(c, v8::HeapGraphEdge::kInternal, |
1479 "hidden_properties"); | 1479 "hidden_properties"); |
1480 CHECK_NE(NULL, hidden_props); | 1480 CHECK_NE(NULL, hidden_props); |
1481 } | 1481 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 const v8::HeapGraphNode* global_object = | 1651 const v8::HeapGraphNode* global_object = |
1652 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); | 1652 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); |
1653 CHECK_NE(NULL, global_object); | 1653 CHECK_NE(NULL, global_object); |
1654 const v8::HeapGraphNode* properties = | 1654 const v8::HeapGraphNode* properties = |
1655 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); | 1655 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); |
1656 CHECK_EQ(NULL, properties); | 1656 CHECK_EQ(NULL, properties); |
1657 const v8::HeapGraphNode* elements = | 1657 const v8::HeapGraphNode* elements = |
1658 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); | 1658 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); |
1659 CHECK_EQ(NULL, elements); | 1659 CHECK_EQ(NULL, elements); |
1660 } | 1660 } |
OLD | NEW |