-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: v8/v8@7.9.317.20...7.9.317.23 PR-URL: #30560 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
- Loading branch information
1 parent
03b5c46
commit cf1f1de
Showing
9 changed files
with
85 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2019 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. | ||
|
||
// Flags: --expose-gc | ||
|
||
let realms = []; | ||
for (let i = 0; i < 4; i++) { | ||
realms.push(Realm.createAllowCrossRealmAccess()); | ||
} | ||
|
||
for (let i = 0; i < 4; i++) { | ||
Realm.detachGlobal(realms[i]); | ||
gc(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2019 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. | ||
|
||
// Flags: --wasm-grow-shared-memory --experimental-wasm-threads | ||
|
||
const kNumWorkers = 100; | ||
const kNumMessages = 50; | ||
|
||
function AllocMemory(initial, maximum = initial) { | ||
return new WebAssembly.Memory({initial : initial, maximum : maximum, shared : true}); | ||
} | ||
|
||
(function RunTest() { | ||
let worker = []; | ||
for (let w = 0; w < kNumWorkers; w++) { | ||
worker[w] = new Worker( | ||
`onmessage = | ||
function(msg) { | ||
msg.memory.grow(1); | ||
}`, {type : 'string'}); | ||
} | ||
|
||
for (let i = 0; i < kNumMessages; i++) { | ||
let memory = AllocMemory(1, 128); | ||
for (let w = 0; w < kNumWorkers; w++) { | ||
worker[w].postMessage({memory : memory}); | ||
} | ||
} | ||
})(); |