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