Commit d5be67a5 authored by Z Duong Nguyen-Huu's avatar Z Duong Nguyen-Huu Committed by Commit Bot

Torquefy Oddball, PropertyArray

Bug: v8:8952
Change-Id: I07b3491e644634f9712e89d1566718084a3686d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1518812Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60307}
parent a402686e
...@@ -60,7 +60,13 @@ type Code extends AbstractCode generates 'TNode<Code>'; ...@@ -60,7 +60,13 @@ type Code extends AbstractCode generates 'TNode<Code>';
type BuiltinPtr extends Smi generates 'TNode<BuiltinPtr>'; type BuiltinPtr extends Smi generates 'TNode<BuiltinPtr>';
type Context extends HeapObject generates 'TNode<Context>'; type Context extends HeapObject generates 'TNode<Context>';
type NativeContext extends Context; type NativeContext extends Context;
type Oddball extends HeapObject generates 'TNode<Oddball>'; extern class Oddball extends HeapObject {
to_number_raw: float64;
to_string: String;
to_number: Number;
type_of: String;
kind: Smi;
}
type HeapNumber extends HeapObject generates 'TNode<HeapNumber>'; type HeapNumber extends HeapObject generates 'TNode<HeapNumber>';
type Number = Smi | HeapNumber; type Number = Smi | HeapNumber;
type BigInt extends HeapObject generates 'TNode<BigInt>'; type BigInt extends HeapObject generates 'TNode<BigInt>';
...@@ -456,6 +462,8 @@ extern class ObjectTemplateInfo extends TemplateInfo { ...@@ -456,6 +462,8 @@ extern class ObjectTemplateInfo extends TemplateInfo {
data: Object; data: Object;
} }
extern class PropertyArray extends HeapObject { length_and_hash: Smi; }
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>'; type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType'; type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';
......
...@@ -737,6 +737,7 @@ void PropertyArray::PropertyArrayVerify(Isolate* isolate) { ...@@ -737,6 +737,7 @@ void PropertyArray::PropertyArrayVerify(Isolate* isolate) {
Object e = get(i); Object e = get(i);
Object::VerifyPointer(isolate, e); Object::VerifyPointer(isolate, e);
} }
VerifySmiField(kLengthAndHashOffset);
} }
void FixedDoubleArray::FixedDoubleArrayVerify(Isolate* isolate) { void FixedDoubleArray::FixedDoubleArrayVerify(Isolate* isolate) {
...@@ -1197,6 +1198,8 @@ void Oddball::OddballVerify(Isolate* isolate) { ...@@ -1197,6 +1198,8 @@ void Oddball::OddballVerify(Isolate* isolate) {
} else { } else {
UNREACHABLE(); UNREACHABLE();
} }
CHECK(to_string()->IsString());
CHECK(type_of()->IsString());
} }
void Cell::CellVerify(Isolate* isolate) { void Cell::CellVerify(Isolate* isolate) {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_OBJECTS_ODDBALL_H_ #define V8_OBJECTS_ODDBALL_H_
#include "src/objects/heap-object.h" #include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -47,22 +48,11 @@ class Oddball : public HeapObject { ...@@ -47,22 +48,11 @@ class Oddball : public HeapObject {
const char* to_string, Handle<Object> to_number, const char* to_string, Handle<Object> to_number,
const char* type_of, byte kind); const char* type_of, byte kind);
// Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
#define ODDBALL_FIELDS(V) \ TORQUE_GENERATED_ODDBALL_FIELDS)
V(kToNumberRawOffset, kDoubleSize) \ // TODO(v8:8989): [torque] Support marker constants.
/* Tagged fields. */ \ static const int kTaggedFieldsStartOffset = kToStringOffset;
V(kTaggedFieldsStartOffset, 0) \ static const int kTaggedFieldsEndOffset = kKindOffset;
V(kToStringOffset, kTaggedSize) \
V(kToNumberOffset, kTaggedSize) \
V(kTypeOfOffset, kTaggedSize) \
V(kTaggedFieldsEndOffset, 0) \
/* Raw data but still encoded as Smi. */ \
V(kKindOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, ODDBALL_FIELDS)
#undef ODDBALL_FIELDS
static const byte kFalse = 0; static const byte kFalse = 0;
static const byte kTrue = 1; static const byte kTrue = 1;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_OBJECTS_PROPERTY_ARRAY_H_ #define V8_OBJECTS_PROPERTY_ARRAY_H_
#include "src/objects/heap-object.h" #include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -47,14 +48,9 @@ class PropertyArray : public HeapObject { ...@@ -47,14 +48,9 @@ class PropertyArray : public HeapObject {
DECL_PRINTER(PropertyArray) DECL_PRINTER(PropertyArray)
DECL_VERIFIER(PropertyArray) DECL_VERIFIER(PropertyArray)
// Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
#define PROPERTY_ARRAY_FIELDS(V) \ TORQUE_GENERATED_PROPERTY_ARRAY_FIELDS)
V(kLengthAndHashOffset, kTaggedSize) \ static const int kHeaderSize = kSize;
/* Header size. */ \
V(kHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, PROPERTY_ARRAY_FIELDS)
#undef PROPERTY_ARRAY_FIELDS
// Garbage collection support. // Garbage collection support.
typedef FlexibleBodyDescriptor<kHeaderSize> BodyDescriptor; typedef FlexibleBodyDescriptor<kHeaderSize> BodyDescriptor;
......
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