| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 const v8::HeapGraphEdge* prop = lazy_code->GetChild(i); | 360 const v8::HeapGraphEdge* prop = lazy_code->GetChild(i); |
| 361 const v8::HeapGraphNode* node = prop->GetToNode(); | 361 const v8::HeapGraphNode* node = prop->GetToNode(); |
| 362 if (node->GetType() == v8::HeapGraphNode::kArray) { | 362 if (node->GetType() == v8::HeapGraphNode::kArray) { |
| 363 if (HasString(node, "x")) { | 363 if (HasString(node, "x")) { |
| 364 lazy_references_x = true; | 364 lazy_references_x = true; |
| 365 break; | 365 break; |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 CHECK(compiled_references_x); | 369 CHECK(compiled_references_x); |
| 370 CHECK(!lazy_references_x); | 370 if (i::FLAG_lazy && !(i::FLAG_ignition && i::FLAG_ignition_eager)) { |
| 371 CHECK(!lazy_references_x); |
| 372 } |
| 371 } | 373 } |
| 372 | 374 |
| 373 | 375 |
| 374 TEST(HeapSnapshotHeapNumbers) { | 376 TEST(HeapSnapshotHeapNumbers) { |
| 375 LocalContext env; | 377 LocalContext env; |
| 376 v8::HandleScope scope(env->GetIsolate()); | 378 v8::HandleScope scope(env->GetIsolate()); |
| 377 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 379 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
| 378 CompileRun( | 380 CompileRun( |
| 379 "a = 1; // a is Smi\n" | 381 "a = 1; // a is Smi\n" |
| 380 "b = 2.5; // b is HeapNumber"); | 382 "b = 2.5; // b is HeapNumber"); |
| (...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3004 v8::base::SmartPointer<v8::AllocationProfile> profile( | 3006 v8::base::SmartPointer<v8::AllocationProfile> profile( |
| 3005 heap_profiler->GetAllocationProfile()); | 3007 heap_profiler->GetAllocationProfile()); |
| 3006 CHECK(!profile.is_empty()); | 3008 CHECK(!profile.is_empty()); |
| 3007 const char* names[] = {"(V8 API)"}; | 3009 const char* names[] = {"(V8 API)"}; |
| 3008 auto node = FindAllocationProfileNode( | 3010 auto node = FindAllocationProfileNode( |
| 3009 *profile, Vector<const char*>(names, arraysize(names))); | 3011 *profile, Vector<const char*>(names, arraysize(names))); |
| 3010 CHECK(node); | 3012 CHECK(node); |
| 3011 | 3013 |
| 3012 heap_profiler->StopSamplingHeapProfiler(); | 3014 heap_profiler->StopSamplingHeapProfiler(); |
| 3013 } | 3015 } |
| OLD | NEW |