Commit b711c318 authored by ishell's avatar ishell Committed by Commit bot

Allow in-object properties in JSTypedArray and JSDataView.

This CL also removes JSTypedArray and JSDataView static visitor Ids because the visiting logic is the same as for ordinary JSObject.

BUG=v8:4531
LOG=Y

Review URL: https://codereview.chromium.org/1476753003

Cr-Commit-Position: refs/heads/master@{#32317}
parent a336404f
......@@ -72,10 +72,6 @@ void StaticNewSpaceVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
table_.Register(kVisitJSDataView, &VisitJSDataView);
table_.Register(kVisitFreeSpace, &VisitFreeSpace);
table_.Register(kVisitJSWeakCollection, &JSObjectVisitor::Visit);
......@@ -106,28 +102,6 @@ int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
}
template <typename StaticVisitor>
int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
Map* map, HeapObject* object) {
VisitPointers(
map->GetHeap(), object,
HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields));
return JSTypedArray::kSizeWithInternalFields;
}
template <typename StaticVisitor>
int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView(Map* map,
HeapObject* object) {
VisitPointers(
map->GetHeap(), object,
HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset),
HeapObject::RawField(object, JSDataView::kSizeWithInternalFields));
return JSDataView::kSizeWithInternalFields;
}
template <typename StaticVisitor>
int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray(
Map* map, HeapObject* object) {
......@@ -195,10 +169,6 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
table_.Register(kVisitJSDataView, &VisitJSDataView);
// Registration for kVisitJSRegExp is done by StaticVisitor.
table_.Register(
......@@ -538,24 +508,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
}
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
Map* map, HeapObject* object) {
typedef FlexibleBodyVisitor<StaticVisitor, JSTypedArray::BodyDescriptor, void>
JSTypedArrayBodyVisitor;
JSTypedArrayBodyVisitor::Visit(map, object);
}
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(Map* map,
HeapObject* object) {
typedef FlexibleBodyVisitor<StaticVisitor, JSDataView::BodyDescriptor, void>
JSDataViewBodyVisitor;
JSDataViewBodyVisitor::Visit(map, object);
}
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray(
Map* map, HeapObject* object) {
......
......@@ -100,12 +100,6 @@ StaticVisitorBase::VisitorId StaticVisitorBase::GetVisitorId(
case JS_ARRAY_BUFFER_TYPE:
return kVisitJSArrayBuffer;
case JS_TYPED_ARRAY_TYPE:
return kVisitJSTypedArray;
case JS_DATA_VIEW_TYPE:
return kVisitJSDataView;
case JS_OBJECT_TYPE:
case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
case JS_GENERATOR_OBJECT_TYPE:
......@@ -116,6 +110,8 @@ StaticVisitorBase::VisitorId StaticVisitorBase::GetVisitorId(
case JS_GLOBAL_PROXY_TYPE:
case JS_GLOBAL_OBJECT_TYPE:
case JS_MESSAGE_OBJECT_TYPE:
case JS_TYPED_ARRAY_TYPE:
case JS_DATA_VIEW_TYPE:
case JS_SET_TYPE:
case JS_MAP_TYPE:
case JS_SET_ITERATOR_TYPE:
......
......@@ -80,8 +80,6 @@ class StaticVisitorBase : public AllStatic {
V(JSFunction) \
V(JSWeakCollection) \
V(JSArrayBuffer) \
V(JSTypedArray) \
V(JSDataView) \
V(JSRegExp)
// For data objects, JS objects and structs along with generic visitor which
......@@ -293,8 +291,6 @@ class StaticNewSpaceVisitor : public StaticVisitorBase {
}
INLINE(static int VisitJSArrayBuffer(Map* map, HeapObject* object));
INLINE(static int VisitJSTypedArray(Map* map, HeapObject* object));
INLINE(static int VisitJSDataView(Map* map, HeapObject* object));
INLINE(static int VisitBytecodeArray(Map* map, HeapObject* object));
class DataObjectVisitor {
......@@ -373,8 +369,6 @@ class StaticMarkingVisitor : public StaticVisitorBase {
INLINE(static void VisitJSFunction(Map* map, HeapObject* object));
INLINE(static void VisitJSRegExp(Map* map, HeapObject* object));
INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object));
INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object));
INLINE(static void VisitJSDataView(Map* map, HeapObject* object));
INLINE(static void VisitNativeContext(Map* map, HeapObject* object));
INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object));
......
......@@ -67,12 +67,6 @@ class ScavengingVisitor : public StaticVisitorBase {
table_.Register(kVisitJSWeakCollection,
&ObjectEvacuationStrategy<POINTER_OBJECT>::Visit);
table_.Register(kVisitJSTypedArray,
&ObjectEvacuationStrategy<POINTER_OBJECT>::Visit);
table_.Register(kVisitJSDataView,
&ObjectEvacuationStrategy<POINTER_OBJECT>::Visit);
table_.Register(kVisitJSRegExp,
&ObjectEvacuationStrategy<POINTER_OBJECT>::Visit);
......
......@@ -12051,6 +12051,8 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_DATE_TYPE:
case JS_ARRAY_TYPE:
case JS_MESSAGE_OBJECT_TYPE:
case JS_TYPED_ARRAY_TYPE:
case JS_DATA_VIEW_TYPE:
case JS_SET_TYPE:
case JS_MAP_TYPE:
case JS_SET_ITERATOR_TYPE:
......@@ -12063,8 +12065,6 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_FUNCTION_TYPE:
return true;
case JS_TYPED_ARRAY_TYPE:
case JS_DATA_VIEW_TYPE:
case JS_PROXY_TYPE:
case JS_FUNCTION_PROXY_TYPE:
case JS_ARRAY_BUFFER_TYPE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment