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>';
type BuiltinPtr extends Smi generates 'TNode<BuiltinPtr>';
type Context extends HeapObject generates 'TNode<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 Number = Smi | HeapNumber;
type BigInt extends HeapObject generates 'TNode<BigInt>';
......@@ -456,6 +462,8 @@ extern class ObjectTemplateInfo extends TemplateInfo {
data: Object;
}
extern class PropertyArray extends HeapObject { length_and_hash: Smi; }
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';
......
......@@ -737,6 +737,7 @@ void PropertyArray::PropertyArrayVerify(Isolate* isolate) {
Object e = get(i);
Object::VerifyPointer(isolate, e);
}
VerifySmiField(kLengthAndHashOffset);
}
void FixedDoubleArray::FixedDoubleArrayVerify(Isolate* isolate) {
......@@ -1197,6 +1198,8 @@ void Oddball::OddballVerify(Isolate* isolate) {
} else {
UNREACHABLE();
}
CHECK(to_string()->IsString());
CHECK(type_of()->IsString());
}
void Cell::CellVerify(Isolate* isolate) {
......
......@@ -6,6 +6,7 @@
#define V8_OBJECTS_ODDBALL_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):
#include "src/objects/object-macros.h"
......@@ -47,22 +48,11 @@ class Oddball : public HeapObject {
const char* to_string, Handle<Object> to_number,
const char* type_of, byte kind);
// Layout description.
#define ODDBALL_FIELDS(V) \
V(kToNumberRawOffset, kDoubleSize) \
/* Tagged fields. */ \
V(kTaggedFieldsStartOffset, 0) \
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
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_ODDBALL_FIELDS)
// TODO(v8:8989): [torque] Support marker constants.
static const int kTaggedFieldsStartOffset = kToStringOffset;
static const int kTaggedFieldsEndOffset = kKindOffset;
static const byte kFalse = 0;
static const byte kTrue = 1;
......
......@@ -6,6 +6,7 @@
#define V8_OBJECTS_PROPERTY_ARRAY_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):
#include "src/objects/object-macros.h"
......@@ -47,14 +48,9 @@ class PropertyArray : public HeapObject {
DECL_PRINTER(PropertyArray)
DECL_VERIFIER(PropertyArray)
// Layout description.
#define PROPERTY_ARRAY_FIELDS(V) \
V(kLengthAndHashOffset, kTaggedSize) \
/* Header size. */ \
V(kHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, PROPERTY_ARRAY_FIELDS)
#undef PROPERTY_ARRAY_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_PROPERTY_ARRAY_FIELDS)
static const int kHeaderSize = kSize;
// Garbage collection support.
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