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

Torquefy Context, AbstractCode

Bug: v8:8952
Change-Id: I5f6574bf5dfd483c7052ac8d4de5217c27e02a03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543335Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60763}
parent 8e18d29e
......@@ -55,10 +55,15 @@ type bint generates 'TNode<BInt>' constexpr 'BInt';
type string constexpr 'const char*';
type RawPtr generates 'TNode<RawPtrT>' constexpr 'void*';
type AbstractCode extends HeapObject generates 'TNode<AbstractCode>';
type Code extends AbstractCode generates 'TNode<Code>';
type Code extends HeapObject generates 'TNode<Code>';
type BuiltinPtr extends Smi generates 'TNode<BuiltinPtr>';
type Context extends HeapObject generates 'TNode<Context>';
extern class Context extends HeapObject {
length: Smi;
scope_info: ScopeInfo;
previous: Object;
extension: Object;
native_context: Object;
}
type NativeContext extends Context;
extern class Oddball extends HeapObject {
to_number_raw: float64;
......
......@@ -500,7 +500,7 @@ STATIC_ASSERT(NativeContext::kNativeContextOffset ==
Context::OffsetOfElementAt(NativeContext::NATIVE_CONTEXT_INDEX));
STATIC_ASSERT(NativeContext::kStartOfStrongFieldsOffset ==
Context::OffsetOfElementAt(0));
Context::OffsetOfElementAt(-1));
STATIC_ASSERT(NativeContext::kStartOfWeakFieldsOffset ==
Context::OffsetOfElementAt(NativeContext::FIRST_WEAK_SLOT));
STATIC_ASSERT(NativeContext::kMicrotaskQueueOffset ==
......
......@@ -7,6 +7,7 @@
#include "src/function-kind.h"
#include "src/objects/fixed-array.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"
......@@ -451,25 +452,16 @@ class Context : public HeapObject {
// Setter with explicit barrier mode.
V8_INLINE void set(int index, Object value, WriteBarrierMode mode);
// Layout description.
#define CONTEXT_FIELDS(V) \
V(kLengthOffset, kTaggedSize) \
/* TODO(ishell): remove this fixedArray-like header size. */ \
V(kHeaderSize, 0) \
V(kStartOfTaggedFieldsOffset, 0) \
V(kStartOfStrongFieldsOffset, 0) \
/* Tagged fields. */ \
V(kScopeInfoOffset, kTaggedSize) \
V(kPreviousOffset, kTaggedSize) \
V(kExtensionOffset, kTaggedSize) \
V(kNativeContextOffset, kTaggedSize) \
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_CONTEXT_FIELDS)
// TODO(v8:8989): [torque] Support marker constants.
/* TODO(ishell): remove this fixedArray-like header size. */
static const int kHeaderSize = kScopeInfoOffset;
static const int kStartOfTaggedFieldsOffset = kScopeInfoOffset;
/* Header size. */ \
/* TODO(ishell): use this as header size once MIN_CONTEXT_SLOTS */ \
/* is removed in favour of offset-based access to common fields. */ \
V(kTodoHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, CONTEXT_FIELDS)
#undef CONTEXT_FIELDS
static const int kTodoHeaderSize = kSize;
// Garbage collection support.
V8_INLINE static constexpr int SizeFor(int length) {
......
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