Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: src/wasm/wasm-external-refs.cc

Issue 2562393002: [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. (Closed)
Patch Set: Rename UseSourcePosition to IsSourcePositionUsed Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <math.h> 5 #include <math.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "include/v8config.h" 10 #include "include/v8config.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 uint32_t word64_popcnt_wrapper(uint64_t* input) { 202 uint32_t word64_popcnt_wrapper(uint64_t* input) {
203 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); 203 return static_cast<uint32_t>(base::bits::CountPopulation(*input));
204 } 204 }
205 205
206 void float64_pow_wrapper(double* param0, double* param1) { 206 void float64_pow_wrapper(double* param0, double* param1) {
207 double x = ReadDoubleValue(param0); 207 double x = ReadDoubleValue(param0);
208 double y = ReadDoubleValue(param1); 208 double y = ReadDoubleValue(param1);
209 WriteDoubleValue(param0, Pow(x, y)); 209 WriteDoubleValue(param0, Pow(x, y));
210 } 210 }
211
212 static WasmTrapCallbackForTesting wasm_trap_callback_for_testing = nullptr;
213
214 void set_trap_callback_for_testing(WasmTrapCallbackForTesting callback) {
215 wasm_trap_callback_for_testing = callback;
216 }
217
218 void call_trap_callback_for_testing() {
219 if (wasm_trap_callback_for_testing) {
220 wasm_trap_callback_for_testing();
221 }
222 }
223
211 } // namespace wasm 224 } // namespace wasm
212 } // namespace internal 225 } // namespace internal
213 } // namespace v8 226 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698