Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL MP.wast.js   Interaktion und
Portierbarkeitunbekannt

 
/* Copyright 2021 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


// ./test/core/threads/MP.wast

// ./test/core/threads/MP.wast:1
let $0 = instantiate(`(module \$Mem
  (memory (export "shared"1 1 shared)
)`);
let $Mem = $0;

// ./test/core/threads/MP.wast:4
register($0, `mem`);

// ./test/core/threads/MP.wast:6
let $T1 = new Thread($Mem, "$Mem", `

// ./test/core/threads/MP.wast:7:3
register(\$Mem, \`mem\`);

// ./test/core/threads/MP.wast:8:3
let \$1 = instantiate(\`(module
    (memory (import "mem" "shared"1 1 shared)
    (func (export "run")
      (i32.store (i32.const 0) (i32.const 42))
      (i32.store (i32.const 4) (i32.const 1))
    )
  )\`);

// ./test/core/threads/MP.wast:15:3
invoke(\$1, \`run\`, []);
`);

// ./test/core/threads/MP.wast:18
let $T2 = new Thread($Mem, "$Mem", `

// ./test/core/threads/MP.wast:19:3
register(\$Mem, \`mem\`);

// ./test/core/threads/MP.wast:20:3
let \$2 = instantiate(\`(module
    (memory (import "mem" "shared"1 1 shared)
    (func (export "run")
      (local i32 i32)
      (i32.load (i32.const 4))
      (local.set 0)
      (i32.load (i32.const 0))
      (local.set 1)

      ;; store results for checking
      (i32.store (i32.const 24) (local.get 0))
      (i32.store (i32.const 32) (local.get 1))
    )
  )\`);

// ./test/core/threads/MP.wast:35:3
invoke(\$2, \`run\`, []);
`);

// ./test/core/threads/MP.wast:38
$T1.wait();

// ./test/core/threads/MP.wast:39
$T2.wait();

// ./test/core/threads/MP.wast:41
let $3 = instantiate(`(module \$Check
  (memory (import "mem" "shared"1 1 shared)

  (func (export "check") (result i32)
    (local i32 i32)
    (i32.load (i32.const 24))
    (local.set 0)
    (i32.load (i32.const 32))
    (local.set 1)

    ;; allowed results: (L_0 = 0 || L_0 = 1) && (L_1 = 0 || L_1 = 42)

    (i32.or (i32.eq (local.get 0) (i32.const 1)) (i32.eq (local.get 0) (i32.const 0)))
    (i32.or (i32.eq (local.get 1) (i32.const 42)) (i32.eq (local.get 1) (i32.const 0)))
    (i32.and)
    (return)
  )
)`);
let $Check = $3;

// ./test/core/threads/MP.wast:60
assert_return(() => invoke($Check, `check`, []), [value("i32"1)]);

Messung V0.5 in Prozent
C=84 H=74 G=78

[Verzeichnis aufwärts0.13unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-08-25]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=655579