Commit 6fa8283d authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

Reland "[objects.h splitting] Move AsyncGeneratorRequest"

This is a reland of 81756480

Original change's description:
> [objects.h splitting] Move AsyncGeneratorRequest
>
> BUG=v8:5402,v8:8238
>
> Change-Id: I988b1e0b7a958d06690820632bc533d9e5338535
> Reviewed-on: https://chromium-review.googlesource.com/c/1349190
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57776}

TBR=clemensh@chromium.org,ulan@chromium.org

Bug: v8:5402, v8:8238
Change-Id: I9f4b6b761313be586612df7e7753b97f99c4d1e9
Reviewed-on: https://chromium-review.googlesource.com/c/1349283
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57786}
parent 886cd71e
......@@ -30,6 +30,7 @@ namespace internal {
// Forward declarations.
class AsmWasmData;
class AsyncGeneratorRequest;
class CallInterfaceDescriptor;
class Callable;
class Factory;
......
......@@ -20,6 +20,7 @@
#include "src/objects/debug-objects.h"
#include "src/objects/descriptor-array.h"
#include "src/objects/dictionary.h"
#include "src/objects/js-generator.h"
#include "src/objects/js-weak-refs.h"
#include "src/objects/literal-objects-inl.h"
#include "src/objects/map.h"
......
......@@ -532,7 +532,6 @@ StringSet::StringSet(Address ptr) : HashTable<StringSet, StringSetShape>(ptr) {
// Cast operations
CAST_ACCESSOR(AccessorPair)
CAST_ACCESSOR(AsyncGeneratorRequest)
CAST_ACCESSOR(BigInt)
CAST_ACCESSOR(ObjectBoilerplateDescription)
CAST_ACCESSOR(Cell)
......@@ -1641,12 +1640,6 @@ int HeapObject::SizeFromMap(Map map) const {
EmbedderDataArray::unchecked_cast(this)->length());
}
ACCESSORS(AsyncGeneratorRequest, next, Object, kNextOffset)
SMI_ACCESSORS(AsyncGeneratorRequest, resume_mode, kResumeModeOffset)
ACCESSORS(AsyncGeneratorRequest, value, Object, kValueOffset)
ACCESSORS(AsyncGeneratorRequest, promise, Object, kPromiseOffset)
ACCESSORS(Tuple2, value1, Object, kValue1Offset)
ACCESSORS(Tuple2, value2, Object, kValue2Offset)
ACCESSORS(Tuple3, value3, Object, kValue3Offset)
......
......@@ -1954,28 +1954,6 @@ class Tuple3 : public Tuple2 {
DISALLOW_IMPLICIT_CONSTRUCTORS(Tuple3);
};
class AsyncGeneratorRequest : public Struct {
public:
// Holds an AsyncGeneratorRequest, or Undefined.
DECL_ACCESSORS(next, Object)
DECL_INT_ACCESSORS(resume_mode)
DECL_ACCESSORS(value, Object)
DECL_ACCESSORS(promise, Object)
static const int kNextOffset = Struct::kHeaderSize;
static const int kResumeModeOffset = kNextOffset + kPointerSize;
static const int kValueOffset = kResumeModeOffset + kPointerSize;
static const int kPromiseOffset = kValueOffset + kPointerSize;
static const int kSize = kPromiseOffset + kPointerSize;
DECL_CAST(AsyncGeneratorRequest)
DECL_PRINTER(AsyncGeneratorRequest)
DECL_VERIFIER(AsyncGeneratorRequest)
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(AsyncGeneratorRequest);
};
// Utility superclass for stack-allocated objects that must be updated
// on gc. It provides two ways for the gc to update instances, either
// iterating or updating after gc.
......
......@@ -19,6 +19,7 @@ namespace internal {
CAST_ACCESSOR(JSAsyncFunctionObject)
CAST_ACCESSOR(JSAsyncGeneratorObject)
CAST_ACCESSOR(JSGeneratorObject)
CAST_ACCESSOR(AsyncGeneratorRequest)
ACCESSORS(JSGeneratorObject, function, JSFunction, kFunctionOffset)
ACCESSORS2(JSGeneratorObject, context, Context, kContextOffset)
......@@ -29,6 +30,11 @@ SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset)
ACCESSORS(JSGeneratorObject, parameters_and_registers, FixedArray,
kParametersAndRegistersOffset)
ACCESSORS(AsyncGeneratorRequest, next, Object, kNextOffset)
SMI_ACCESSORS(AsyncGeneratorRequest, resume_mode, kResumeModeOffset)
ACCESSORS(AsyncGeneratorRequest, value, Object, kValueOffset)
ACCESSORS(AsyncGeneratorRequest, promise, Object, kPromiseOffset)
bool JSGeneratorObject::is_suspended() const {
DCHECK_LT(kGeneratorExecuting, 0);
DCHECK_LT(kGeneratorClosed, 0);
......
......@@ -140,6 +140,28 @@ class JSAsyncGeneratorObject : public JSGeneratorObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSAsyncGeneratorObject);
};
class AsyncGeneratorRequest : public Struct {
public:
// Holds an AsyncGeneratorRequest, or Undefined.
DECL_ACCESSORS(next, Object)
DECL_INT_ACCESSORS(resume_mode)
DECL_ACCESSORS(value, Object)
DECL_ACCESSORS(promise, Object)
static const int kNextOffset = Struct::kHeaderSize;
static const int kResumeModeOffset = kNextOffset + kPointerSize;
static const int kValueOffset = kResumeModeOffset + kPointerSize;
static const int kPromiseOffset = kValueOffset + kPointerSize;
static const int kSize = kPromiseOffset + kPointerSize;
DECL_CAST(AsyncGeneratorRequest)
DECL_PRINTER(AsyncGeneratorRequest)
DECL_VERIFIER(AsyncGeneratorRequest)
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(AsyncGeneratorRequest);
};
} // namespace internal
} // namespace v8
......
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