OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/compiler/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/assembler-inl.h" | 9 #include "src/assembler-inl.h" |
10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 3228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 return graph()->NewNode(jsgraph()->machine()->F32x4Le(), inputs[1], | 3239 return graph()->NewNode(jsgraph()->machine()->F32x4Le(), inputs[1], |
3240 inputs[0]); | 3240 inputs[0]); |
3241 case wasm::kExprI32x4Splat: | 3241 case wasm::kExprI32x4Splat: |
3242 return graph()->NewNode(jsgraph()->machine()->I32x4Splat(), inputs[0]); | 3242 return graph()->NewNode(jsgraph()->machine()->I32x4Splat(), inputs[0]); |
3243 case wasm::kExprI32x4SConvertF32x4: | 3243 case wasm::kExprI32x4SConvertF32x4: |
3244 return graph()->NewNode(jsgraph()->machine()->I32x4SConvertF32x4(), | 3244 return graph()->NewNode(jsgraph()->machine()->I32x4SConvertF32x4(), |
3245 inputs[0]); | 3245 inputs[0]); |
3246 case wasm::kExprI32x4UConvertF32x4: | 3246 case wasm::kExprI32x4UConvertF32x4: |
3247 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertF32x4(), | 3247 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertF32x4(), |
3248 inputs[0]); | 3248 inputs[0]); |
| 3249 case wasm::kExprI32x4SConvertI16x8Low: |
| 3250 return graph()->NewNode(jsgraph()->machine()->I32x4SConvertI16x8Low(), |
| 3251 inputs[0]); |
| 3252 case wasm::kExprI32x4SConvertI16x8High: |
| 3253 return graph()->NewNode(jsgraph()->machine()->I32x4SConvertI16x8High(), |
| 3254 inputs[0]); |
3249 case wasm::kExprI32x4Neg: | 3255 case wasm::kExprI32x4Neg: |
3250 return graph()->NewNode(jsgraph()->machine()->I32x4Neg(), inputs[0]); | 3256 return graph()->NewNode(jsgraph()->machine()->I32x4Neg(), inputs[0]); |
3251 case wasm::kExprI32x4Add: | 3257 case wasm::kExprI32x4Add: |
3252 return graph()->NewNode(jsgraph()->machine()->I32x4Add(), inputs[0], | 3258 return graph()->NewNode(jsgraph()->machine()->I32x4Add(), inputs[0], |
3253 inputs[1]); | 3259 inputs[1]); |
3254 case wasm::kExprI32x4Sub: | 3260 case wasm::kExprI32x4Sub: |
3255 return graph()->NewNode(jsgraph()->machine()->I32x4Sub(), inputs[0], | 3261 return graph()->NewNode(jsgraph()->machine()->I32x4Sub(), inputs[0], |
3256 inputs[1]); | 3262 inputs[1]); |
3257 case wasm::kExprI32x4Mul: | 3263 case wasm::kExprI32x4Mul: |
3258 return graph()->NewNode(jsgraph()->machine()->I32x4Mul(), inputs[0], | 3264 return graph()->NewNode(jsgraph()->machine()->I32x4Mul(), inputs[0], |
(...skipping 15 matching lines...) Expand all Loading... |
3274 inputs[1]); | 3280 inputs[1]); |
3275 case wasm::kExprI32x4LeS: | 3281 case wasm::kExprI32x4LeS: |
3276 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[0], | 3282 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[0], |
3277 inputs[1]); | 3283 inputs[1]); |
3278 case wasm::kExprI32x4GtS: | 3284 case wasm::kExprI32x4GtS: |
3279 return graph()->NewNode(jsgraph()->machine()->I32x4LtS(), inputs[1], | 3285 return graph()->NewNode(jsgraph()->machine()->I32x4LtS(), inputs[1], |
3280 inputs[0]); | 3286 inputs[0]); |
3281 case wasm::kExprI32x4GeS: | 3287 case wasm::kExprI32x4GeS: |
3282 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[1], | 3288 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[1], |
3283 inputs[0]); | 3289 inputs[0]); |
| 3290 case wasm::kExprI32x4UConvertI16x8Low: |
| 3291 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8Low(), |
| 3292 inputs[0]); |
| 3293 case wasm::kExprI32x4UConvertI16x8High: |
| 3294 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8High(), |
| 3295 inputs[0]); |
3284 case wasm::kExprI32x4MinU: | 3296 case wasm::kExprI32x4MinU: |
3285 return graph()->NewNode(jsgraph()->machine()->I32x4MinU(), inputs[0], | 3297 return graph()->NewNode(jsgraph()->machine()->I32x4MinU(), inputs[0], |
3286 inputs[1]); | 3298 inputs[1]); |
3287 case wasm::kExprI32x4MaxU: | 3299 case wasm::kExprI32x4MaxU: |
3288 return graph()->NewNode(jsgraph()->machine()->I32x4MaxU(), inputs[0], | 3300 return graph()->NewNode(jsgraph()->machine()->I32x4MaxU(), inputs[0], |
3289 inputs[1]); | 3301 inputs[1]); |
3290 case wasm::kExprI32x4LtU: | 3302 case wasm::kExprI32x4LtU: |
3291 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[0], | 3303 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[0], |
3292 inputs[1]); | 3304 inputs[1]); |
3293 case wasm::kExprI32x4LeU: | 3305 case wasm::kExprI32x4LeU: |
3294 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[0], | 3306 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[0], |
3295 inputs[1]); | 3307 inputs[1]); |
3296 case wasm::kExprI32x4GtU: | 3308 case wasm::kExprI32x4GtU: |
3297 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[1], | 3309 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[1], |
3298 inputs[0]); | 3310 inputs[0]); |
3299 case wasm::kExprI32x4GeU: | 3311 case wasm::kExprI32x4GeU: |
3300 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[1], | 3312 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[1], |
3301 inputs[0]); | 3313 inputs[0]); |
3302 case wasm::kExprI16x8Splat: | 3314 case wasm::kExprI16x8Splat: |
3303 return graph()->NewNode(jsgraph()->machine()->I16x8Splat(), inputs[0]); | 3315 return graph()->NewNode(jsgraph()->machine()->I16x8Splat(), inputs[0]); |
| 3316 case wasm::kExprI16x8SConvertI8x16Low: |
| 3317 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16Low(), |
| 3318 inputs[0]); |
| 3319 case wasm::kExprI16x8SConvertI8x16High: |
| 3320 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16High(), |
| 3321 inputs[0]); |
3304 case wasm::kExprI16x8Neg: | 3322 case wasm::kExprI16x8Neg: |
3305 return graph()->NewNode(jsgraph()->machine()->I16x8Neg(), inputs[0]); | 3323 return graph()->NewNode(jsgraph()->machine()->I16x8Neg(), inputs[0]); |
| 3324 case wasm::kExprI16x8SConvertI32x4: |
| 3325 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI32x4(), |
| 3326 inputs[0], inputs[1]); |
3306 case wasm::kExprI16x8Add: | 3327 case wasm::kExprI16x8Add: |
3307 return graph()->NewNode(jsgraph()->machine()->I16x8Add(), inputs[0], | 3328 return graph()->NewNode(jsgraph()->machine()->I16x8Add(), inputs[0], |
3308 inputs[1]); | 3329 inputs[1]); |
3309 case wasm::kExprI16x8AddSaturateS: | 3330 case wasm::kExprI16x8AddSaturateS: |
3310 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateS(), | 3331 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateS(), |
3311 inputs[0], inputs[1]); | 3332 inputs[0], inputs[1]); |
3312 case wasm::kExprI16x8Sub: | 3333 case wasm::kExprI16x8Sub: |
3313 return graph()->NewNode(jsgraph()->machine()->I16x8Sub(), inputs[0], | 3334 return graph()->NewNode(jsgraph()->machine()->I16x8Sub(), inputs[0], |
3314 inputs[1]); | 3335 inputs[1]); |
3315 case wasm::kExprI16x8SubSaturateS: | 3336 case wasm::kExprI16x8SubSaturateS: |
(...skipping 19 matching lines...) Expand all Loading... |
3335 inputs[1]); | 3356 inputs[1]); |
3336 case wasm::kExprI16x8LeS: | 3357 case wasm::kExprI16x8LeS: |
3337 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[0], | 3358 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[0], |
3338 inputs[1]); | 3359 inputs[1]); |
3339 case wasm::kExprI16x8GtS: | 3360 case wasm::kExprI16x8GtS: |
3340 return graph()->NewNode(jsgraph()->machine()->I16x8LtS(), inputs[1], | 3361 return graph()->NewNode(jsgraph()->machine()->I16x8LtS(), inputs[1], |
3341 inputs[0]); | 3362 inputs[0]); |
3342 case wasm::kExprI16x8GeS: | 3363 case wasm::kExprI16x8GeS: |
3343 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[1], | 3364 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[1], |
3344 inputs[0]); | 3365 inputs[0]); |
| 3366 case wasm::kExprI16x8UConvertI8x16Low: |
| 3367 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16Low(), |
| 3368 inputs[0]); |
| 3369 case wasm::kExprI16x8UConvertI8x16High: |
| 3370 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16High(), |
| 3371 inputs[0]); |
| 3372 case wasm::kExprI16x8UConvertI32x4: |
| 3373 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI32x4(), |
| 3374 inputs[0], inputs[1]); |
3345 case wasm::kExprI16x8AddSaturateU: | 3375 case wasm::kExprI16x8AddSaturateU: |
3346 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateU(), | 3376 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateU(), |
3347 inputs[0], inputs[1]); | 3377 inputs[0], inputs[1]); |
3348 case wasm::kExprI16x8SubSaturateU: | 3378 case wasm::kExprI16x8SubSaturateU: |
3349 return graph()->NewNode(jsgraph()->machine()->I16x8SubSaturateU(), | 3379 return graph()->NewNode(jsgraph()->machine()->I16x8SubSaturateU(), |
3350 inputs[0], inputs[1]); | 3380 inputs[0], inputs[1]); |
3351 case wasm::kExprI16x8MinU: | 3381 case wasm::kExprI16x8MinU: |
3352 return graph()->NewNode(jsgraph()->machine()->I16x8MinU(), inputs[0], | 3382 return graph()->NewNode(jsgraph()->machine()->I16x8MinU(), inputs[0], |
3353 inputs[1]); | 3383 inputs[1]); |
3354 case wasm::kExprI16x8MaxU: | 3384 case wasm::kExprI16x8MaxU: |
3355 return graph()->NewNode(jsgraph()->machine()->I16x8MaxU(), inputs[0], | 3385 return graph()->NewNode(jsgraph()->machine()->I16x8MaxU(), inputs[0], |
3356 inputs[1]); | 3386 inputs[1]); |
3357 case wasm::kExprI16x8LtU: | 3387 case wasm::kExprI16x8LtU: |
3358 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[0], | 3388 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[0], |
3359 inputs[1]); | 3389 inputs[1]); |
3360 case wasm::kExprI16x8LeU: | 3390 case wasm::kExprI16x8LeU: |
3361 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[0], | 3391 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[0], |
3362 inputs[1]); | 3392 inputs[1]); |
3363 case wasm::kExprI16x8GtU: | 3393 case wasm::kExprI16x8GtU: |
3364 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[1], | 3394 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[1], |
3365 inputs[0]); | 3395 inputs[0]); |
3366 case wasm::kExprI16x8GeU: | 3396 case wasm::kExprI16x8GeU: |
3367 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[1], | 3397 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[1], |
3368 inputs[0]); | 3398 inputs[0]); |
3369 case wasm::kExprI8x16Splat: | 3399 case wasm::kExprI8x16Splat: |
3370 return graph()->NewNode(jsgraph()->machine()->I8x16Splat(), inputs[0]); | 3400 return graph()->NewNode(jsgraph()->machine()->I8x16Splat(), inputs[0]); |
3371 case wasm::kExprI8x16Neg: | 3401 case wasm::kExprI8x16Neg: |
3372 return graph()->NewNode(jsgraph()->machine()->I8x16Neg(), inputs[0]); | 3402 return graph()->NewNode(jsgraph()->machine()->I8x16Neg(), inputs[0]); |
| 3403 case wasm::kExprI8x16SConvertI16x8: |
| 3404 return graph()->NewNode(jsgraph()->machine()->I8x16SConvertI16x8(), |
| 3405 inputs[0], inputs[1]); |
3373 case wasm::kExprI8x16Add: | 3406 case wasm::kExprI8x16Add: |
3374 return graph()->NewNode(jsgraph()->machine()->I8x16Add(), inputs[0], | 3407 return graph()->NewNode(jsgraph()->machine()->I8x16Add(), inputs[0], |
3375 inputs[1]); | 3408 inputs[1]); |
3376 case wasm::kExprI8x16AddSaturateS: | 3409 case wasm::kExprI8x16AddSaturateS: |
3377 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateS(), | 3410 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateS(), |
3378 inputs[0], inputs[1]); | 3411 inputs[0], inputs[1]); |
3379 case wasm::kExprI8x16Sub: | 3412 case wasm::kExprI8x16Sub: |
3380 return graph()->NewNode(jsgraph()->machine()->I8x16Sub(), inputs[0], | 3413 return graph()->NewNode(jsgraph()->machine()->I8x16Sub(), inputs[0], |
3381 inputs[1]); | 3414 inputs[1]); |
3382 case wasm::kExprI8x16SubSaturateS: | 3415 case wasm::kExprI8x16SubSaturateS: |
(...skipping 19 matching lines...) Expand all Loading... |
3402 inputs[1]); | 3435 inputs[1]); |
3403 case wasm::kExprI8x16LeS: | 3436 case wasm::kExprI8x16LeS: |
3404 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[0], | 3437 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[0], |
3405 inputs[1]); | 3438 inputs[1]); |
3406 case wasm::kExprI8x16GtS: | 3439 case wasm::kExprI8x16GtS: |
3407 return graph()->NewNode(jsgraph()->machine()->I8x16LtS(), inputs[1], | 3440 return graph()->NewNode(jsgraph()->machine()->I8x16LtS(), inputs[1], |
3408 inputs[0]); | 3441 inputs[0]); |
3409 case wasm::kExprI8x16GeS: | 3442 case wasm::kExprI8x16GeS: |
3410 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[1], | 3443 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[1], |
3411 inputs[0]); | 3444 inputs[0]); |
| 3445 case wasm::kExprI8x16UConvertI16x8: |
| 3446 return graph()->NewNode(jsgraph()->machine()->I8x16UConvertI16x8(), |
| 3447 inputs[0], inputs[1]); |
3412 case wasm::kExprI8x16AddSaturateU: | 3448 case wasm::kExprI8x16AddSaturateU: |
3413 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateU(), | 3449 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateU(), |
3414 inputs[0], inputs[1]); | 3450 inputs[0], inputs[1]); |
3415 case wasm::kExprI8x16SubSaturateU: | 3451 case wasm::kExprI8x16SubSaturateU: |
3416 return graph()->NewNode(jsgraph()->machine()->I8x16SubSaturateU(), | 3452 return graph()->NewNode(jsgraph()->machine()->I8x16SubSaturateU(), |
3417 inputs[0], inputs[1]); | 3453 inputs[0], inputs[1]); |
3418 case wasm::kExprI8x16MinU: | 3454 case wasm::kExprI8x16MinU: |
3419 return graph()->NewNode(jsgraph()->machine()->I8x16MinU(), inputs[0], | 3455 return graph()->NewNode(jsgraph()->machine()->I8x16MinU(), inputs[0], |
3420 inputs[1]); | 3456 inputs[1]); |
3421 case wasm::kExprI8x16MaxU: | 3457 case wasm::kExprI8x16MaxU: |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4090 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
4055 WasmCompilationUnit unit(isolate, module_env, function); | 4091 WasmCompilationUnit unit(isolate, module_env, function); |
4056 unit.InitializeHandles(); | 4092 unit.InitializeHandles(); |
4057 unit.ExecuteCompilation(); | 4093 unit.ExecuteCompilation(); |
4058 return unit.FinishCompilation(thrower); | 4094 return unit.FinishCompilation(thrower); |
4059 } | 4095 } |
4060 | 4096 |
4061 } // namespace compiler | 4097 } // namespace compiler |
4062 } // namespace internal | 4098 } // namespace internal |
4063 } // namespace v8 | 4099 } // namespace v8 |
OLD | NEW |