| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 465 |
| 466 const v8::HeapGraphNode* second_node = | 466 const v8::HeapGraphNode* second_node = |
| 467 GetProperty(string_node, v8::HeapGraphEdge::kInternal, "second"); | 467 GetProperty(string_node, v8::HeapGraphEdge::kInternal, "second"); |
| 468 CHECK_EQ(v8::HeapGraphNode::kString, second_node->GetType()); | 468 CHECK_EQ(v8::HeapGraphNode::kString, second_node->GetType()); |
| 469 | 469 |
| 470 heap_profiler->DeleteAllHeapSnapshots(); | 470 heap_profiler->DeleteAllHeapSnapshots(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 | 473 |
| 474 TEST(HeapSnapshotSymbol) { | 474 TEST(HeapSnapshotSymbol) { |
| 475 i::FLAG_harmony_symbols = true; | |
| 476 | |
| 477 LocalContext env; | 475 LocalContext env; |
| 478 v8::HandleScope scope(env->GetIsolate()); | 476 v8::HandleScope scope(env->GetIsolate()); |
| 479 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 477 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
| 480 | 478 |
| 481 CompileRun("a = Symbol('mySymbol');\n"); | 479 CompileRun("a = Symbol('mySymbol');\n"); |
| 482 const v8::HeapSnapshot* snapshot = | 480 const v8::HeapSnapshot* snapshot = |
| 483 heap_profiler->TakeHeapSnapshot(v8_str("Symbol")); | 481 heap_profiler->TakeHeapSnapshot(v8_str("Symbol")); |
| 484 CHECK(ValidateSnapshot(snapshot)); | 482 CHECK(ValidateSnapshot(snapshot)); |
| 485 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); | 483 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
| 486 const v8::HeapGraphNode* a = | 484 const v8::HeapGraphNode* a = |
| (...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2761 map.AddRange(ToAddress(0x180), 0x80, 6U); |
| 2764 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2762 map.AddRange(ToAddress(0x180), 0x80, 7U); |
| 2765 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); | 2763 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); |
| 2766 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); | 2764 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); |
| 2767 CHECK_EQ(3, static_cast<int>(map.size())); | 2765 CHECK_EQ(3, static_cast<int>(map.size())); |
| 2768 | 2766 |
| 2769 map.Clear(); | 2767 map.Clear(); |
| 2770 CHECK_EQ(0, static_cast<int>(map.size())); | 2768 CHECK_EQ(0, static_cast<int>(map.size())); |
| 2771 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); | 2769 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); |
| 2772 } | 2770 } |
| OLD | NEW |