v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-external-refs.h
Go to the documentation of this file.
1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_WASM_EXTERNAL_REFS_H_
6#define V8_WASM_WASM_EXTERNAL_REFS_H_
7
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
10#endif // !V8_ENABLE_WEBASSEMBLY
11
12#include <stdint.h>
13
14#include "src/base/macros.h"
15
16namespace v8 {
17namespace internal {
18
19class Isolate;
20
21namespace wasm {
22
23class StackMemory;
24
25using Address = uintptr_t;
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
79V8_EXPORT_PRIVATE uint32_t word32_rol_wrapper(uint32_t input, uint32_t shift);
80
81V8_EXPORT_PRIVATE uint32_t word32_ror_wrapper(uint32_t input, uint32_t shift);
82
83V8_EXPORT_PRIVATE uint64_t word64_rol_wrapper(uint64_t input, uint32_t shift);
84
85V8_EXPORT_PRIVATE uint64_t word64_ror_wrapper(uint64_t input, uint32_t shift);
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
161// The return type is {int32_t} instead of {bool} to enforce the compiler to
162// zero-extend the result in the return register.
163int32_t memory_init_wrapper(Address instance_addr, uint32_t mem_index,
164 uintptr_t dst, uint32_t src, uint32_t seg_index,
165 uint32_t size);
166
167// The return type is {int32_t} instead of {bool} to enforce the compiler to
168// zero-extend the result in the return register.
169int32_t memory_copy_wrapper(Address instance_addr, uint32_t dst_mem_index,
170 uint32_t src_mem_index, uintptr_t dst,
171 uintptr_t src, uintptr_t size);
172
173// The return type is {int32_t} instead of {bool} to enforce the compiler to
174// zero-extend the result in the return register.
175int32_t memory_fill_wrapper(Address instance_addr, uint32_t mem_index,
176 uintptr_t dst, uint8_t value, uintptr_t size);
177
178// Assumes copy ranges are in-bounds and length > 0.
179void array_copy_wrapper(Address raw_dst_array, uint32_t dst_index,
180 Address raw_src_array, uint32_t src_index,
181 uint32_t length);
182
183// The initial value is passed as an int64_t on the stack. Cannot handle s128
184// other than 0.
185void array_fill_wrapper(Address raw_array, uint32_t index, uint32_t length,
186 uint32_t emit_write_barrier, uint32_t raw_type,
187 Address initial_value_addr);
188
189double flat_string_to_f64(Address string_address);
190
191// Update the stack limit after a stack switch,
192// and preserve pending interrupts.
193void switch_stacks(Isolate* isolate, wasm::StackMemory* from);
194// Return {continuation}'s stack memory to the stack pool after it has returned
195// and switched back to its parent, and update the stack limit.
196void return_switch(Isolate* isolate, wasm::StackMemory* from);
197
198intptr_t switch_to_the_central_stack(Isolate* isolate, uintptr_t sp);
199void switch_from_the_central_stack(Isolate* isolate);
200intptr_t switch_to_the_central_stack_for_js(Isolate* isolate, Address fp);
201void switch_from_the_central_stack_for_js(Isolate* isolate);
202Address grow_stack(Isolate* isolate, void* current_sp, size_t frame_size,
203 size_t gap, Address current_fp);
204Address shrink_stack(Isolate* isolate);
205Address load_old_fp(Isolate* isolate);
206
207} // namespace wasm
208} // namespace internal
209} // namespace v8
210
211#endif // V8_WASM_WASM_EXTERNAL_REFS_H_
int int32_t
Definition unicode.cc:40
void f32_trunc_wrapper(Address data)
void f16x8_eq_wrapper(Address data)
void int64_to_float32_wrapper(Address data)
void uint64_to_float32_wrapper(Address data)
void switch_stacks(Isolate *isolate, wasm::StackMemory *from)
void f16x8_min_wrapper(Address data)
int32_t memory_copy_wrapper(Address trusted_data_addr, uint32_t dst_mem_index, uint32_t src_mem_index, uintptr_t dst, uintptr_t src, uintptr_t size)
void f16x8_sqrt_wrapper(Address data)
void f16x8_qfma_wrapper(Address data)
int32_t uint64_div_wrapper(Address data)
void f64_nearest_int_wrapper(Address data)
void f16x8_floor_wrapper(Address data)
void f16x8_abs_wrapper(Address data)
uint32_t word32_rol_wrapper(uint32_t input, uint32_t shift)
void f32x4_floor_wrapper(Address data)
void f16x8_sub_wrapper(Address data)
void f16x8_sconvert_i16x8_wrapper(Address data)
Address shrink_stack(Isolate *isolate)
void float16_to_float32_wrapper(Address data)
uint32_t word32_ror_wrapper(uint32_t input, uint32_t shift)
intptr_t switch_to_the_central_stack_for_js(Isolate *isolate, Address fp)
double flat_string_to_f64(Address string_address)
Address grow_stack(Isolate *isolate, void *current_sp, size_t frame_size, size_t gap, Address current_fp)
void f16x8_demote_f64x2_zero_wrapper(Address data)
int32_t memory_init_wrapper(Address trusted_data_addr, uint32_t mem_index, uintptr_t dst, uint32_t src, uint32_t seg_index, uint32_t size)
void f16x8_pmin_wrapper(Address data)
void f16x8_lt_wrapper(Address data)
void float64_to_uint64_sat_wrapper(Address data)
void switch_from_the_central_stack(Isolate *isolate)
void f64x2_ceil_wrapper(Address data)
void f16x8_nearest_int_wrapper(Address data)
int32_t float32_to_uint64_wrapper(Address data)
void f32_nearest_int_wrapper(Address data)
int32_t float64_to_int64_wrapper(Address data)
int32_t float32_to_int64_wrapper(Address data)
void f16x8_mul_wrapper(Address data)
intptr_t switch_to_the_central_stack(Isolate *isolate, uintptr_t current_sp)
void f64x2_trunc_wrapper(Address data)
uint64_t word64_rol_wrapper(uint64_t input, uint32_t shift)
int32_t memory_fill_wrapper(Address trusted_data_addr, uint32_t mem_index, uintptr_t dst, uint8_t value, uintptr_t size)
void f16x8_neg_wrapper(Address data)
void f16x8_pmax_wrapper(Address data)
int32_t int64_div_wrapper(Address data)
void f64x2_floor_wrapper(Address data)
void f32x4_ceil_wrapper(Address data)
void f16x8_ceil_wrapper(Address data)
void float64_pow_wrapper(Address data)
void float32_to_int64_sat_wrapper(Address data)
void f32x4_trunc_wrapper(Address data)
uint64_t word64_ror_wrapper(uint64_t input, uint32_t shift)
void i16x8_uconvert_f16x8_wrapper(Address data)
void f16x8_div_wrapper(Address data)
void uint64_to_float64_wrapper(Address data)
void float64_to_int64_sat_wrapper(Address data)
void f16x8_trunc_wrapper(Address data)
void i16x8_sconvert_f16x8_wrapper(Address data)
void array_copy_wrapper(Address raw_dst_array, uint32_t dst_index, Address raw_src_array, uint32_t src_index, uint32_t length)
void array_fill_wrapper(Address raw_array, uint32_t index, uint32_t length, uint32_t emit_write_barrier, uint32_t raw_type, Address initial_value_addr)
void f16x8_demote_f32x4_zero_wrapper(Address data)
void f16x8_add_wrapper(Address data)
int32_t uint64_mod_wrapper(Address data)
void f64_ceil_wrapper(Address data)
void f32x4_nearest_int_wrapper(Address data)
void return_switch(Isolate *isolate, wasm::StackMemory *from)
void f16x8_qfms_wrapper(Address data)
void f32_floor_wrapper(Address data)
int32_t float64_to_uint64_wrapper(Address data)
void f16x8_uconvert_i16x8_wrapper(Address data)
void switch_from_the_central_stack_for_js(Isolate *isolate)
Address load_old_fp(Isolate *isolate)
void f16x8_max_wrapper(Address data)
void float32_to_float16_wrapper(Address data)
int32_t int64_mod_wrapper(Address data)
void f64_trunc_wrapper(Address data)
void f32x4_promote_low_f16x8_wrapper(Address data)
void f16x8_ne_wrapper(Address data)
void f64x2_nearest_int_wrapper(Address data)
void f32_ceil_wrapper(Address data)
void f64_floor_wrapper(Address data)
void int64_to_float64_wrapper(Address data)
void float32_to_uint64_sat_wrapper(Address data)
void f16x8_le_wrapper(Address data)
Definition c-api.cc:87
#define V8_EXPORT_PRIVATE
Definition macros.h:460