GeezerVison is showing github.com — deps: V8: cherry-pick 9df5ef70ff18 · nodejs/node@7d26bf3
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: common.gypi +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 |
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | 39 | | - 'v8_embedder_string': '-node.16', | | 39 | + 'v8_embedder_string': '-node.20', | 40 | 40 |
| 41 | 41 | ##### V8 defaults for Node.js ##### | 42 | 42 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/AUTHORS +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 59 | 59 | | 60 | 60 | | 61 | 61 | | | 62 | + | 62 | 63 | | 63 | 64 | | 64 | 65 | | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/include/v8-array-buffer.h +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -240,6 +240,11 @@ class V8_EXPORT ArrayBuffer : public Object { | 240 | 240 | */ | 241 | 241 | bool IsDetachable() const; | 242 | 242 |
| | 243 | + /** | | 244 | + * Returns true if this ArrayBuffer has been detached. | | 245 | + */ | | 246 | + bool WasDetached() const; | | 247 | + | 243 | 248 | /** | 244 | 249 | * Detaches this ArrayBuffer and all its views (typed arrays). | 245 | 250 | * Detaching sets the byte length of the buffer and all typed arrays to zero, | @@ -253,6 +258,9 @@ class V8_EXPORT ArrayBuffer : public Object { | 253 | 258 | * pointer coordinates the lifetime management of the internal storage | 254 | 259 | * with any live ArrayBuffers on the heap, even across isolates. The embedder | 255 | 260 | * should not attempt to manage lifetime of the storage through other means. | | 261 | + * | | 262 | + * The returned shared pointer will not be empty, even if the ArrayBuffer has | | 263 | + * been detached. Use |WasDetached| to tell if it has been detached instead. | 256 | 264 | */ | 257 | 265 | std::shared_ptr<BackingStore> GetBackingStore(); | 258 | 266 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/api/api.cc +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7917,6 +7917,10 @@ bool v8::ArrayBuffer::IsDetachable() const { | 7917 | 7917 | return Utils::OpenHandle(this)->is_detachable(); | 7918 | 7918 | } | 7919 | 7919 |
| | 7920 | +bool v8::ArrayBuffer::WasDetached() const { | | 7921 | + return Utils::OpenHandle(this)->was_detached(); | | 7922 | +} | | 7923 | + | 7920 | 7924 | namespace { | 7921 | 7925 | std::shared_ptr<i::BackingStore> ToInternal( | 7922 | 7926 | std::shared_ptr<i::BackingStoreBase> backing_store) { | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/test/cctest/cctest.status +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 581 | 581 | 'test-api/WasmSetJitCodeEventHandler': [SKIP], | 582 | 582 | 'test-api-wasm/WasmStreaming*': [SKIP], | 583 | 583 | 'test-api-wasm/WasmCompileToWasmModuleObject': [SKIP], | | 584 | + 'test-api-array-buffer/ArrayBuffer_NonDetachableWasDetached': [SKIP], | 584 | 585 | 'test-backing-store/Run_WasmModule_Buffer_Externalized_Regression_UseAfterFree': [SKIP], | 585 | 586 | 'test-c-wasm-entry/*': [SKIP], | 586 | 587 | 'test-compilation-cache/*': [SKIP], | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/test/cctest/test-api-array-buffer.cc +31Lines changed: 31 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -245,6 +245,37 @@ THREADED_TEST(ArrayBuffer_DetachingScript) { | 245 | 245 | CheckDataViewIsDetached(dv); | 246 | 246 | } | 247 | 247 |
| | 248 | +THREADED_TEST(ArrayBuffer_WasDetached) { | | 249 | + LocalContext env; | | 250 | + v8::Isolate* isolate = env->GetIsolate(); | | 251 | + v8::HandleScope handle_scope(isolate); | | 252 | + | | 253 | + Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, 0); | | 254 | + CHECK(!ab->WasDetached()); | | 255 | + | | 256 | + ab->Detach(); | | 257 | + CHECK(ab->WasDetached()); | | 258 | +} | | 259 | + | | 260 | +THREADED_TEST(ArrayBuffer_NonDetachableWasDetached) { | | 261 | + LocalContext env; | | 262 | + v8::Isolate* isolate = env->GetIsolate(); | | 263 | + v8::HandleScope handle_scope(isolate); | | 264 | + | | 265 | + CompileRun(R"JS( | | 266 | + var wasmMemory = new WebAssembly.Memory({initial: 1, maximum: 2}); | | 267 | + )JS"); | | 268 | + | | 269 | + Local<v8::ArrayBuffer> non_detachable = | | 270 | + CompileRun("wasmMemory.buffer").As<v8::ArrayBuffer>(); | | 271 | + CHECK(!non_detachable->IsDetachable()); | | 272 | + CHECK(!non_detachable->WasDetached()); | | 273 | + | | 274 | + CompileRun("wasmMemory.grow(1)"); | | 275 | + CHECK(!non_detachable->IsDetachable()); | | 276 | + CHECK(non_detachable->WasDetached()); | | 277 | +} | | 278 | + | 248 | 279 | THREADED_TEST(ArrayBuffer_ExternalizeEmpty) { | 249 | 280 | LocalContext env; | 250 | 281 | v8::Isolate* isolate = env->GetIsolate(); | |
|