summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects
diff options
context:
space:
mode:
authorJan Krems <jan.krems@groupon.com>2017-11-09 06:46:20 -0800
committerJan Krems <jan.krems@groupon.com>2017-11-25 12:21:21 -0800
commit3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92 (patch)
tree4210be30683132d5d2834444fb4e00b16de82612 /deps/v8/src/objects
parent29423b49c78f7880fa07f52447ce17c2c4aff5bc (diff)
downloadandroid-node-v8-3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92.tar.gz
android-node-v8-3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92.tar.bz2
android-node-v8-3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92.zip
deps: cherry-pick dbfe4a49d8 from upstream V8
Original commit message: Introduce ScriptOrModule and HostDefinedOptions This patch introduces a new container type ScriptOrModule which provides the name and the host defined options of the script/module. This patch also introduces a new PrimitivesArray that can hold Primitive values, which the embedder can use to store metadata. The HostDefinedOptions is passed to V8 through the ScriptOrigin, and passed back to the embedder through HostImportModuleDynamically for module loading. Bug: v8:5785, v8:6658, v8:6683 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I56c26fc9a680b273ac0a6691e5ad75f15b8dc80a Reviewed-on: https://chromium-review.googlesource.com/622158 Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#47724} PR-URL: https://github.com/nodejs/node/pull/16889 Refs: https://github.com/v8/v8/commit/dbfe4a49d88f6655ed31285a40b63786ab1e8e49 Refs: https://github.com/nodejs/node/pull/15713 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'deps/v8/src/objects')
-rw-r--r--deps/v8/src/objects/script-inl.h1
-rw-r--r--deps/v8/src/objects/script.h7
2 files changed, 7 insertions, 1 deletions
diff --git a/deps/v8/src/objects/script-inl.h b/deps/v8/src/objects/script-inl.h
index 7a639080c7..6ea98f409e 100644
--- a/deps/v8/src/objects/script-inl.h
+++ b/deps/v8/src/objects/script-inl.h
@@ -34,6 +34,7 @@ ACCESSORS(Script, shared_function_infos, FixedArray, kSharedFunctionInfosOffset)
SMI_ACCESSORS(Script, flags, kFlagsOffset)
ACCESSORS(Script, source_url, Object, kSourceUrlOffset)
ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset)
+ACCESSORS(Script, host_defined_options, FixedArray, kHostDefinedOptionsOffset)
ACCESSORS_CHECKED(Script, wasm_compiled_module, Object, kEvalFromSharedOffset,
this->type() == TYPE_WASM)
diff --git a/deps/v8/src/objects/script.h b/deps/v8/src/objects/script.h
index fc9385d609..a6d2c1d825 100644
--- a/deps/v8/src/objects/script.h
+++ b/deps/v8/src/objects/script.h
@@ -88,6 +88,9 @@ class Script : public Struct {
// This must only be called if the type of this script is TYPE_WASM.
DECL_ACCESSORS(wasm_compiled_module, Object)
+ // [host_defined_options]: Options defined by the embedder.
+ DECL_ACCESSORS(host_defined_options, FixedArray)
+
// [compilation_type]: how the the script was compiled. Encoded in the
// 'flags' field.
inline CompilationType compilation_type();
@@ -195,7 +198,9 @@ class Script : public Struct {
static const int kFlagsOffset = kSharedFunctionInfosOffset + kPointerSize;
static const int kSourceUrlOffset = kFlagsOffset + kPointerSize;
static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize;
- static const int kSize = kSourceMappingUrlOffset + kPointerSize;
+ static const int kHostDefinedOptionsOffset =
+ kSourceMappingUrlOffset + kPointerSize;
+ static const int kSize = kHostDefinedOptionsOffset + kPointerSize;
private:
// Bit positions in the flags field.