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'; ...@@ -55,10 +55,15 @@ type bint generates 'TNode<BInt>' constexpr 'BInt';
type string constexpr 'const char*'; type string constexpr 'const char*';
type RawPtr generates 'TNode<RawPtrT>' constexpr 'void*'; type RawPtr generates 'TNode<RawPtrT>' constexpr 'void*';
type AbstractCode extends HeapObject generates 'TNode<AbstractCode>'; type Code extends HeapObject generates 'TNode<Code>';
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>'; extern class Context extends HeapObject {
length: Smi;
scope_info: ScopeInfo;
previous: Object;
extension: Object;
native_context: Object;
}
type NativeContext extends Context; type NativeContext extends Context;
extern class Oddball extends HeapObject { extern class Oddball extends HeapObject {
to_number_raw: float64; to_number_raw: float64;
......
...@@ -500,7 +500,7 @@ STATIC_ASSERT(NativeContext::kNativeContextOffset == ...@@ -500,7 +500,7 @@ STATIC_ASSERT(NativeContext::kNativeContextOffset ==
Context::OffsetOfElementAt(NativeContext::NATIVE_CONTEXT_INDEX)); Context::OffsetOfElementAt(NativeContext::NATIVE_CONTEXT_INDEX));
STATIC_ASSERT(NativeContext::kStartOfStrongFieldsOffset == STATIC_ASSERT(NativeContext::kStartOfStrongFieldsOffset ==
Context::OffsetOfElementAt(0)); Context::OffsetOfElementAt(-1));
STATIC_ASSERT(NativeContext::kStartOfWeakFieldsOffset == STATIC_ASSERT(NativeContext::kStartOfWeakFieldsOffset ==
Context::OffsetOfElementAt(NativeContext::FIRST_WEAK_SLOT)); Context::OffsetOfElementAt(NativeContext::FIRST_WEAK_SLOT));
STATIC_ASSERT(NativeContext::kMicrotaskQueueOffset == STATIC_ASSERT(NativeContext::kMicrotaskQueueOffset ==
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/function-kind.h" #include "src/function-kind.h"
#include "src/objects/fixed-array.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): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -451,25 +452,16 @@ class Context : public HeapObject { ...@@ -451,25 +452,16 @@ class Context : public HeapObject {
// Setter with explicit barrier mode. // Setter with explicit barrier mode.
V8_INLINE void set(int index, Object value, WriteBarrierMode mode); V8_INLINE void set(int index, Object value, WriteBarrierMode mode);
// Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
#define CONTEXT_FIELDS(V) \ TORQUE_GENERATED_CONTEXT_FIELDS)
V(kLengthOffset, kTaggedSize) \ // TODO(v8:8989): [torque] Support marker constants.
/* TODO(ishell): remove this fixedArray-like header size. */ \ /* TODO(ishell): remove this fixedArray-like header size. */
V(kHeaderSize, 0) \ static const int kHeaderSize = kScopeInfoOffset;
V(kStartOfTaggedFieldsOffset, 0) \ static const int kStartOfTaggedFieldsOffset = kScopeInfoOffset;
V(kStartOfStrongFieldsOffset, 0) \
/* Tagged fields. */ \
V(kScopeInfoOffset, kTaggedSize) \
V(kPreviousOffset, kTaggedSize) \
V(kExtensionOffset, kTaggedSize) \
V(kNativeContextOffset, kTaggedSize) \
/* Header size. */ \ /* Header size. */ \
/* TODO(ishell): use this as header size once MIN_CONTEXT_SLOTS */ \ /* TODO(ishell): use this as header size once MIN_CONTEXT_SLOTS */ \
/* is removed in favour of offset-based access to common fields. */ \ /* is removed in favour of offset-based access to common fields. */ \
V(kTodoHeaderSize, 0) static const int kTodoHeaderSize = kSize;
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, CONTEXT_FIELDS)
#undef CONTEXT_FIELDS
// Garbage collection support. // Garbage collection support.
V8_INLINE static constexpr int SizeFor(int length) { 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