Repository navigation
Commit 8f40efa
committed
op_mul/ArithMul(Untyped,Untyped) should be an IC
https://bugs.webkit.org/show_bug.cgi?id=160108
Reviewed by Mark Lam.
This patch makes Mul a type based IC in much the same way that we made
Add a type-based IC. I implemented Mul in the same way. I abstracted the
implementation of the Add IC in the various JITs to allow for it to
work over arbitrary IC snippets. This will make adding Div/Sub/Pow in the
future easy. This patch also adds a new boolean argument to the various
snippet generateFastPath() methods to indicate if we should emit result profiling.
I added this because we want this profiling to be emitted for Mul in
the baseline, but not in the DFG. We used to indicate this through passing
in a nullptr for the ArithProfile, but we no longer do that in the upper
JIT tiers. So we are passing an explicit request from the JIT tier about
whether or not it's worth it for the IC to emit profiling.
We now emit much less code for Mul. Here is some data on the average
Mul snippet/IC size:
| JetStream | Unity 3D |
------| -------------|--------------
Old | ~280 bytes | ~280 bytes |
------| -------------|--------------
New | 210 bytes | 185 bytes |
------------------------------------
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::addJITAddIC):
(JSC::CodeBlock::addJITMulIC):
(JSC::CodeBlock::findStubInfo):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::stubInfoBegin):
(JSC::CodeBlock::stubInfoEnd):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::GPRTemporary::adopt):
(JSC::DFG::FPRTemporary::FPRTemporary):
(JSC::DFG::SpeculativeJIT::compileValueAdd):
(JSC::DFG::SpeculativeJIT::compileMathIC):
(JSC::DFG::SpeculativeJIT::compileArithMul):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::GPRTemporary::GPRTemporary):
(JSC::DFG::GPRTemporary::operator=):
(JSC::DFG::FPRTemporary::~FPRTemporary):
(JSC::DFG::FPRTemporary::fpr):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToThis):
(JSC::FTL::DFG::LowerDFGToB3::compileValueAdd):
(JSC::FTL::DFG::LowerDFGToB3::compileMathIC):
(JSC::FTL::DFG::LowerDFGToB3::compileArithMul):
* jit/JIT.h:
(JSC::JIT::getSlowCase):
* jit/JITAddGenerator.cpp:
(JSC::JITAddGenerator::generateInline):
(JSC::JITAddGenerator::generateFastPath):
* jit/JITAddGenerator.h:
(JSC::JITAddGenerator::JITAddGenerator):
(JSC::JITAddGenerator::isLeftOperandValidConstant):
(JSC::JITAddGenerator::isRightOperandValidConstant):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_add):
(JSC::JIT::emitSlow_op_add):
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
(JSC::JIT::emit_op_mul):
(JSC::JIT::emitSlow_op_mul):
(JSC::JIT::emit_op_sub):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITMathIC.h:
(JSC::JITMathIC::slowPathStartLocation):
(JSC::JITMathIC::slowPathCallLocation):
(JSC::JITMathIC::isLeftOperandValidConstant):
(JSC::JITMathIC::isRightOperandValidConstant):
(JSC::JITMathIC::generateInline):
(JSC::JITMathIC::generateOutOfLine):
* jit/JITMathICForwards.h:
* jit/JITMulGenerator.cpp:
(JSC::JITMulGenerator::generateInline):
(JSC::JITMulGenerator::generateFastPath):
* jit/JITMulGenerator.h:
(JSC::JITMulGenerator::JITMulGenerator):
(JSC::JITMulGenerator::isLeftOperandValidConstant):
(JSC::JITMulGenerator::isRightOperandValidConstant):
(JSC::JITMulGenerator::didEmitFastPath): Deleted.
(JSC::JITMulGenerator::endJumpList): Deleted.
(JSC::JITMulGenerator::slowPathJumpList): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
Canonical link: https://commits.webkit.org/178322@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203693 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent c05993c commit 8f40efa
17 files changed
Lines changed: 460 additions & 297 deletions
File tree
- Source/JavaScriptCore
- bytecode
- dfg
- ftl
- jit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
1 | 94 | | |
2 | 95 | | |
3 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3013 | 3013 | | |
3014 | 3014 | | |
3015 | 3015 | | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
3016 | 3021 | | |
3017 | 3022 | | |
3018 | 3023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
1014 | 1015 | | |
1015 | 1016 | | |
1016 | 1017 | | |
| 1018 | + | |
1017 | 1019 | | |
1018 | 1020 | | |
1019 | 1021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
1317 | 1316 | | |
1318 | 1317 | | |
1319 | 1318 | | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1320 | 1329 | | |
1321 | 1330 | | |
1322 | 1331 | | |
| |||
3336 | 3345 | | |
3337 | 3346 | | |
3338 | 3347 | | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
3339 | 3369 | | |
3340 | 3370 | | |
3341 | 3371 | | |
| |||
3347 | 3377 | | |
3348 | 3378 | | |
3349 | 3379 | | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
3350 | 3389 | | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
3351 | 3395 | | |
3352 | 3396 | | |
3353 | | - | |
3354 | | - | |
3355 | | - | |
3356 | 3397 | | |
3357 | 3398 | | |
3358 | 3399 | | |
3359 | 3400 | | |
3360 | | - | |
3361 | | - | |
3362 | | - | |
| 3401 | + | |
| 3402 | + | |
3363 | 3403 | | |
3364 | 3404 | | |
3365 | 3405 | | |
| |||
3374 | 3414 | | |
3375 | 3415 | | |
3376 | 3416 | | |
3377 | | - | |
| 3417 | + | |
3378 | 3418 | | |
3379 | 3419 | | |
3380 | 3420 | | |
3381 | | - | |
| 3421 | + | |
3382 | 3422 | | |
3383 | 3423 | | |
3384 | 3424 | | |
3385 | 3425 | | |
3386 | | - | |
3387 | 3426 | | |
3388 | 3427 | | |
3389 | | - | |
| 3428 | + | |
3390 | 3429 | | |
3391 | | - | |
| 3430 | + | |
| 3431 | + | |
3392 | 3432 | | |
3393 | 3433 | | |
3394 | 3434 | | |
| |||
3406 | 3446 | | |
3407 | 3447 | | |
3408 | 3448 | | |
3409 | | - | |
| 3449 | + | |
3410 | 3450 | | |
3411 | 3451 | | |
3412 | | - | |
| 3452 | + | |
3413 | 3453 | | |
3414 | 3454 | | |
3415 | 3455 | | |
3416 | 3456 | | |
3417 | 3457 | | |
3418 | | - | |
| 3458 | + | |
3419 | 3459 | | |
3420 | | - | |
| 3460 | + | |
3421 | 3461 | | |
3422 | 3462 | | |
3423 | 3463 | | |
3424 | 3464 | | |
3425 | 3465 | | |
3426 | 3466 | | |
3427 | | - | |
| 3467 | + | |
3428 | 3468 | | |
3429 | 3469 | | |
3430 | 3470 | | |
3431 | | - | |
| 3471 | + | |
3432 | 3472 | | |
3433 | 3473 | | |
3434 | | - | |
| 3474 | + | |
3435 | 3475 | | |
3436 | 3476 | | |
3437 | 3477 | | |
3438 | 3478 | | |
3439 | 3479 | | |
3440 | | - | |
| 3480 | + | |
3441 | 3481 | | |
3442 | 3482 | | |
3443 | 3483 | | |
| |||
4156 | 4196 | | |
4157 | 4197 | | |
4158 | 4198 | | |
4159 | | - | |
4160 | | - | |
4161 | | - | |
4162 | | - | |
4163 | | - | |
4164 | | - | |
4165 | | - | |
4166 | | - | |
4167 | | - | |
4168 | | - | |
4169 | | - | |
4170 | 4199 | | |
4171 | | - | |
4172 | | - | |
4173 | | - | |
4174 | | - | |
4175 | | - | |
| 4200 | + | |
| 4201 | + | |
4176 | 4202 | | |
4177 | | - | |
4178 | | - | |
4179 | | - | |
4180 | | - | |
4181 | | - | |
4182 | | - | |
| 4203 | + | |
| 4204 | + | |
4183 | 4205 | | |
4184 | | - | |
4185 | | - | |
4186 | | - | |
4187 | | - | |
4188 | | - | |
4189 | | - | |
4190 | | - | |
4191 | | - | |
4192 | | - | |
4193 | | - | |
4194 | | - | |
4195 | | - | |
4196 | | - | |
4197 | | - | |
4198 | | - | |
4199 | | - | |
4200 | | - | |
4201 | | - | |
4202 | | - | |
4203 | | - | |
4204 | | - | |
4205 | | - | |
4206 | | - | |
4207 | | - | |
4208 | | - | |
4209 | | - | |
4210 | | - | |
4211 | | - | |
4212 | | - | |
4213 | | - | |
4214 | | - | |
4215 | | - | |
4216 | | - | |
4217 | | - | |
4218 | | - | |
4219 | | - | |
4220 | | - | |
4221 | | - | |
4222 | | - | |
4223 | | - | |
4224 | | - | |
4225 | | - | |
4226 | | - | |
4227 | | - | |
4228 | | - | |
4229 | | - | |
4230 | | - | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
4231 | 4211 | | |
4232 | 4212 | | |
4233 | 4213 | | |
| |||
0 commit comments