node-linux-arm64 19.8.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +211 -1500
  2. package/README.md +28 -23
  3. package/bin/node +0 -0
  4. package/include/node/common.gypi +1 -1
  5. package/include/node/config.gypi +14 -7
  6. package/include/node/libplatform/v8-tracing.h +2 -2
  7. package/include/node/node.h +22 -35
  8. package/include/node/node_api.h +17 -59
  9. package/include/node/node_version.h +3 -3
  10. package/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h +1 -1
  11. package/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +1 -1
  12. package/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +1 -1
  13. package/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +1 -1
  14. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  15. package/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +1 -1
  16. package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
  17. package/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +1 -1
  18. package/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +1 -1
  19. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +1 -1
  20. package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
  21. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +1 -1
  22. package/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +1 -1
  23. package/include/node/openssl/archs/aix64-gcc-as/asm/crypto/buildinf.h +1 -1
  24. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +1 -1
  25. package/include/node/openssl/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +1 -1
  26. package/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +1 -1
  27. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +1 -1
  28. package/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +1 -1
  29. package/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +1 -1
  30. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +1 -1
  31. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +1 -1
  32. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +1 -1
  33. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +1 -1
  34. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +1 -1
  35. package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
  36. package/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +1 -1
  37. package/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +1 -1
  38. package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
  39. package/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +1 -1
  40. package/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +1 -1
  41. package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
  42. package/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +1 -1
  43. package/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +1 -1
  44. package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
  45. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +1 -1
  46. package/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +1 -1
  47. package/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +1 -1
  48. package/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  49. package/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +1 -1
  50. package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
  51. package/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +1 -1
  52. package/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +1 -1
  53. package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
  54. package/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +1 -1
  55. package/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +1 -1
  56. package/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h +1 -1
  57. package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
  58. package/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +1 -1
  59. package/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +1 -1
  60. package/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +1 -1
  61. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +1 -1
  62. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +1 -1
  63. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +1 -1
  64. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +1 -1
  65. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +1 -1
  66. package/include/node/v8-array-buffer.h +59 -0
  67. package/include/node/v8-callbacks.h +14 -1
  68. package/include/node/v8-context.h +50 -3
  69. package/include/node/v8-data.h +1 -1
  70. package/include/node/v8-embedder-heap.h +0 -169
  71. package/include/node/v8-function-callback.h +69 -42
  72. package/include/node/v8-function.h +1 -0
  73. package/include/node/v8-internal.h +242 -150
  74. package/include/node/v8-isolate.h +30 -40
  75. package/include/node/v8-local-handle.h +81 -48
  76. package/include/node/v8-microtask-queue.h +5 -0
  77. package/include/node/v8-object.h +21 -3
  78. package/include/node/v8-persistent-handle.h +25 -16
  79. package/include/node/v8-platform.h +79 -10
  80. package/include/node/v8-primitive.h +19 -12
  81. package/include/node/v8-profiler.h +49 -31
  82. package/include/node/v8-script.h +29 -1
  83. package/include/node/v8-snapshot.h +4 -8
  84. package/include/node/v8-template.h +3 -1
  85. package/include/node/v8-traced-handle.h +22 -28
  86. package/include/node/v8-value.h +31 -4
  87. package/include/node/v8-version.h +4 -4
  88. package/include/node/v8-wasm.h +2 -1
  89. package/include/node/v8config.h +73 -2
  90. package/package.json +1 -1
  91. package/share/doc/node/gdbinit +4 -3
  92. package/share/man/man1/node.1 +17 -1
@@ -7,8 +7,11 @@
7
7
 
8
8
  #include <stdint.h>
9
9
 
10
+ #include <vector>
11
+
10
12
  #include "v8-data.h" // NOLINT(build/include_directory)
11
13
  #include "v8-local-handle.h" // NOLINT(build/include_directory)
14
+ #include "v8-maybe.h" // NOLINT(build/include_directory)
12
15
  #include "v8-snapshot.h" // NOLINT(build/include_directory)
13
16
  #include "v8config.h" // NOLINT(build/include_directory)
14
17
 
@@ -163,12 +166,51 @@ class V8_EXPORT Context : public Data {
163
166
  */
164
167
  void Exit();
165
168
 
169
+ /**
170
+ * Delegate to help with Deep freezing embedder-specific objects (such as
171
+ * JSApiObjects) that can not be frozen natively.
172
+ */
173
+ class DeepFreezeDelegate {
174
+ public:
175
+ /**
176
+ * Performs embedder-specific operations to freeze the provided embedder
177
+ * object. The provided object *will* be frozen by DeepFreeze after this
178
+ * function returns, so only embedder-specific objects need to be frozen.
179
+ * This function *may not* create new JS objects or perform JS allocations.
180
+ * Any v8 objects reachable from the provided embedder object that should
181
+ * also be considered for freezing should be added to the children_out
182
+ * parameter. Returns true if the operation completed successfully.
183
+ */
184
+ virtual bool FreezeEmbedderObjectAndGetChildren(
185
+ Local<Object> obj, std::vector<Local<Object>>& children_out) = 0;
186
+ };
187
+
188
+ /**
189
+ * Attempts to recursively freeze all objects reachable from this context.
190
+ * Some objects (generators, iterators, non-const closures) can not be frozen
191
+ * and will cause this method to throw an error. An optional delegate can be
192
+ * provided to help freeze embedder-specific objects.
193
+ *
194
+ * Freezing occurs in two steps:
195
+ * 1. "Marking" where we iterate through all objects reachable by this
196
+ * context, accumulating a list of objects that need to be frozen and
197
+ * looking for objects that can't be frozen. This step is separated because
198
+ * it is more efficient when we can assume there is no garbage collection.
199
+ * 2. "Freezing" where we go through the list of objects and freezing them.
200
+ * This effectively requires copying them so it may trigger garbage
201
+ * collection.
202
+ */
203
+ Maybe<void> DeepFreeze(DeepFreezeDelegate* delegate = nullptr);
204
+
166
205
  /** Returns the isolate associated with a current context. */
167
206
  Isolate* GetIsolate();
168
207
 
169
208
  /** Returns the microtask queue associated with a current context. */
170
209
  MicrotaskQueue* GetMicrotaskQueue();
171
210
 
211
+ /** Sets the microtask queue associated with the current context. */
212
+ void SetMicrotaskQueue(MicrotaskQueue* queue);
213
+
172
214
  /**
173
215
  * The field at kDebugIdIndex used to be reserved for the inspector.
174
216
  * It now serves no purpose.
@@ -362,13 +404,18 @@ Local<Value> Context::GetEmbedderData(int index) {
362
404
  #ifdef V8_COMPRESS_POINTERS
363
405
  // We read the full pointer value and then decompress it in order to avoid
364
406
  // dealing with potential endiannes issues.
365
- value =
366
- I::DecompressTaggedAnyField(embedder_data, static_cast<uint32_t>(value));
407
+ value = I::DecompressTaggedField(embedder_data, static_cast<uint32_t>(value));
367
408
  #endif
409
+
410
+ #ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
411
+ return Local<Value>(reinterpret_cast<Value*>(value));
412
+ #else
368
413
  internal::Isolate* isolate = internal::IsolateFromNeverReadOnlySpaceObject(
369
414
  *reinterpret_cast<A*>(this));
370
415
  A* result = HandleScope::CreateHandle(isolate, value);
371
416
  return Local<Value>(reinterpret_cast<Value*>(result));
417
+ #endif
418
+
372
419
  #else
373
420
  return SlowGetEmbedderData(index);
374
421
  #endif
@@ -378,7 +425,7 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
378
425
  #if !defined(V8_ENABLE_CHECKS)
379
426
  using A = internal::Address;
380
427
  using I = internal::Internals;
381
- A ctx = *reinterpret_cast<const A*>(this);
428
+ A ctx = internal::ValueHelper::ValueAsAddress(this);
382
429
  A embedder_data =
383
430
  I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
384
431
  int value_offset = I::kEmbedderDataArrayHeaderSize +
@@ -53,7 +53,7 @@ class V8_EXPORT Data {
53
53
  bool IsContext() const;
54
54
 
55
55
  private:
56
- Data();
56
+ Data() = delete;
57
57
  };
58
58
 
59
59
  /**
@@ -5,27 +5,14 @@
5
5
  #ifndef INCLUDE_V8_EMBEDDER_HEAP_H_
6
6
  #define INCLUDE_V8_EMBEDDER_HEAP_H_
7
7
 
8
- #include <stddef.h>
9
- #include <stdint.h>
10
-
11
- #include <utility>
12
- #include <vector>
13
-
14
- #include "cppgc/common.h"
15
- #include "v8-local-handle.h" // NOLINT(build/include_directory)
16
8
  #include "v8-traced-handle.h" // NOLINT(build/include_directory)
17
9
  #include "v8config.h" // NOLINT(build/include_directory)
18
10
 
19
11
  namespace v8 {
20
12
 
21
- class Data;
22
13
  class Isolate;
23
14
  class Value;
24
15
 
25
- namespace internal {
26
- class LocalEmbedderHeapTracer;
27
- } // namespace internal
28
-
29
16
  /**
30
17
  * Handler for embedder roots on non-unified heap garbage collections.
31
18
  */
@@ -62,162 +49,6 @@ class V8_EXPORT EmbedderRootsHandler {
62
49
  virtual void ResetRoot(const v8::TracedReference<v8::Value>& handle) = 0;
63
50
  };
64
51
 
65
- /**
66
- * Interface for tracing through the embedder heap. During a V8 garbage
67
- * collection, V8 collects hidden fields of all potential wrappers, and at the
68
- * end of its marking phase iterates the collection and asks the embedder to
69
- * trace through its heap and use reporter to report each JavaScript object
70
- * reachable from any of the given wrappers.
71
- */
72
- class V8_EXPORT
73
- // GCC doesn't like combining __attribute__(()) with [[deprecated]].
74
- #ifdef __clang__
75
- V8_DEPRECATE_SOON("Use CppHeap when working with v8::TracedReference.")
76
- #endif // __clang__
77
- EmbedderHeapTracer {
78
- public:
79
- using EmbedderStackState = cppgc::EmbedderStackState;
80
-
81
- enum TraceFlags : uint64_t {
82
- kNoFlags = 0,
83
- kReduceMemory = 1 << 0,
84
- kForced = 1 << 2,
85
- };
86
-
87
- /**
88
- * Interface for iterating through |TracedReference| handles.
89
- */
90
- class V8_EXPORT TracedGlobalHandleVisitor {
91
- public:
92
- virtual ~TracedGlobalHandleVisitor() = default;
93
- virtual void VisitTracedReference(const TracedReference<Value>& handle) {}
94
- };
95
-
96
- /**
97
- * Summary of a garbage collection cycle. See |TraceEpilogue| on how the
98
- * summary is reported.
99
- */
100
- struct TraceSummary {
101
- /**
102
- * Time spent managing the retained memory in milliseconds. This can e.g.
103
- * include the time tracing through objects in the embedder.
104
- */
105
- double time = 0.0;
106
-
107
- /**
108
- * Memory retained by the embedder through the |EmbedderHeapTracer|
109
- * mechanism in bytes.
110
- */
111
- size_t allocated_size = 0;
112
- };
113
-
114
- virtual ~EmbedderHeapTracer() = default;
115
-
116
- /**
117
- * Iterates all |TracedReference| handles created for the |v8::Isolate| the
118
- * tracer is attached to.
119
- */
120
- void IterateTracedGlobalHandles(TracedGlobalHandleVisitor* visitor);
121
-
122
- /**
123
- * Called by the embedder to set the start of the stack which is e.g. used by
124
- * V8 to determine whether handles are used from stack or heap.
125
- */
126
- void SetStackStart(void* stack_start);
127
-
128
- /**
129
- * Called by v8 to register internal fields of found wrappers.
130
- *
131
- * The embedder is expected to store them somewhere and trace reachable
132
- * wrappers from them when called through |AdvanceTracing|.
133
- */
134
- virtual void RegisterV8References(
135
- const std::vector<std::pair<void*, void*>>& embedder_fields) = 0;
136
-
137
- void RegisterEmbedderReference(const BasicTracedReference<v8::Data>& ref);
138
-
139
- /**
140
- * Called at the beginning of a GC cycle.
141
- */
142
- virtual void TracePrologue(TraceFlags flags) {}
143
-
144
- /**
145
- * Called to advance tracing in the embedder.
146
- *
147
- * The embedder is expected to trace its heap starting from wrappers reported
148
- * by RegisterV8References method, and report back all reachable wrappers.
149
- * Furthermore, the embedder is expected to stop tracing by the given
150
- * deadline. A deadline of infinity means that tracing should be finished.
151
- *
152
- * Returns |true| if tracing is done, and false otherwise.
153
- */
154
- virtual bool AdvanceTracing(double deadline_in_ms) = 0;
155
-
156
- /*
157
- * Returns true if there no more tracing work to be done (see AdvanceTracing)
158
- * and false otherwise.
159
- */
160
- virtual bool IsTracingDone() = 0;
161
-
162
- /**
163
- * Called at the end of a GC cycle.
164
- *
165
- * Note that allocation is *not* allowed within |TraceEpilogue|. Can be
166
- * overriden to fill a |TraceSummary| that is used by V8 to schedule future
167
- * garbage collections.
168
- */
169
- virtual void TraceEpilogue(TraceSummary* trace_summary) {}
170
-
171
- /**
172
- * Called upon entering the final marking pause. No more incremental marking
173
- * steps will follow this call.
174
- */
175
- virtual void EnterFinalPause(EmbedderStackState stack_state) = 0;
176
-
177
- /*
178
- * Called by the embedder to request immediate finalization of the currently
179
- * running tracing phase that has been started with TracePrologue and not
180
- * yet finished with TraceEpilogue.
181
- *
182
- * Will be a noop when currently not in tracing.
183
- *
184
- * This is an experimental feature.
185
- */
186
- void FinalizeTracing();
187
-
188
- /**
189
- * See documentation on EmbedderRootsHandler.
190
- */
191
- virtual bool IsRootForNonTracingGC(
192
- const v8::TracedReference<v8::Value>& handle);
193
-
194
- /**
195
- * See documentation on EmbedderRootsHandler.
196
- */
197
- virtual void ResetHandleInNonTracingGC(
198
- const v8::TracedReference<v8::Value>& handle);
199
-
200
- /*
201
- * Called by the embedder to signal newly allocated or freed memory. Not bound
202
- * to tracing phases. Embedders should trade off when increments are reported
203
- * as V8 may consult global heuristics on whether to trigger garbage
204
- * collection on this change.
205
- */
206
- void IncreaseAllocatedSize(size_t bytes);
207
- void DecreaseAllocatedSize(size_t bytes);
208
-
209
- /*
210
- * Returns the v8::Isolate this tracer is attached too and |nullptr| if it
211
- * is not attached to any v8::Isolate.
212
- */
213
- v8::Isolate* isolate() const { return v8_isolate_; }
214
-
215
- protected:
216
- v8::Isolate* v8_isolate_ = nullptr;
217
-
218
- friend class internal::LocalEmbedderHeapTracer;
219
- };
220
-
221
52
  } // namespace v8
222
53
 
223
54
  #endif // INCLUDE_V8_EMBEDDER_HEAP_H_
@@ -21,6 +21,7 @@ class Value;
21
21
  namespace internal {
22
22
  class FunctionCallbackArguments;
23
23
  class PropertyCallbackArguments;
24
+ class Builtins;
24
25
  } // namespace internal
25
26
 
26
27
  namespace debug {
@@ -74,6 +75,11 @@ class ReturnValue {
74
75
  V8_INLINE void SetInternal(internal::Address value) { *value_ = value; }
75
76
  V8_INLINE internal::Address GetDefaultValue();
76
77
  V8_INLINE explicit ReturnValue(internal::Address* slot);
78
+
79
+ // See FunctionCallbackInfo.
80
+ static constexpr int kIsolateValueIndex = -2;
81
+ static constexpr int kDefaultValueValueIndex = -1;
82
+
77
83
  internal::Address* value_;
78
84
  };
79
85
 
@@ -116,19 +122,35 @@ class FunctionCallbackInfo {
116
122
  V8_INLINE Isolate* GetIsolate() const;
117
123
  /** The ReturnValue for the call. */
118
124
  V8_INLINE ReturnValue<T> GetReturnValue() const;
119
- // This shouldn't be public, but the arm compiler needs it.
120
- static const int kArgsLength = 6;
121
125
 
122
- protected:
126
+ private:
123
127
  friend class internal::FunctionCallbackArguments;
124
128
  friend class internal::CustomArguments<FunctionCallbackInfo>;
125
129
  friend class debug::ConsoleCallArguments;
126
- static const int kHolderIndex = 0;
127
- static const int kIsolateIndex = 1;
128
- static const int kReturnValueDefaultValueIndex = 2;
129
- static const int kReturnValueIndex = 3;
130
- static const int kDataIndex = 4;
131
- static const int kNewTargetIndex = 5;
130
+ friend class internal::Builtins;
131
+ static constexpr int kHolderIndex = 0;
132
+ static constexpr int kIsolateIndex = 1;
133
+ static constexpr int kReturnValueDefaultValueIndex = 2;
134
+ static constexpr int kReturnValueIndex = 3;
135
+ static constexpr int kDataIndex = 4;
136
+ static constexpr int kNewTargetIndex = 5;
137
+
138
+ static constexpr int kArgsLength = 6;
139
+ static constexpr int kArgsLengthWithReceiver = 7;
140
+
141
+ // Codegen constants:
142
+ static constexpr int kSize = 3 * internal::kApiSystemPointerSize;
143
+ static constexpr int kImplicitArgsOffset = 0;
144
+ static constexpr int kValuesOffset =
145
+ kImplicitArgsOffset + internal::kApiSystemPointerSize;
146
+ static constexpr int kLengthOffset =
147
+ kValuesOffset + internal::kApiSystemPointerSize;
148
+
149
+ static constexpr int kThisValuesIndex = -1;
150
+ static_assert(ReturnValue<Value>::kDefaultValueValueIndex ==
151
+ kReturnValueDefaultValueIndex - kReturnValueIndex);
152
+ static_assert(ReturnValue<Value>::kIsolateValueIndex ==
153
+ kIsolateIndex - kReturnValueIndex);
132
154
 
133
155
  V8_INLINE FunctionCallbackInfo(internal::Address* implicit_args,
134
156
  internal::Address* values, int length);
@@ -229,22 +251,24 @@ class PropertyCallbackInfo {
229
251
  */
230
252
  V8_INLINE bool ShouldThrowOnError() const;
231
253
 
232
- // This shouldn't be public, but the arm compiler needs it.
233
- static const int kArgsLength = 7;
234
-
235
- protected:
254
+ private:
236
255
  friend class MacroAssembler;
237
256
  friend class internal::PropertyCallbackArguments;
238
257
  friend class internal::CustomArguments<PropertyCallbackInfo>;
239
- static const int kShouldThrowOnErrorIndex = 0;
240
- static const int kHolderIndex = 1;
241
- static const int kIsolateIndex = 2;
242
- static const int kReturnValueDefaultValueIndex = 3;
243
- static const int kReturnValueIndex = 4;
244
- static const int kDataIndex = 5;
245
- static const int kThisIndex = 6;
246
-
247
- V8_INLINE PropertyCallbackInfo(internal::Address* args) : args_(args) {}
258
+ static constexpr int kShouldThrowOnErrorIndex = 0;
259
+ static constexpr int kHolderIndex = 1;
260
+ static constexpr int kIsolateIndex = 2;
261
+ static constexpr int kReturnValueDefaultValueIndex = 3;
262
+ static constexpr int kReturnValueIndex = 4;
263
+ static constexpr int kDataIndex = 5;
264
+ static constexpr int kThisIndex = 6;
265
+
266
+ static constexpr int kArgsLength = 7;
267
+
268
+ static constexpr int kSize = 1 * internal::kApiSystemPointerSize;
269
+
270
+ V8_INLINE explicit PropertyCallbackInfo(internal::Address* args)
271
+ : args_(args) {}
248
272
  internal::Address* args_;
249
273
  };
250
274
 
@@ -285,7 +309,7 @@ void ReturnValue<T>::Set(const Local<S> handle) {
285
309
  if (V8_UNLIKELY(handle.IsEmpty())) {
286
310
  *value_ = GetDefaultValue();
287
311
  } else {
288
- *value_ = *reinterpret_cast<internal::Address*>(*handle);
312
+ *value_ = internal::ValueHelper::ValueAsAddress(*handle);
289
313
  }
290
314
  }
291
315
 
@@ -328,41 +352,46 @@ void ReturnValue<T>::Set(bool value) {
328
352
  } else {
329
353
  root_index = I::kFalseValueRootIndex;
330
354
  }
331
- *value_ = *I::GetRoot(GetIsolate(), root_index);
355
+ *value_ = I::GetRoot(GetIsolate(), root_index);
332
356
  }
333
357
 
334
358
  template <typename T>
335
359
  void ReturnValue<T>::SetNull() {
336
360
  static_assert(std::is_base_of<T, Primitive>::value, "type check");
337
361
  using I = internal::Internals;
338
- *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
362
+ *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
339
363
  }
340
364
 
341
365
  template <typename T>
342
366
  void ReturnValue<T>::SetUndefined() {
343
367
  static_assert(std::is_base_of<T, Primitive>::value, "type check");
344
368
  using I = internal::Internals;
345
- *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
369
+ *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
346
370
  }
347
371
 
348
372
  template <typename T>
349
373
  void ReturnValue<T>::SetEmptyString() {
350
374
  static_assert(std::is_base_of<T, String>::value, "type check");
351
375
  using I = internal::Internals;
352
- *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
376
+ *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
353
377
  }
354
378
 
355
379
  template <typename T>
356
380
  Isolate* ReturnValue<T>::GetIsolate() const {
357
381
  // Isolate is always the pointer below the default value on the stack.
358
- return *reinterpret_cast<Isolate**>(&value_[-2]);
382
+ return *reinterpret_cast<Isolate**>(&value_[kIsolateValueIndex]);
359
383
  }
360
384
 
361
385
  template <typename T>
362
386
  Local<Value> ReturnValue<T>::Get() const {
363
387
  using I = internal::Internals;
364
- if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
365
- return Local<Value>(*Undefined(GetIsolate()));
388
+ #if V8_STATIC_ROOTS_BOOL
389
+ if (I::is_identical(*value_, I::StaticReadOnlyRoot::kTheHoleValue)) {
390
+ #else
391
+ if (*value_ == I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex)) {
392
+ #endif
393
+ return Undefined(GetIsolate());
394
+ }
366
395
  return Local<Value>::New(GetIsolate(), reinterpret_cast<Value*>(value_));
367
396
  }
368
397
 
@@ -375,7 +404,7 @@ void ReturnValue<T>::Set(S* whatever) {
375
404
  template <typename T>
376
405
  internal::Address ReturnValue<T>::GetDefaultValue() {
377
406
  // Default value is always the pointer below value_ on the stack.
378
- return value_[-1];
407
+ return value_[kDefaultValueValueIndex];
379
408
  }
380
409
 
381
410
  template <typename T>
@@ -387,31 +416,29 @@ FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Address* implicit_args,
387
416
  template <typename T>
388
417
  Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
389
418
  // values_ points to the first argument (not the receiver).
390
- if (i < 0 || length_ <= i) return Local<Value>(*Undefined(GetIsolate()));
391
- return Local<Value>(reinterpret_cast<Value*>(values_ + i));
419
+ if (i < 0 || length_ <= i) return Undefined(GetIsolate());
420
+ return Local<Value>::FromSlot(values_ + i);
392
421
  }
393
422
 
394
423
  template <typename T>
395
424
  Local<Object> FunctionCallbackInfo<T>::This() const {
396
425
  // values_ points to the first argument (not the receiver).
397
- return Local<Object>(reinterpret_cast<Object*>(values_ - 1));
426
+ return Local<Object>::FromSlot(values_ + kThisValuesIndex);
398
427
  }
399
428
 
400
429
  template <typename T>
401
430
  Local<Object> FunctionCallbackInfo<T>::Holder() const {
402
- return Local<Object>(
403
- reinterpret_cast<Object*>(&implicit_args_[kHolderIndex]));
431
+ return Local<Object>::FromSlot(&implicit_args_[kHolderIndex]);
404
432
  }
405
433
 
406
434
  template <typename T>
407
435
  Local<Value> FunctionCallbackInfo<T>::NewTarget() const {
408
- return Local<Value>(
409
- reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex]));
436
+ return Local<Value>::FromSlot(&implicit_args_[kNewTargetIndex]);
410
437
  }
411
438
 
412
439
  template <typename T>
413
440
  Local<Value> FunctionCallbackInfo<T>::Data() const {
414
- return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
441
+ return Local<Value>::FromSlot(&implicit_args_[kDataIndex]);
415
442
  }
416
443
 
417
444
  template <typename T>
@@ -441,17 +468,17 @@ Isolate* PropertyCallbackInfo<T>::GetIsolate() const {
441
468
 
442
469
  template <typename T>
443
470
  Local<Value> PropertyCallbackInfo<T>::Data() const {
444
- return Local<Value>(reinterpret_cast<Value*>(&args_[kDataIndex]));
471
+ return Local<Value>::FromSlot(&args_[kDataIndex]);
445
472
  }
446
473
 
447
474
  template <typename T>
448
475
  Local<Object> PropertyCallbackInfo<T>::This() const {
449
- return Local<Object>(reinterpret_cast<Object*>(&args_[kThisIndex]));
476
+ return Local<Object>::FromSlot(&args_[kThisIndex]);
450
477
  }
451
478
 
452
479
  template <typename T>
453
480
  Local<Object> PropertyCallbackInfo<T>::Holder() const {
454
- return Local<Object>(reinterpret_cast<Object*>(&args_[kHolderIndex]));
481
+ return Local<Object>::FromSlot(&args_[kHolderIndex]);
455
482
  }
456
483
 
457
484
  template <typename T>
@@ -59,6 +59,7 @@ class V8_EXPORT Function : public Object {
59
59
  void SetName(Local<String> name);
60
60
  Local<Value> GetName() const;
61
61
 
62
+ V8_DEPRECATED("No direct replacement")
62
63
  MaybeLocal<UnboundScript> GetUnboundScript() const;
63
64
 
64
65
  /**