aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/webassembly/instance/index.html
blob: 3141c6809a5428da300b58ea06cb869408c6f05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: WebAssembly.Instance
slug: Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance
translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance
---
<div>{{JSRef}}</div>

<p><strong><code>WebAssembly.Instance</code></strong> 개체는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module">WebAssembly.Module</a>의 상태 저장되고 실행 가능한 인스턴스입니다. <code>Instance</code> 객체에는 JavaScript에서 WebAssembly 코드로 호출 할 수있는 모든 <a href="/ko/docs/WebAssembly/Exported_functions">Exported WebAssembly functions</a>가 포함되어 있습니다.</p>

<p>주어진 {{jsxref ( "WebAssembly.Module")}} 객체를 동기적으로 인스턴스화하기 위해 <code>WebAssembly.Instance()</code> 생성자 함수를 호출 할 수 있습니다. 하지만 <code>Instance</code>를 가져 오는 주요 방법은 비동기 {{jsxref ( "WebAssembly.instantiateStreaming ()")}} 함수를 사용하는 것입니다.</p>

<h2 id="생성자_구문">생성자 구문</h2>

<div class="warning">
<p><strong>중요</strong>: 대형 모듈의 인스턴스화는 비용이 많이들 수 있으므로 개발자는 동기 인스턴스 생성이 절대적으로 필요한 경우에만 Instance () 생성자를 사용해야합니다. 비동기 {{jsxref ( "WebAssembly.instantiateStreaming ()")}} 메서드를 사용하세요.</p>
</div>

<pre class="syntaxbox">var myInstance = new WebAssembly.Instance(<em>module</em>, <em>importObject</em>);</pre>

<h3 id="매개변수">매개변수</h3>

<dl>
 <dt><code><em>module</em></code></dt>
 <dd>인스턴스화 할 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module" title="The Module() constructor of the WebAssembly global object creates a new Module object instance."><code>WebAssembly.Module</code></a> 객체입니다.</dd>
 <dt><code><em>importObject</em></code> {{optional_inline}}</dt>
 <dd>함수 또는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory" title="The Memory() constructor of the WebAssembly global object creates a new Memory object instance, which represents a WebAssembly memory. These can be thought of as resizeable array buffers, wrappers around WebAssembly memories."><code>WebAssembly.Memory</code></a>객체와 같이 새로 생성 된 인스턴스로 가져올 값을 포함하는 객체입니다. 선언 된 각 <code>module</code> 가져오기에 대해 일치하는 속성이 하나 있어야합니다. 그렇지 않으면 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError">WebAssembly.LinkError</a>가 발생합니다.</dd>
</dl>

<h2 id="Instance_인스턴스"><code>Instance</code> 인스턴스</h2>

<p>모든 <code>Instance</code> 인스턴스는 <code>Instance()</code> 생성자의 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/prototype">prototype object</a>에서 상속받습니다.이 인스턴스를 수정하면 모든 <code>Instance</code> 인스턴스에 영향을 줍니다.</p>

<h3 id="인스턴스_속성">인스턴스 속성</h3>

<p>{{page('/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/prototype', 'Properties')}}</p>

<h3 id="인스턴스_메서드">인스턴스 메서드</h3>

<p>{{page('/ko/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/prototype', 'Methods')}}</p>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('WebAssembly JS', '#webassemblyinstance-objects', 'Instance')}}</td>
   <td>{{Spec2('WebAssembly JS')}}</td>
   <td>Initial draft definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">브라우저 호환성</h2>

<div>


<p>{{Compat("javascript.builtins.WebAssembly.Instance")}}</p>
</div>

<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li><a href="/ko/docs/WebAssembly">WebAssembly</a> overview page</li>
 <li><a href="/ko/docs/WebAssembly/Concepts">WebAssembly concepts</a></li>
 <li><a href="/ko/docs/WebAssembly/Using_the_JavaScript_API">Using the WebAssembly JavaScript API</a></li>
</ul>