Commit 1f2d9475 authored by Irina Yatsenko's avatar Irina Yatsenko Committed by Commit Bot

Torquefy a few simple types

Creates Torque classes for JSProxy, JSAccessorPropertyDescriptor, JSCollection, JSProxyRevocableResult, JSValue

Change-Id: I01eec27b158b4beb778cb5efce44f241c09ef0f7
Reviewed-on: https://chromium-review.googlesource.com/c/1489184
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59921}
parent 95506041
......@@ -87,7 +87,6 @@ extern class JSReceiver extends HeapObject {
}
type Constructor extends JSReceiver;
type JSProxy extends JSReceiver generates 'TNode<JSProxy>';
extern class JSObject extends JSReceiver { elements: FixedArrayBase; }
......@@ -103,6 +102,20 @@ macro NewJSObject(implicit context: Context)(): JSObject {
return new JSObject{map, kEmptyFixedArray, kEmptyFixedArray};
}
extern class JSProxy extends JSReceiver {
target: Object;
handler: Object;
}
extern class JSProxyRevocableResult extends JSObject {
proxy: Object;
revoke: Object;
}
extern class JSGlobalProxy extends JSObject { native_context: Object; }
extern class JSValue extends JSObject { value: Object; }
extern class JSArgumentsObjectWithLength extends JSObject { length: Object; }
extern class JSArray extends JSObject {
......@@ -258,6 +271,15 @@ extern class JSTypedArray extends JSArrayBufferView {
length: Smi;
}
extern class JSAccessorPropertyDescriptor extends JSObject {
get: Object;
set: Object;
enumerable: Object;
configurable: Object;
}
extern class JSCollection extends JSObject { table: Object; }
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';
......
......@@ -22,6 +22,7 @@
#include "src/objects/data-handler.h"
#include "src/objects/heap-number.h"
#include "src/objects/js-array-buffer.h"
#include "src/objects/js-collection.h"
#include "src/objects/map.h"
#include "src/objects/maybe-object.h"
#include "src/objects/oddball.h"
......
......@@ -273,6 +273,7 @@ class JSAsyncGeneratorObject;
class JSGlobalProxy;
class JSPromise;
class JSProxy;
class JSProxyRevocableResult;
class KeyAccumulator;
class LayoutDescriptor;
class LookupIterator;
......
......@@ -19,14 +19,8 @@ class JSCollection : public JSObject {
// [table]: the backing hash table
DECL_ACCESSORS(table, Object)
// Layout description.
#define JS_COLLECTION_FIELDS(V) \
V(kTableOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_COLLECTION_FIELDS)
#undef JS_COLLECTION_FIELDS
// Layout description.
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JSCOLLECTION_FIELDS)
static const int kAddFunctionDescriptorIndex = 3;
......
......@@ -832,17 +832,8 @@ class JSObject : public JSReceiver {
class JSAccessorPropertyDescriptor : public JSObject {
public:
// Layout description.
#define JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS(V) \
V(kGetOffset, kTaggedSize) \
V(kSetOffset, kTaggedSize) \
V(kEnumerableOffset, kTaggedSize) \
V(kConfigurableOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS)
#undef JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS
JSACCESSOR_PROPERTY_DESCRIPTOR_FIELDS)
// Indices of in-object properties.
static const int kGetIndex = 0;
......@@ -1168,13 +1159,7 @@ class JSGlobalProxy : public JSObject {
DECL_VERIFIER(JSGlobalProxy)
// Layout description.
#define JS_GLOBAL_PROXY_FIELDS(V) \
V(kNativeContextOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_GLOBAL_PROXY_FIELDS)
#undef JS_GLOBAL_PROXY_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JSGLOBAL_PROXY_FIELDS)
OBJECT_CONSTRUCTORS(JSGlobalProxy, JSObject);
};
......@@ -1234,13 +1219,7 @@ class JSValue : public JSObject {
DECL_VERIFIER(JSValue)
// Layout description.
#define JS_VALUE_FIELDS(V) \
V(kValueOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_VALUE_FIELDS)
#undef JS_VALUE_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JSVALUE_FIELDS)
OBJECT_CONSTRUCTORS(JSValue, JSObject);
};
......
......@@ -106,14 +106,7 @@ class JSProxy : public JSReceiver {
static const int kMaxIterationLimit = 100 * 1024;
// Layout description.
#define JS_PROXY_FIELDS(V) \
V(kTargetOffset, kTaggedSize) \
V(kHandlerOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSReceiver::kHeaderSize, JS_PROXY_FIELDS)
#undef JS_PROXY_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(JSReceiver::kHeaderSize, JSPROXY_FIELDS)
// kTargetOffset aliases with the elements of JSObject. The fact that
// JSProxy::target is a Javascript value which cannot be confused with an
......@@ -139,15 +132,8 @@ class JSProxy : public JSReceiver {
class JSProxyRevocableResult : public JSObject {
public:
// Layout description.
#define JS_PROXY_REVOCATABLE_RESULT_FIELDS(V) \
V(kProxyOffset, kTaggedSize) \
V(kRevokeOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_PROXY_REVOCATABLE_RESULT_FIELDS)
#undef JS_PROXY_REVOCATABLE_RESULT_FIELDS
JSPROXY_REVOCABLE_RESULT_FIELDS)
// Indices of in-object properties.
static const int kProxyIndex = 0;
......
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