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

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

Issue 700963002: Replace C++ bitfields with our own BitFields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed AST node field sizes; more scanner fixes; undid hydrogen.h/cc changes Created 6 years, 1 month 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 | « src/heap-snapshot-generator.h ('k') | src/heap-snapshot-generator-inl.h » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap-snapshot-generator-inl.h" 7 #include "src/heap-snapshot-generator-inl.h"
8 8
9 #include "src/allocation-tracker.h" 9 #include "src/allocation-tracker.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
11 #include "src/conversions.h" 11 #include "src/conversions.h"
12 #include "src/debug.h" 12 #include "src/debug.h"
13 #include "src/heap-profiler.h" 13 #include "src/heap-profiler.h"
14 #include "src/types.h" 14 #include "src/types.h"
15 15
16 namespace v8 { 16 namespace v8 {
17 namespace internal { 17 namespace internal {
18 18
19 19
20 HeapGraphEdge::HeapGraphEdge(Type type, const char* name, int from, int to) 20 HeapGraphEdge::HeapGraphEdge(Type type, const char* name, int from, int to)
21 : type_(type), 21 : bit_field_(TypeField::encode(type) | FromIndexField::encode(from)),
22 from_index_(from),
23 to_index_(to), 22 to_index_(to),
24 name_(name) { 23 name_(name) {
25 DCHECK(type == kContextVariable 24 DCHECK(type == kContextVariable
26 || type == kProperty 25 || type == kProperty
27 || type == kInternal 26 || type == kInternal
28 || type == kShortcut 27 || type == kShortcut
29 || type == kWeak); 28 || type == kWeak);
30 } 29 }
31 30
32 31
33 HeapGraphEdge::HeapGraphEdge(Type type, int index, int from, int to) 32 HeapGraphEdge::HeapGraphEdge(Type type, int index, int from, int to)
34 : type_(type), 33 : bit_field_(TypeField::encode(type) | FromIndexField::encode(from)),
35 from_index_(from),
36 to_index_(to), 34 to_index_(to),
37 index_(index) { 35 index_(index) {
38 DCHECK(type == kElement || type == kHidden); 36 DCHECK(type == kElement || type == kHidden);
39 } 37 }
40 38
41 39
42 void HeapGraphEdge::ReplaceToIndexWithEntry(HeapSnapshot* snapshot) { 40 void HeapGraphEdge::ReplaceToIndexWithEntry(HeapSnapshot* snapshot) {
43 to_entry_ = &snapshot->entries()[to_index_]; 41 to_entry_ = &snapshot->entries()[to_index_];
44 } 42 }
45 43
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 writer_->AddString("\"<dummy>\""); 3137 writer_->AddString("\"<dummy>\"");
3140 for (int i = 1; i < sorted_strings.length(); ++i) { 3138 for (int i = 1; i < sorted_strings.length(); ++i) {
3141 writer_->AddCharacter(','); 3139 writer_->AddCharacter(',');
3142 SerializeString(sorted_strings[i]); 3140 SerializeString(sorted_strings[i]);
3143 if (writer_->aborted()) return; 3141 if (writer_->aborted()) return;
3144 } 3142 }
3145 } 3143 }
3146 3144
3147 3145
3148 } } // namespace v8::internal 3146 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap-snapshot-generator.h ('k') | src/heap-snapshot-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698