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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 | 401 |
402 TEST(HeapSnapshotSlicedString) { | 402 TEST(HeapSnapshotSlicedString) { |
403 LocalContext env; | 403 LocalContext env; |
404 v8::HandleScope scope(env->GetIsolate()); | 404 v8::HandleScope scope(env->GetIsolate()); |
405 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 405 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
406 CompileRun( | 406 CompileRun( |
407 "parent_string = \"123456789.123456789.123456789.123456789.123456789." | 407 "parent_string = \"123456789.123456789.123456789.123456789.123456789." |
408 "123456789.123456789.123456789.123456789.123456789." | 408 "123456789.123456789.123456789.123456789.123456789." |
409 "123456789.123456789.123456789.123456789.123456789." | 409 "123456789.123456789.123456789.123456789.123456789." |
| 410 "123456789.123456789.123456789.123456789.123456789." |
| 411 "123456789.123456789.123456789.123456789.123456789." |
| 412 "123456789.123456789.123456789.123456789.123456789." |
| 413 "123456789.123456789.123456789.123456789.123456789." |
410 "123456789.123456789.123456789.123456789.123456789.\";" | 414 "123456789.123456789.123456789.123456789.123456789.\";" |
411 "child_string = parent_string.slice(100);"); | 415 "child_string = parent_string.slice(100);"); |
412 const v8::HeapSnapshot* snapshot = | 416 const v8::HeapSnapshot* snapshot = |
413 heap_profiler->TakeHeapSnapshot(v8_str("strings")); | 417 heap_profiler->TakeHeapSnapshot(v8_str("strings")); |
414 CHECK(ValidateSnapshot(snapshot)); | 418 CHECK(ValidateSnapshot(snapshot)); |
415 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); | 419 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
416 const v8::HeapGraphNode* parent_string = | 420 const v8::HeapGraphNode* parent_string = |
417 GetProperty(global, v8::HeapGraphEdge::kProperty, "parent_string"); | 421 GetProperty(global, v8::HeapGraphEdge::kProperty, "parent_string"); |
418 CHECK(parent_string); | 422 CHECK(parent_string); |
419 const v8::HeapGraphNode* child_string = | 423 const v8::HeapGraphNode* child_string = |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2825 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2829 map.AddRange(ToAddress(0x180), 0x80, 6U); |
2826 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2830 map.AddRange(ToAddress(0x180), 0x80, 7U); |
2827 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); | 2831 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); |
2828 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); | 2832 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); |
2829 CHECK_EQ(3u, map.size()); | 2833 CHECK_EQ(3u, map.size()); |
2830 | 2834 |
2831 map.Clear(); | 2835 map.Clear(); |
2832 CHECK_EQ(0u, map.size()); | 2836 CHECK_EQ(0u, map.size()); |
2833 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); | 2837 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); |
2834 } | 2838 } |
OLD | NEW |