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 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3289 case wasm::kExprI32x4MaxS: | 3289 case wasm::kExprI32x4MaxS: |
3290 return graph()->NewNode(jsgraph()->machine()->I32x4MaxS(), inputs[0], | 3290 return graph()->NewNode(jsgraph()->machine()->I32x4MaxS(), inputs[0], |
3291 inputs[1]); | 3291 inputs[1]); |
3292 case wasm::kExprI32x4Eq: | 3292 case wasm::kExprI32x4Eq: |
3293 return graph()->NewNode(jsgraph()->machine()->I32x4Eq(), inputs[0], | 3293 return graph()->NewNode(jsgraph()->machine()->I32x4Eq(), inputs[0], |
3294 inputs[1]); | 3294 inputs[1]); |
3295 case wasm::kExprI32x4Ne: | 3295 case wasm::kExprI32x4Ne: |
3296 return graph()->NewNode(jsgraph()->machine()->I32x4Ne(), inputs[0], | 3296 return graph()->NewNode(jsgraph()->machine()->I32x4Ne(), inputs[0], |
3297 inputs[1]); | 3297 inputs[1]); |
3298 case wasm::kExprI32x4LtS: | 3298 case wasm::kExprI32x4LtS: |
3299 return graph()->NewNode(jsgraph()->machine()->I32x4LtS(), inputs[0], | 3299 return graph()->NewNode(jsgraph()->machine()->I32x4GtS(), inputs[1], |
| 3300 inputs[0]); |
| 3301 case wasm::kExprI32x4LeS: |
| 3302 return graph()->NewNode(jsgraph()->machine()->I32x4GeS(), inputs[1], |
| 3303 inputs[0]); |
| 3304 case wasm::kExprI32x4GtS: |
| 3305 return graph()->NewNode(jsgraph()->machine()->I32x4GtS(), inputs[0], |
3300 inputs[1]); | 3306 inputs[1]); |
3301 case wasm::kExprI32x4LeS: | 3307 case wasm::kExprI32x4GeS: |
3302 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[0], | 3308 return graph()->NewNode(jsgraph()->machine()->I32x4GeS(), inputs[0], |
3303 inputs[1]); | 3309 inputs[1]); |
3304 case wasm::kExprI32x4GtS: | |
3305 return graph()->NewNode(jsgraph()->machine()->I32x4LtS(), inputs[1], | |
3306 inputs[0]); | |
3307 case wasm::kExprI32x4GeS: | |
3308 return graph()->NewNode(jsgraph()->machine()->I32x4LeS(), inputs[1], | |
3309 inputs[0]); | |
3310 case wasm::kExprI32x4UConvertI16x8Low: | 3310 case wasm::kExprI32x4UConvertI16x8Low: |
3311 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8Low(), | 3311 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8Low(), |
3312 inputs[0]); | 3312 inputs[0]); |
3313 case wasm::kExprI32x4UConvertI16x8High: | 3313 case wasm::kExprI32x4UConvertI16x8High: |
3314 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8High(), | 3314 return graph()->NewNode(jsgraph()->machine()->I32x4UConvertI16x8High(), |
3315 inputs[0]); | 3315 inputs[0]); |
3316 case wasm::kExprI32x4MinU: | 3316 case wasm::kExprI32x4MinU: |
3317 return graph()->NewNode(jsgraph()->machine()->I32x4MinU(), inputs[0], | 3317 return graph()->NewNode(jsgraph()->machine()->I32x4MinU(), inputs[0], |
3318 inputs[1]); | 3318 inputs[1]); |
3319 case wasm::kExprI32x4MaxU: | 3319 case wasm::kExprI32x4MaxU: |
3320 return graph()->NewNode(jsgraph()->machine()->I32x4MaxU(), inputs[0], | 3320 return graph()->NewNode(jsgraph()->machine()->I32x4MaxU(), inputs[0], |
3321 inputs[1]); | 3321 inputs[1]); |
3322 case wasm::kExprI32x4LtU: | 3322 case wasm::kExprI32x4LtU: |
3323 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[0], | 3323 return graph()->NewNode(jsgraph()->machine()->I32x4GtU(), inputs[1], |
| 3324 inputs[0]); |
| 3325 case wasm::kExprI32x4LeU: |
| 3326 return graph()->NewNode(jsgraph()->machine()->I32x4GeU(), inputs[1], |
| 3327 inputs[0]); |
| 3328 case wasm::kExprI32x4GtU: |
| 3329 return graph()->NewNode(jsgraph()->machine()->I32x4GtU(), inputs[0], |
3324 inputs[1]); | 3330 inputs[1]); |
3325 case wasm::kExprI32x4LeU: | 3331 case wasm::kExprI32x4GeU: |
3326 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[0], | 3332 return graph()->NewNode(jsgraph()->machine()->I32x4GeU(), inputs[0], |
3327 inputs[1]); | 3333 inputs[1]); |
3328 case wasm::kExprI32x4GtU: | |
3329 return graph()->NewNode(jsgraph()->machine()->I32x4LtU(), inputs[1], | |
3330 inputs[0]); | |
3331 case wasm::kExprI32x4GeU: | |
3332 return graph()->NewNode(jsgraph()->machine()->I32x4LeU(), inputs[1], | |
3333 inputs[0]); | |
3334 case wasm::kExprI16x8Splat: | 3334 case wasm::kExprI16x8Splat: |
3335 return graph()->NewNode(jsgraph()->machine()->I16x8Splat(), inputs[0]); | 3335 return graph()->NewNode(jsgraph()->machine()->I16x8Splat(), inputs[0]); |
3336 case wasm::kExprI16x8SConvertI8x16Low: | 3336 case wasm::kExprI16x8SConvertI8x16Low: |
3337 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16Low(), | 3337 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16Low(), |
3338 inputs[0]); | 3338 inputs[0]); |
3339 case wasm::kExprI16x8SConvertI8x16High: | 3339 case wasm::kExprI16x8SConvertI8x16High: |
3340 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16High(), | 3340 return graph()->NewNode(jsgraph()->machine()->I16x8SConvertI8x16High(), |
3341 inputs[0]); | 3341 inputs[0]); |
3342 case wasm::kExprI16x8Neg: | 3342 case wasm::kExprI16x8Neg: |
3343 return graph()->NewNode(jsgraph()->machine()->I16x8Neg(), inputs[0]); | 3343 return graph()->NewNode(jsgraph()->machine()->I16x8Neg(), inputs[0]); |
(...skipping 24 matching lines...) Expand all Loading... |
3368 case wasm::kExprI16x8MaxS: | 3368 case wasm::kExprI16x8MaxS: |
3369 return graph()->NewNode(jsgraph()->machine()->I16x8MaxS(), inputs[0], | 3369 return graph()->NewNode(jsgraph()->machine()->I16x8MaxS(), inputs[0], |
3370 inputs[1]); | 3370 inputs[1]); |
3371 case wasm::kExprI16x8Eq: | 3371 case wasm::kExprI16x8Eq: |
3372 return graph()->NewNode(jsgraph()->machine()->I16x8Eq(), inputs[0], | 3372 return graph()->NewNode(jsgraph()->machine()->I16x8Eq(), inputs[0], |
3373 inputs[1]); | 3373 inputs[1]); |
3374 case wasm::kExprI16x8Ne: | 3374 case wasm::kExprI16x8Ne: |
3375 return graph()->NewNode(jsgraph()->machine()->I16x8Ne(), inputs[0], | 3375 return graph()->NewNode(jsgraph()->machine()->I16x8Ne(), inputs[0], |
3376 inputs[1]); | 3376 inputs[1]); |
3377 case wasm::kExprI16x8LtS: | 3377 case wasm::kExprI16x8LtS: |
3378 return graph()->NewNode(jsgraph()->machine()->I16x8LtS(), inputs[0], | 3378 return graph()->NewNode(jsgraph()->machine()->I16x8GtS(), inputs[1], |
| 3379 inputs[0]); |
| 3380 case wasm::kExprI16x8LeS: |
| 3381 return graph()->NewNode(jsgraph()->machine()->I16x8GeS(), inputs[1], |
| 3382 inputs[0]); |
| 3383 case wasm::kExprI16x8GtS: |
| 3384 return graph()->NewNode(jsgraph()->machine()->I16x8GtS(), inputs[0], |
3379 inputs[1]); | 3385 inputs[1]); |
3380 case wasm::kExprI16x8LeS: | 3386 case wasm::kExprI16x8GeS: |
3381 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[0], | 3387 return graph()->NewNode(jsgraph()->machine()->I16x8GeS(), inputs[0], |
3382 inputs[1]); | 3388 inputs[1]); |
3383 case wasm::kExprI16x8GtS: | |
3384 return graph()->NewNode(jsgraph()->machine()->I16x8LtS(), inputs[1], | |
3385 inputs[0]); | |
3386 case wasm::kExprI16x8GeS: | |
3387 return graph()->NewNode(jsgraph()->machine()->I16x8LeS(), inputs[1], | |
3388 inputs[0]); | |
3389 case wasm::kExprI16x8UConvertI8x16Low: | 3389 case wasm::kExprI16x8UConvertI8x16Low: |
3390 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16Low(), | 3390 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16Low(), |
3391 inputs[0]); | 3391 inputs[0]); |
3392 case wasm::kExprI16x8UConvertI8x16High: | 3392 case wasm::kExprI16x8UConvertI8x16High: |
3393 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16High(), | 3393 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI8x16High(), |
3394 inputs[0]); | 3394 inputs[0]); |
3395 case wasm::kExprI16x8UConvertI32x4: | 3395 case wasm::kExprI16x8UConvertI32x4: |
3396 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI32x4(), | 3396 return graph()->NewNode(jsgraph()->machine()->I16x8UConvertI32x4(), |
3397 inputs[0], inputs[1]); | 3397 inputs[0], inputs[1]); |
3398 case wasm::kExprI16x8AddSaturateU: | 3398 case wasm::kExprI16x8AddSaturateU: |
3399 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateU(), | 3399 return graph()->NewNode(jsgraph()->machine()->I16x8AddSaturateU(), |
3400 inputs[0], inputs[1]); | 3400 inputs[0], inputs[1]); |
3401 case wasm::kExprI16x8SubSaturateU: | 3401 case wasm::kExprI16x8SubSaturateU: |
3402 return graph()->NewNode(jsgraph()->machine()->I16x8SubSaturateU(), | 3402 return graph()->NewNode(jsgraph()->machine()->I16x8SubSaturateU(), |
3403 inputs[0], inputs[1]); | 3403 inputs[0], inputs[1]); |
3404 case wasm::kExprI16x8MinU: | 3404 case wasm::kExprI16x8MinU: |
3405 return graph()->NewNode(jsgraph()->machine()->I16x8MinU(), inputs[0], | 3405 return graph()->NewNode(jsgraph()->machine()->I16x8MinU(), inputs[0], |
3406 inputs[1]); | 3406 inputs[1]); |
3407 case wasm::kExprI16x8MaxU: | 3407 case wasm::kExprI16x8MaxU: |
3408 return graph()->NewNode(jsgraph()->machine()->I16x8MaxU(), inputs[0], | 3408 return graph()->NewNode(jsgraph()->machine()->I16x8MaxU(), inputs[0], |
3409 inputs[1]); | 3409 inputs[1]); |
3410 case wasm::kExprI16x8LtU: | 3410 case wasm::kExprI16x8LtU: |
3411 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[0], | 3411 return graph()->NewNode(jsgraph()->machine()->I16x8GtU(), inputs[1], |
| 3412 inputs[0]); |
| 3413 case wasm::kExprI16x8LeU: |
| 3414 return graph()->NewNode(jsgraph()->machine()->I16x8GeU(), inputs[1], |
| 3415 inputs[0]); |
| 3416 case wasm::kExprI16x8GtU: |
| 3417 return graph()->NewNode(jsgraph()->machine()->I16x8GtU(), inputs[0], |
3412 inputs[1]); | 3418 inputs[1]); |
3413 case wasm::kExprI16x8LeU: | 3419 case wasm::kExprI16x8GeU: |
3414 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[0], | 3420 return graph()->NewNode(jsgraph()->machine()->I16x8GeU(), inputs[0], |
3415 inputs[1]); | 3421 inputs[1]); |
3416 case wasm::kExprI16x8GtU: | |
3417 return graph()->NewNode(jsgraph()->machine()->I16x8LtU(), inputs[1], | |
3418 inputs[0]); | |
3419 case wasm::kExprI16x8GeU: | |
3420 return graph()->NewNode(jsgraph()->machine()->I16x8LeU(), inputs[1], | |
3421 inputs[0]); | |
3422 case wasm::kExprI8x16Splat: | 3422 case wasm::kExprI8x16Splat: |
3423 return graph()->NewNode(jsgraph()->machine()->I8x16Splat(), inputs[0]); | 3423 return graph()->NewNode(jsgraph()->machine()->I8x16Splat(), inputs[0]); |
3424 case wasm::kExprI8x16Neg: | 3424 case wasm::kExprI8x16Neg: |
3425 return graph()->NewNode(jsgraph()->machine()->I8x16Neg(), inputs[0]); | 3425 return graph()->NewNode(jsgraph()->machine()->I8x16Neg(), inputs[0]); |
3426 case wasm::kExprI8x16SConvertI16x8: | 3426 case wasm::kExprI8x16SConvertI16x8: |
3427 return graph()->NewNode(jsgraph()->machine()->I8x16SConvertI16x8(), | 3427 return graph()->NewNode(jsgraph()->machine()->I8x16SConvertI16x8(), |
3428 inputs[0], inputs[1]); | 3428 inputs[0], inputs[1]); |
3429 case wasm::kExprI8x16Add: | 3429 case wasm::kExprI8x16Add: |
3430 return graph()->NewNode(jsgraph()->machine()->I8x16Add(), inputs[0], | 3430 return graph()->NewNode(jsgraph()->machine()->I8x16Add(), inputs[0], |
3431 inputs[1]); | 3431 inputs[1]); |
(...skipping 15 matching lines...) Expand all Loading... |
3447 case wasm::kExprI8x16MaxS: | 3447 case wasm::kExprI8x16MaxS: |
3448 return graph()->NewNode(jsgraph()->machine()->I8x16MaxS(), inputs[0], | 3448 return graph()->NewNode(jsgraph()->machine()->I8x16MaxS(), inputs[0], |
3449 inputs[1]); | 3449 inputs[1]); |
3450 case wasm::kExprI8x16Eq: | 3450 case wasm::kExprI8x16Eq: |
3451 return graph()->NewNode(jsgraph()->machine()->I8x16Eq(), inputs[0], | 3451 return graph()->NewNode(jsgraph()->machine()->I8x16Eq(), inputs[0], |
3452 inputs[1]); | 3452 inputs[1]); |
3453 case wasm::kExprI8x16Ne: | 3453 case wasm::kExprI8x16Ne: |
3454 return graph()->NewNode(jsgraph()->machine()->I8x16Ne(), inputs[0], | 3454 return graph()->NewNode(jsgraph()->machine()->I8x16Ne(), inputs[0], |
3455 inputs[1]); | 3455 inputs[1]); |
3456 case wasm::kExprI8x16LtS: | 3456 case wasm::kExprI8x16LtS: |
3457 return graph()->NewNode(jsgraph()->machine()->I8x16LtS(), inputs[0], | 3457 return graph()->NewNode(jsgraph()->machine()->I8x16GtS(), inputs[1], |
| 3458 inputs[0]); |
| 3459 case wasm::kExprI8x16LeS: |
| 3460 return graph()->NewNode(jsgraph()->machine()->I8x16GeS(), inputs[1], |
| 3461 inputs[0]); |
| 3462 case wasm::kExprI8x16GtS: |
| 3463 return graph()->NewNode(jsgraph()->machine()->I8x16GtS(), inputs[0], |
3458 inputs[1]); | 3464 inputs[1]); |
3459 case wasm::kExprI8x16LeS: | 3465 case wasm::kExprI8x16GeS: |
3460 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[0], | 3466 return graph()->NewNode(jsgraph()->machine()->I8x16GeS(), inputs[0], |
3461 inputs[1]); | 3467 inputs[1]); |
3462 case wasm::kExprI8x16GtS: | |
3463 return graph()->NewNode(jsgraph()->machine()->I8x16LtS(), inputs[1], | |
3464 inputs[0]); | |
3465 case wasm::kExprI8x16GeS: | |
3466 return graph()->NewNode(jsgraph()->machine()->I8x16LeS(), inputs[1], | |
3467 inputs[0]); | |
3468 case wasm::kExprI8x16UConvertI16x8: | 3468 case wasm::kExprI8x16UConvertI16x8: |
3469 return graph()->NewNode(jsgraph()->machine()->I8x16UConvertI16x8(), | 3469 return graph()->NewNode(jsgraph()->machine()->I8x16UConvertI16x8(), |
3470 inputs[0], inputs[1]); | 3470 inputs[0], inputs[1]); |
3471 case wasm::kExprI8x16AddSaturateU: | 3471 case wasm::kExprI8x16AddSaturateU: |
3472 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateU(), | 3472 return graph()->NewNode(jsgraph()->machine()->I8x16AddSaturateU(), |
3473 inputs[0], inputs[1]); | 3473 inputs[0], inputs[1]); |
3474 case wasm::kExprI8x16SubSaturateU: | 3474 case wasm::kExprI8x16SubSaturateU: |
3475 return graph()->NewNode(jsgraph()->machine()->I8x16SubSaturateU(), | 3475 return graph()->NewNode(jsgraph()->machine()->I8x16SubSaturateU(), |
3476 inputs[0], inputs[1]); | 3476 inputs[0], inputs[1]); |
3477 case wasm::kExprI8x16MinU: | 3477 case wasm::kExprI8x16MinU: |
3478 return graph()->NewNode(jsgraph()->machine()->I8x16MinU(), inputs[0], | 3478 return graph()->NewNode(jsgraph()->machine()->I8x16MinU(), inputs[0], |
3479 inputs[1]); | 3479 inputs[1]); |
3480 case wasm::kExprI8x16MaxU: | 3480 case wasm::kExprI8x16MaxU: |
3481 return graph()->NewNode(jsgraph()->machine()->I8x16MaxU(), inputs[0], | 3481 return graph()->NewNode(jsgraph()->machine()->I8x16MaxU(), inputs[0], |
3482 inputs[1]); | 3482 inputs[1]); |
3483 case wasm::kExprI8x16LtU: | 3483 case wasm::kExprI8x16LtU: |
3484 return graph()->NewNode(jsgraph()->machine()->I8x16LtU(), inputs[0], | 3484 return graph()->NewNode(jsgraph()->machine()->I8x16GtU(), inputs[1], |
| 3485 inputs[0]); |
| 3486 case wasm::kExprI8x16LeU: |
| 3487 return graph()->NewNode(jsgraph()->machine()->I8x16GeU(), inputs[1], |
| 3488 inputs[0]); |
| 3489 case wasm::kExprI8x16GtU: |
| 3490 return graph()->NewNode(jsgraph()->machine()->I8x16GtU(), inputs[0], |
3485 inputs[1]); | 3491 inputs[1]); |
3486 case wasm::kExprI8x16LeU: | 3492 case wasm::kExprI8x16GeU: |
3487 return graph()->NewNode(jsgraph()->machine()->I8x16LeU(), inputs[0], | 3493 return graph()->NewNode(jsgraph()->machine()->I8x16GeU(), inputs[0], |
3488 inputs[1]); | 3494 inputs[1]); |
3489 case wasm::kExprI8x16GtU: | |
3490 return graph()->NewNode(jsgraph()->machine()->I8x16LtU(), inputs[1], | |
3491 inputs[0]); | |
3492 case wasm::kExprI8x16GeU: | |
3493 return graph()->NewNode(jsgraph()->machine()->I8x16LeU(), inputs[1], | |
3494 inputs[0]); | |
3495 case wasm::kExprS128And: | 3495 case wasm::kExprS128And: |
3496 return graph()->NewNode(jsgraph()->machine()->S128And(), inputs[0], | 3496 return graph()->NewNode(jsgraph()->machine()->S128And(), inputs[0], |
3497 inputs[1]); | 3497 inputs[1]); |
3498 case wasm::kExprS128Or: | 3498 case wasm::kExprS128Or: |
3499 return graph()->NewNode(jsgraph()->machine()->S128Or(), inputs[0], | 3499 return graph()->NewNode(jsgraph()->machine()->S128Or(), inputs[0], |
3500 inputs[1]); | 3500 inputs[1]); |
3501 case wasm::kExprS128Xor: | 3501 case wasm::kExprS128Xor: |
3502 return graph()->NewNode(jsgraph()->machine()->S128Xor(), inputs[0], | 3502 return graph()->NewNode(jsgraph()->machine()->S128Xor(), inputs[0], |
3503 inputs[1]); | 3503 inputs[1]); |
3504 case wasm::kExprS128Not: | 3504 case wasm::kExprS128Not: |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4128 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4128 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
4129 WasmCompilationUnit unit(isolate, module_env, function); | 4129 WasmCompilationUnit unit(isolate, module_env, function); |
4130 unit.InitializeHandles(); | 4130 unit.InitializeHandles(); |
4131 unit.ExecuteCompilation(); | 4131 unit.ExecuteCompilation(); |
4132 return unit.FinishCompilation(thrower); | 4132 return unit.FinishCompilation(thrower); |
4133 } | 4133 } |
4134 | 4134 |
4135 } // namespace compiler | 4135 } // namespace compiler |
4136 } // namespace internal | 4136 } // namespace internal |
4137 } // namespace v8 | 4137 } // namespace v8 |
OLD | NEW |