Add v8::internal::MicrotaskQueue stub

As a step of Context-associated MicrotaskQueue [1], this CL adds
a stub for v8::internal::MicrotaskQueue.

[1]: https://docs.google.com/document/d/1oNNhXF66dmwyj5S6Ri_g1vmBZltK8rWvZo1Tgqj64Z0/edit?usp=sharing

Tbr: bmeurer@chromium.org
Bug: v8:8124
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie3d86ca49d46749660ec1316e4ae051528076e97
Reviewed-on: https://chromium-review.googlesource.com/1192803
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55624}
This commit is contained in:
tzik 2018-09-05 05:33:24 +09:00 committed by Commit Bot
parent 73932da7a0
commit e9e583ec59
11 changed files with 199 additions and 92 deletions

View File

@ -2218,6 +2218,9 @@ v8_source_set("v8_base") {
"src/objects/maybe-object-inl.h",
"src/objects/maybe-object.h",
"src/objects/microtask-inl.h",
"src/objects/microtask-queue-inl.h",
"src/objects/microtask-queue.cc",
"src/objects/microtask-queue.h",
"src/objects/microtask.h",
"src/objects/module-inl.h",
"src/objects/module.cc",

View File

@ -301,6 +301,7 @@ Type::bitset BitsetType::Lub(HeapObjectType const& type) {
case PROPERTY_CELL_TYPE:
case MODULE_TYPE:
case MODULE_INFO_ENTRY_TYPE:
case MICROTASK_QUEUE_TYPE:
case CELL_TYPE:
case PRE_PARSED_SCOPE_DATA_TYPE:
case UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE:

View File

@ -1279,6 +1279,8 @@ void PromiseReactionJobTask::PromiseReactionJobTaskVerify(Isolate* isolate) {
promise_or_capability()->IsPromiseCapability());
}
void MicrotaskQueue::MicrotaskQueueVerify(Isolate* isolate) { UNIMPLEMENTED(); }
void PromiseFulfillReactionJobTask::PromiseFulfillReactionJobTaskVerify(
Isolate* isolate) {
CHECK(IsPromiseFulfillReactionJobTask());

View File

@ -121,6 +121,8 @@ namespace internal {
V(PROMISE_REJECT_REACTION_JOB_TASK_TYPE) \
V(PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE) \
\
V(MICROTASK_QUEUE_TYPE) \
\
V(ALLOCATION_SITE_TYPE) \
\
V(FIXED_ARRAY_TYPE) \
@ -327,7 +329,8 @@ namespace internal {
V(PROMISE_REJECT_REACTION_JOB_TASK, PromiseRejectReactionJobTask, \
promise_reject_reaction_job_task) \
V(PROMISE_RESOLVE_THENABLE_JOB_TASK, PromiseResolveThenableJobTask, \
promise_resolve_thenable_job_task)
promise_resolve_thenable_job_task) \
V(MICROTASK_QUEUE, MicrotaskQueue, microtask_queue)
#define ALLOCATION_SITE_LIST(V) \
V(ALLOCATION_SITE, AllocationSite, WithWeakNext, allocation_site) \

View File

@ -36,6 +36,7 @@
#include "src/objects/js-proxy-inl.h"
#include "src/objects/literal-objects.h"
#include "src/objects/maybe-object-inl.h"
#include "src/objects/microtask-queue-inl.h"
#include "src/objects/regexp-match-info.h"
#include "src/objects/scope-info.h"
#include "src/objects/template-objects.h"

View File

@ -2196,6 +2196,10 @@ void UncompiledDataWithPreParsedScope::UncompiledDataWithPreParsedScopePrint(
os << "\n";
}
void MicrotaskQueue::MicrotaskQueuePrint(std::ostream& os) { // NOLINT
UNIMPLEMENTED();
}
void InterpreterData::InterpreterDataPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "InterpreterData");
os << "\n - bytecode_array: " << Brief(bytecode_array());

View File

@ -172,6 +172,7 @@
// - PromiseFulfillReactionJobTask
// - PromiseRejectReactionJobTask
// - PromiseResolveThenableJobTask
// - MicrotaskQueue
// - Module
// - ModuleInfoEntry
// - FeedbackCell
@ -490,6 +491,8 @@ enum InstanceType : uint16_t {
PROMISE_REJECT_REACTION_JOB_TASK_TYPE,
PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE, // LAST_MICROTASK_TYPE
MICROTASK_QUEUE_TYPE,
ALLOCATION_SITE_TYPE,
// FixedArrays.
FIXED_ARRAY_TYPE, // FIRST_FIXED_ARRAY_TYPE
@ -717,6 +720,7 @@ class KeyAccumulator;
class LayoutDescriptor;
class LookupIterator;
class FieldType;
class MicrotaskQueue;
class Module;
class ModuleInfoEntry;
class ObjectHashTable;

View File

@ -0,0 +1,25 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_MICROTASK_QUEUE_INL_H_
#define V8_OBJECTS_MICROTASK_QUEUE_INL_H_
#include "src/objects/microtask-queue.h"
#include "src/objects-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
CAST_ACCESSOR(MicrotaskQueue)
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_OBJECTS_MICROTASK_QUEUE_INL_H_

View File

@ -0,0 +1,24 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/objects/microtask-queue.h"
#include "src/objects/microtask-queue-inl.h"
namespace v8 {
namespace internal {
// static
void MicrotaskQueue::EnqueueMicrotask(Handle<MicrotaskQueue> microtask_queue,
Handle<Microtask> microtask) {
UNIMPLEMENTED();
}
// static
void MicrotaskQueue::RunMicrotasks(Handle<MicrotaskQueue> microtask_queue) {
UNIMPLEMENTED();
}
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,38 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_MICROTASK_QUEUE_H_
#define V8_OBJECTS_MICROTASK_QUEUE_H_
#include "src/objects.h"
#include "src/objects/microtask.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
class MicrotaskQueue : public Struct {
public:
DECL_CAST(MicrotaskQueue)
DECL_VERIFIER(MicrotaskQueue)
DECL_PRINTER(MicrotaskQueue)
static void EnqueueMicrotask(Handle<MicrotaskQueue> microtask_queue,
Handle<Microtask> microtask);
static void RunMicrotasks(Handle<MicrotaskQueue> microtask_queue);
static const int kSize = HeapObject::kHeaderSize;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(MicrotaskQueue);
};
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_OBJECTS_MICROTASK_QUEUE_H_

View File

@ -82,48 +82,49 @@ INSTANCE_TYPES = {
178: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE",
179: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE",
180: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE",
181: "ALLOCATION_SITE_TYPE",
182: "FIXED_ARRAY_TYPE",
183: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
184: "HASH_TABLE_TYPE",
185: "ORDERED_HASH_MAP_TYPE",
186: "ORDERED_HASH_SET_TYPE",
187: "NAME_DICTIONARY_TYPE",
188: "GLOBAL_DICTIONARY_TYPE",
189: "NUMBER_DICTIONARY_TYPE",
190: "SIMPLE_NUMBER_DICTIONARY_TYPE",
191: "STRING_TABLE_TYPE",
192: "EPHEMERON_HASH_TABLE_TYPE",
193: "SCOPE_INFO_TYPE",
194: "SCRIPT_CONTEXT_TABLE_TYPE",
195: "BLOCK_CONTEXT_TYPE",
196: "CATCH_CONTEXT_TYPE",
197: "DEBUG_EVALUATE_CONTEXT_TYPE",
198: "EVAL_CONTEXT_TYPE",
199: "FUNCTION_CONTEXT_TYPE",
200: "MODULE_CONTEXT_TYPE",
201: "NATIVE_CONTEXT_TYPE",
202: "SCRIPT_CONTEXT_TYPE",
203: "WITH_CONTEXT_TYPE",
204: "WEAK_FIXED_ARRAY_TYPE",
205: "DESCRIPTOR_ARRAY_TYPE",
206: "TRANSITION_ARRAY_TYPE",
207: "CALL_HANDLER_INFO_TYPE",
208: "CELL_TYPE",
209: "CODE_DATA_CONTAINER_TYPE",
210: "FEEDBACK_CELL_TYPE",
211: "FEEDBACK_VECTOR_TYPE",
212: "LOAD_HANDLER_TYPE",
213: "PRE_PARSED_SCOPE_DATA_TYPE",
214: "PROPERTY_ARRAY_TYPE",
215: "PROPERTY_CELL_TYPE",
216: "SHARED_FUNCTION_INFO_TYPE",
217: "SMALL_ORDERED_HASH_MAP_TYPE",
218: "SMALL_ORDERED_HASH_SET_TYPE",
219: "STORE_HANDLER_TYPE",
220: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
221: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
222: "WEAK_ARRAY_LIST_TYPE",
181: "MICROTASK_QUEUE_TYPE",
182: "ALLOCATION_SITE_TYPE",
183: "FIXED_ARRAY_TYPE",
184: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
185: "HASH_TABLE_TYPE",
186: "ORDERED_HASH_MAP_TYPE",
187: "ORDERED_HASH_SET_TYPE",
188: "NAME_DICTIONARY_TYPE",
189: "GLOBAL_DICTIONARY_TYPE",
190: "NUMBER_DICTIONARY_TYPE",
191: "SIMPLE_NUMBER_DICTIONARY_TYPE",
192: "STRING_TABLE_TYPE",
193: "EPHEMERON_HASH_TABLE_TYPE",
194: "SCOPE_INFO_TYPE",
195: "SCRIPT_CONTEXT_TABLE_TYPE",
196: "BLOCK_CONTEXT_TYPE",
197: "CATCH_CONTEXT_TYPE",
198: "DEBUG_EVALUATE_CONTEXT_TYPE",
199: "EVAL_CONTEXT_TYPE",
200: "FUNCTION_CONTEXT_TYPE",
201: "MODULE_CONTEXT_TYPE",
202: "NATIVE_CONTEXT_TYPE",
203: "SCRIPT_CONTEXT_TYPE",
204: "WITH_CONTEXT_TYPE",
205: "WEAK_FIXED_ARRAY_TYPE",
206: "DESCRIPTOR_ARRAY_TYPE",
207: "TRANSITION_ARRAY_TYPE",
208: "CALL_HANDLER_INFO_TYPE",
209: "CELL_TYPE",
210: "CODE_DATA_CONTAINER_TYPE",
211: "FEEDBACK_CELL_TYPE",
212: "FEEDBACK_VECTOR_TYPE",
213: "LOAD_HANDLER_TYPE",
214: "PRE_PARSED_SCOPE_DATA_TYPE",
215: "PROPERTY_ARRAY_TYPE",
216: "PROPERTY_CELL_TYPE",
217: "SHARED_FUNCTION_INFO_TYPE",
218: "SMALL_ORDERED_HASH_MAP_TYPE",
219: "SMALL_ORDERED_HASH_SET_TYPE",
220: "STORE_HANDLER_TYPE",
221: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
222: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
223: "WEAK_ARRAY_LIST_TYPE",
1024: "JS_PROXY_TYPE",
1025: "JS_GLOBAL_OBJECT_TYPE",
1026: "JS_GLOBAL_PROXY_TYPE",
@ -179,8 +180,8 @@ KNOWN_MAPS = {
("RO_SPACE", 0x02201): (138, "FreeSpaceMap"),
("RO_SPACE", 0x02251): (132, "MetaMap"),
("RO_SPACE", 0x022d1): (131, "NullMap"),
("RO_SPACE", 0x02341): (205, "DescriptorArrayMap"),
("RO_SPACE", 0x023a1): (204, "WeakFixedArrayMap"),
("RO_SPACE", 0x02341): (206, "DescriptorArrayMap"),
("RO_SPACE", 0x023a1): (205, "WeakFixedArrayMap"),
("RO_SPACE", 0x023f1): (152, "OnePointerFillerMap"),
("RO_SPACE", 0x02441): (152, "TwoPointerFillerMap"),
("RO_SPACE", 0x024c1): (131, "UninitializedMap"),
@ -190,65 +191,65 @@ KNOWN_MAPS = {
("RO_SPACE", 0x026c1): (131, "TheHoleMap"),
("RO_SPACE", 0x02771): (131, "BooleanMap"),
("RO_SPACE", 0x02869): (136, "ByteArrayMap"),
("RO_SPACE", 0x028b9): (182, "FixedArrayMap"),
("RO_SPACE", 0x02909): (182, "FixedCOWArrayMap"),
("RO_SPACE", 0x02959): (184, "HashTableMap"),
("RO_SPACE", 0x028b9): (183, "FixedArrayMap"),
("RO_SPACE", 0x02909): (183, "FixedCOWArrayMap"),
("RO_SPACE", 0x02959): (185, "HashTableMap"),
("RO_SPACE", 0x029a9): (128, "SymbolMap"),
("RO_SPACE", 0x029f9): (72, "OneByteStringMap"),
("RO_SPACE", 0x02a49): (193, "ScopeInfoMap"),
("RO_SPACE", 0x02a99): (216, "SharedFunctionInfoMap"),
("RO_SPACE", 0x02a49): (194, "ScopeInfoMap"),
("RO_SPACE", 0x02a99): (217, "SharedFunctionInfoMap"),
("RO_SPACE", 0x02ae9): (133, "CodeMap"),
("RO_SPACE", 0x02b39): (199, "FunctionContextMap"),
("RO_SPACE", 0x02b89): (208, "CellMap"),
("RO_SPACE", 0x02bd9): (215, "GlobalPropertyCellMap"),
("RO_SPACE", 0x02b39): (200, "FunctionContextMap"),
("RO_SPACE", 0x02b89): (209, "CellMap"),
("RO_SPACE", 0x02bd9): (216, "GlobalPropertyCellMap"),
("RO_SPACE", 0x02c29): (135, "ForeignMap"),
("RO_SPACE", 0x02c79): (206, "TransitionArrayMap"),
("RO_SPACE", 0x02cc9): (211, "FeedbackVectorMap"),
("RO_SPACE", 0x02c79): (207, "TransitionArrayMap"),
("RO_SPACE", 0x02cc9): (212, "FeedbackVectorMap"),
("RO_SPACE", 0x02d69): (131, "ArgumentsMarkerMap"),
("RO_SPACE", 0x02e11): (131, "ExceptionMap"),
("RO_SPACE", 0x02eb9): (131, "TerminationExceptionMap"),
("RO_SPACE", 0x02f69): (131, "OptimizedOutMap"),
("RO_SPACE", 0x03011): (131, "StaleRegisterMap"),
("RO_SPACE", 0x03089): (201, "NativeContextMap"),
("RO_SPACE", 0x030d9): (200, "ModuleContextMap"),
("RO_SPACE", 0x03129): (198, "EvalContextMap"),
("RO_SPACE", 0x03179): (202, "ScriptContextMap"),
("RO_SPACE", 0x031c9): (195, "BlockContextMap"),
("RO_SPACE", 0x03219): (196, "CatchContextMap"),
("RO_SPACE", 0x03269): (203, "WithContextMap"),
("RO_SPACE", 0x032b9): (197, "DebugEvaluateContextMap"),
("RO_SPACE", 0x03309): (194, "ScriptContextTableMap"),
("RO_SPACE", 0x03089): (202, "NativeContextMap"),
("RO_SPACE", 0x030d9): (201, "ModuleContextMap"),
("RO_SPACE", 0x03129): (199, "EvalContextMap"),
("RO_SPACE", 0x03179): (203, "ScriptContextMap"),
("RO_SPACE", 0x031c9): (196, "BlockContextMap"),
("RO_SPACE", 0x03219): (197, "CatchContextMap"),
("RO_SPACE", 0x03269): (204, "WithContextMap"),
("RO_SPACE", 0x032b9): (198, "DebugEvaluateContextMap"),
("RO_SPACE", 0x03309): (195, "ScriptContextTableMap"),
("RO_SPACE", 0x03359): (151, "FeedbackMetadataArrayMap"),
("RO_SPACE", 0x033a9): (182, "ArrayListMap"),
("RO_SPACE", 0x033a9): (183, "ArrayListMap"),
("RO_SPACE", 0x033f9): (130, "BigIntMap"),
("RO_SPACE", 0x03449): (183, "ObjectBoilerplateDescriptionMap"),
("RO_SPACE", 0x03449): (184, "ObjectBoilerplateDescriptionMap"),
("RO_SPACE", 0x03499): (137, "BytecodeArrayMap"),
("RO_SPACE", 0x034e9): (209, "CodeDataContainerMap"),
("RO_SPACE", 0x034e9): (210, "CodeDataContainerMap"),
("RO_SPACE", 0x03539): (150, "FixedDoubleArrayMap"),
("RO_SPACE", 0x03589): (188, "GlobalDictionaryMap"),
("RO_SPACE", 0x035d9): (210, "ManyClosuresCellMap"),
("RO_SPACE", 0x03629): (182, "ModuleInfoMap"),
("RO_SPACE", 0x03589): (189, "GlobalDictionaryMap"),
("RO_SPACE", 0x035d9): (211, "ManyClosuresCellMap"),
("RO_SPACE", 0x03629): (183, "ModuleInfoMap"),
("RO_SPACE", 0x03679): (134, "MutableHeapNumberMap"),
("RO_SPACE", 0x036c9): (187, "NameDictionaryMap"),
("RO_SPACE", 0x03719): (210, "NoClosuresCellMap"),
("RO_SPACE", 0x03769): (189, "NumberDictionaryMap"),
("RO_SPACE", 0x037b9): (210, "OneClosureCellMap"),
("RO_SPACE", 0x03809): (185, "OrderedHashMapMap"),
("RO_SPACE", 0x03859): (186, "OrderedHashSetMap"),
("RO_SPACE", 0x038a9): (213, "PreParsedScopeDataMap"),
("RO_SPACE", 0x038f9): (214, "PropertyArrayMap"),
("RO_SPACE", 0x03949): (207, "SideEffectCallHandlerInfoMap"),
("RO_SPACE", 0x03999): (207, "SideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x039e9): (207, "NextCallSideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x03a39): (190, "SimpleNumberDictionaryMap"),
("RO_SPACE", 0x03a89): (182, "SloppyArgumentsElementsMap"),
("RO_SPACE", 0x03ad9): (217, "SmallOrderedHashMapMap"),
("RO_SPACE", 0x03b29): (218, "SmallOrderedHashSetMap"),
("RO_SPACE", 0x03b79): (191, "StringTableMap"),
("RO_SPACE", 0x03bc9): (220, "UncompiledDataWithoutPreParsedScopeMap"),
("RO_SPACE", 0x03c19): (221, "UncompiledDataWithPreParsedScopeMap"),
("RO_SPACE", 0x03c69): (222, "WeakArrayListMap"),
("RO_SPACE", 0x03cb9): (192, "EphemeronHashTableMap"),
("RO_SPACE", 0x036c9): (188, "NameDictionaryMap"),
("RO_SPACE", 0x03719): (211, "NoClosuresCellMap"),
("RO_SPACE", 0x03769): (190, "NumberDictionaryMap"),
("RO_SPACE", 0x037b9): (211, "OneClosureCellMap"),
("RO_SPACE", 0x03809): (186, "OrderedHashMapMap"),
("RO_SPACE", 0x03859): (187, "OrderedHashSetMap"),
("RO_SPACE", 0x038a9): (214, "PreParsedScopeDataMap"),
("RO_SPACE", 0x038f9): (215, "PropertyArrayMap"),
("RO_SPACE", 0x03949): (208, "SideEffectCallHandlerInfoMap"),
("RO_SPACE", 0x03999): (208, "SideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x039e9): (208, "NextCallSideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x03a39): (191, "SimpleNumberDictionaryMap"),
("RO_SPACE", 0x03a89): (183, "SloppyArgumentsElementsMap"),
("RO_SPACE", 0x03ad9): (218, "SmallOrderedHashMapMap"),
("RO_SPACE", 0x03b29): (219, "SmallOrderedHashSetMap"),
("RO_SPACE", 0x03b79): (192, "StringTableMap"),
("RO_SPACE", 0x03bc9): (221, "UncompiledDataWithoutPreParsedScopeMap"),
("RO_SPACE", 0x03c19): (222, "UncompiledDataWithPreParsedScopeMap"),
("RO_SPACE", 0x03c69): (223, "WeakArrayListMap"),
("RO_SPACE", 0x03cb9): (193, "EphemeronHashTableMap"),
("RO_SPACE", 0x03d09): (106, "NativeSourceStringMap"),
("RO_SPACE", 0x03d59): (64, "StringMap"),
("RO_SPACE", 0x03da9): (73, "ConsOneByteStringMap"),
@ -310,8 +311,9 @@ KNOWN_MAPS = {
("RO_SPACE", 0x0a2f9): (178, "PromiseFulfillReactionJobTaskMap"),
("RO_SPACE", 0x0a349): (179, "PromiseRejectReactionJobTaskMap"),
("RO_SPACE", 0x0a399): (180, "PromiseResolveThenableJobTaskMap"),
("RO_SPACE", 0x0a3e9): (181, "AllocationSiteMap"),
("RO_SPACE", 0x0a439): (181, "AllocationSiteMap"),
("RO_SPACE", 0x0a3e9): (181, "MicrotaskQueueMap"),
("RO_SPACE", 0x0a439): (182, "AllocationSiteMap"),
("RO_SPACE", 0x0a489): (182, "AllocationSiteMap"),
("MAP_SPACE", 0x02201): (1057, "ExternalMap"),
("MAP_SPACE", 0x02251): (1072, "JSMessageObjectMap"),
}