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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 CHECK_EQ("", *anonymous_name); | 337 CHECK_EQ("", *anonymous_name); |
338 | 338 |
339 // Find references to code. | 339 // Find references to code. |
340 const v8::HeapGraphNode* compiled_code = | 340 const v8::HeapGraphNode* compiled_code = |
341 GetProperty(compiled, v8::HeapGraphEdge::kInternal, "shared"); | 341 GetProperty(compiled, v8::HeapGraphEdge::kInternal, "shared"); |
342 CHECK_NE(NULL, compiled_code); | 342 CHECK_NE(NULL, compiled_code); |
343 const v8::HeapGraphNode* lazy_code = | 343 const v8::HeapGraphNode* lazy_code = |
344 GetProperty(lazy, v8::HeapGraphEdge::kInternal, "shared"); | 344 GetProperty(lazy, v8::HeapGraphEdge::kInternal, "shared"); |
345 CHECK_NE(NULL, lazy_code); | 345 CHECK_NE(NULL, lazy_code); |
346 | 346 |
347 // Check that there's no strong next_code_link. There might be a weak one | |
348 // but might be not, so we can't check that fact. | |
349 const v8::HeapGraphNode* code = | |
350 GetProperty(compiled_code, v8::HeapGraphEdge::kInternal, "code"); | |
yurys
2014/01/27 15:50:57
Can we force presence of the weak link in the test
alph
2014/01/29 13:41:33
I'm not sure how to do that. Once I find a way, I'
| |
351 CHECK_NE(NULL, code); | |
352 const v8::HeapGraphNode* next_code_link = | |
353 GetProperty(code, v8::HeapGraphEdge::kInternal, "code"); | |
354 CHECK_EQ(NULL, next_code_link); | |
355 | |
347 // Verify that non-compiled code doesn't contain references to "x" | 356 // Verify that non-compiled code doesn't contain references to "x" |
348 // literal, while compiled code does. The scope info is stored in FixedArray | 357 // literal, while compiled code does. The scope info is stored in FixedArray |
349 // objects attached to the SharedFunctionInfo. | 358 // objects attached to the SharedFunctionInfo. |
350 bool compiled_references_x = false, lazy_references_x = false; | 359 bool compiled_references_x = false, lazy_references_x = false; |
351 for (int i = 0, count = compiled_code->GetChildrenCount(); i < count; ++i) { | 360 for (int i = 0, count = compiled_code->GetChildrenCount(); i < count; ++i) { |
352 const v8::HeapGraphEdge* prop = compiled_code->GetChild(i); | 361 const v8::HeapGraphEdge* prop = compiled_code->GetChild(i); |
353 const v8::HeapGraphNode* node = prop->GetToNode(); | 362 const v8::HeapGraphNode* node = prop->GetToNode(); |
354 if (node->GetType() == v8::HeapGraphNode::kArray) { | 363 if (node->GetType() == v8::HeapGraphNode::kArray) { |
355 if (HasString(node, "x")) { | 364 if (HasString(node, "x")) { |
356 compiled_references_x = true; | 365 compiled_references_x = true; |
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2333 const v8::HeapGraphNode* arr1_obj = | 2342 const v8::HeapGraphNode* arr1_obj = |
2334 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); | 2343 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); |
2335 CHECK_NE(NULL, arr1_obj); | 2344 CHECK_NE(NULL, arr1_obj); |
2336 const v8::HeapGraphNode* arr1_buffer = | 2345 const v8::HeapGraphNode* arr1_buffer = |
2337 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); | 2346 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); |
2338 CHECK_NE(NULL, arr1_buffer); | 2347 CHECK_NE(NULL, arr1_buffer); |
2339 const v8::HeapGraphNode* first_view = | 2348 const v8::HeapGraphNode* first_view = |
2340 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "weak_first_view"); | 2349 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "weak_first_view"); |
2341 CHECK_NE(NULL, first_view); | 2350 CHECK_NE(NULL, first_view); |
2342 } | 2351 } |
OLD | NEW |