Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: src/heap-snapshot-generator.cc

Issue 169393004: Fix heap snapshot crash when JSArrayBuffer has no backing_store. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 1457
1458 1458
1459 void V8HeapExplorer::ExtractJSArrayBufferReferences( 1459 void V8HeapExplorer::ExtractJSArrayBufferReferences(
1460 int entry, JSArrayBuffer* buffer) { 1460 int entry, JSArrayBuffer* buffer) {
1461 SetWeakReference(buffer, entry, "weak_next", buffer->weak_next(), 1461 SetWeakReference(buffer, entry, "weak_next", buffer->weak_next(),
1462 JSArrayBuffer::kWeakNextOffset); 1462 JSArrayBuffer::kWeakNextOffset);
1463 SetWeakReference(buffer, entry, 1463 SetWeakReference(buffer, entry,
1464 "weak_first_view", buffer->weak_first_view(), 1464 "weak_first_view", buffer->weak_first_view(),
1465 JSArrayBuffer::kWeakFirstViewOffset); 1465 JSArrayBuffer::kWeakFirstViewOffset);
1466 // Setup a reference to a native memory backing_store object. 1466 // Setup a reference to a native memory backing_store object.
1467 if (!buffer->backing_store())
1468 return;
1467 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length()); 1469 size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length());
1468 CHECK(data_size <= static_cast<size_t>(kMaxInt)); 1470 CHECK(data_size <= static_cast<size_t>(kMaxInt));
1469 HeapEntry* data_entry = AddEntry( 1471 HeapEntry* data_entry = AddEntry(
1470 static_cast<Address>(buffer->backing_store()), 1472 static_cast<Address>(buffer->backing_store()),
1471 HeapEntry::kNative, "system / ArrayBufferData", 1473 HeapEntry::kNative, "system / ArrayBufferData",
1472 static_cast<int>(data_size)); 1474 static_cast<int>(data_size));
1473 filler_->SetNamedReference(HeapGraphEdge::kInternal, 1475 filler_->SetNamedReference(HeapGraphEdge::kInternal,
1474 entry, "backing_store", data_entry); 1476 entry, "backing_store", data_entry);
1475 } 1477 }
1476 1478
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 writer_->AddString("\"<dummy>\""); 3023 writer_->AddString("\"<dummy>\"");
3022 for (int i = 1; i < sorted_strings.length(); ++i) { 3024 for (int i = 1; i < sorted_strings.length(); ++i) {
3023 writer_->AddCharacter(','); 3025 writer_->AddCharacter(',');
3024 SerializeString(sorted_strings[i]); 3026 SerializeString(sorted_strings[i]);
3025 if (writer_->aborted()) return; 3027 if (writer_->aborted()) return;
3026 } 3028 }
3027 } 3029 }
3028 3030
3029 3031
3030 } } // namespace v8::internal 3032 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698