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

Unified Diff: src/objects-visiting-inl.h

Issue 17153011: DataView implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-visiting.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-visiting-inl.h
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h
index 6c3c9d44fe318d77c141a68dc6d562d86563aceb..46ca0b10ca6219d9b49e8fe08d20241cad400087 100644
--- a/src/objects-visiting-inl.h
+++ b/src/objects-visiting-inl.h
@@ -83,6 +83,8 @@ void StaticNewSpaceVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
+ table_.Register(kVisitJSDataView, &VisitJSDataView);
+
table_.Register(kVisitFreeSpace, &VisitFreeSpace);
table_.Register(kVisitJSWeakMap, &JSObjectVisitor::Visit);
@@ -108,7 +110,7 @@ int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
Heap* heap = map->GetHeap();
STATIC_ASSERT(
- JSArrayBuffer::kWeakFirstArrayOffset ==
+ JSArrayBuffer::kWeakFirstViewOffset ==
JSArrayBuffer::kWeakNextOffset + kPointerSize);
VisitPointers(
heap,
@@ -140,6 +142,22 @@ int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
template<typename StaticVisitor>
+int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView(
+ Map* map, HeapObject* object) {
+ VisitPointers(
+ map->GetHeap(),
+ HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset),
+ HeapObject::RawField(object, JSDataView::kWeakNextOffset));
+ VisitPointers(
+ map->GetHeap(),
+ HeapObject::RawField(object,
+ JSDataView::kWeakNextOffset + kPointerSize),
+ HeapObject::RawField(object, JSDataView::kSize));
+ return JSDataView::kSize;
+}
+
+
+template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitShortcutCandidate,
&FixedBodyVisitor<StaticVisitor,
@@ -194,6 +212,8 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
+ table_.Register(kVisitJSDataView, &VisitJSDataView);
+
// Registration for kVisitJSRegExp is done by StaticVisitor.
table_.Register(kVisitCell,
@@ -456,7 +476,7 @@ void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
Heap* heap = map->GetHeap();
STATIC_ASSERT(
- JSArrayBuffer::kWeakFirstArrayOffset ==
+ JSArrayBuffer::kWeakFirstViewOffset ==
JSArrayBuffer::kWeakNextOffset + kPointerSize);
StaticVisitor::VisitPointers(
heap,
@@ -486,6 +506,21 @@ void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
template<typename StaticVisitor>
+void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(
+ Map* map, HeapObject* object) {
+ StaticVisitor::VisitPointers(
+ map->GetHeap(),
+ HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset),
+ HeapObject::RawField(object, JSDataView::kWeakNextOffset));
+ StaticVisitor::VisitPointers(
+ map->GetHeap(),
+ HeapObject::RawField(object,
+ JSDataView::kWeakNextOffset + kPointerSize),
+ HeapObject::RawField(object, JSDataView::kSize));
+}
+
+
+template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(
Heap* heap, Map* map) {
// Make sure that the back pointer stored either in the map itself or
« no previous file with comments | « src/objects-visiting.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698