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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 | 2372 |
2373 TEST(CheckCodeNames) { | 2373 TEST(CheckCodeNames) { |
2374 LocalContext env; | 2374 LocalContext env; |
2375 v8::HandleScope scope(env->GetIsolate()); | 2375 v8::HandleScope scope(env->GetIsolate()); |
2376 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 2376 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
2377 CompileRun("var a = 1.1;"); | 2377 CompileRun("var a = 1.1;"); |
2378 const v8::HeapSnapshot* snapshot = | 2378 const v8::HeapSnapshot* snapshot = |
2379 heap_profiler->TakeHeapSnapshot(v8_str("CheckCodeNames")); | 2379 heap_profiler->TakeHeapSnapshot(v8_str("CheckCodeNames")); |
2380 CHECK(ValidateSnapshot(snapshot)); | 2380 CHECK(ValidateSnapshot(snapshot)); |
2381 | 2381 |
2382 const char* stub_path[] = { | 2382 const char* stub_path[] = {"::(GC roots)", "::(Strong roots)", "code_stubs::", |
2383 "::(GC roots)", | 2383 "::(CEntryStub code)"}; |
2384 "::(Strong roots)", | |
2385 "code_stubs::", | |
2386 "::(ArraySingleArgumentConstructorStub code)" | |
2387 }; | |
2388 const v8::HeapGraphNode* node = GetNodeByPath(snapshot, | 2384 const v8::HeapGraphNode* node = GetNodeByPath(snapshot, |
2389 stub_path, arraysize(stub_path)); | 2385 stub_path, arraysize(stub_path)); |
2390 CHECK(node); | 2386 CHECK(node); |
2391 | 2387 |
2392 const char* builtin_path1[] = {"::(GC roots)", "::(Builtins)", | 2388 const char* builtin_path1[] = {"::(GC roots)", "::(Builtins)", |
2393 "::(KeyedLoadIC_Megamorphic builtin)"}; | 2389 "::(KeyedLoadIC_Megamorphic builtin)"}; |
2394 node = GetNodeByPath(snapshot, builtin_path1, arraysize(builtin_path1)); | 2390 node = GetNodeByPath(snapshot, builtin_path1, arraysize(builtin_path1)); |
2395 CHECK(node); | 2391 CHECK(node); |
2396 | 2392 |
2397 const char* builtin_path2[] = {"::(GC roots)", "::(Builtins)", | 2393 const char* builtin_path2[] = {"::(GC roots)", "::(Builtins)", |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2829 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2825 map.AddRange(ToAddress(0x180), 0x80, 6U); |
2830 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2826 map.AddRange(ToAddress(0x180), 0x80, 7U); |
2831 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); | 2827 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); |
2832 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); | 2828 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); |
2833 CHECK_EQ(3u, map.size()); | 2829 CHECK_EQ(3u, map.size()); |
2834 | 2830 |
2835 map.Clear(); | 2831 map.Clear(); |
2836 CHECK_EQ(0u, map.size()); | 2832 CHECK_EQ(0u, map.size()); |
2837 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); | 2833 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); |
2838 } | 2834 } |
OLD | NEW |