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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
|
/*
* Copyright (C) 2013-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "BytecodeUseDef.h"
namespace JSC {
#define CALL_FUNCTOR(__arg) \
functor(__bytecode.m_##__arg);
#define USES_OR_DEFS(__opcode, ...) \
case __opcode::opcodeID: { \
static_assert(__opcode::opcodeID >= NUMBER_OF_BYTECODE_WITH_CHECKPOINTS, "Don't use this macro for bytecodes that have checkpoints."); \
auto __bytecode = instruction->as<__opcode>(); \
WTF_LAZY_FOR_EACH_TERM(CALL_FUNCTOR, __VA_ARGS__) \
return; \
}
#define USES USES_OR_DEFS
#define DEFS USES_OR_DEFS
void computeUsesForBytecodeIndexImpl(const JSInstruction* instruction, Checkpoint checkpoint, const ScopedLambda<void(VirtualRegister)>& functor)
{
OpcodeID opcodeID = instruction->opcodeID();
auto handleNewArrayLike = [&] (auto op) {
int base = op.m_argv.offset();
for (int i = 0; i < static_cast<int>(op.m_argc); i++)
functor(VirtualRegister { base - i });
};
auto handleOpCallLike = [&] (auto op) {
functor(op.m_callee);
int lastArg = -static_cast<int>(op.m_argv) + CallFrame::thisArgumentOffset();
for (int i = 0; i < static_cast<int>(op.m_argc); i++)
functor(VirtualRegister { lastArg + i });
return;
};
auto useAtEachCheckpoint = [&] (auto... virtualRegisters) {
(functor(virtualRegisters), ...);
};
auto useAtEachCheckpointStartingWith = [&] (Checkpoint firstUse, auto... virtualRegisters) {
if (checkpoint >= firstUse)
(functor(virtualRegisters), ...);
};
auto useAt = [&] (Checkpoint target, auto... virtualRegisters) {
if (target == checkpoint)
(functor(virtualRegisters), ...);
};
switch (opcodeID) {
case op_wide16:
case op_wide32:
RELEASE_ASSERT_NOT_REACHED();
// No uses.
case op_new_regexp:
case op_debug:
case op_loop_hint:
case op_jmp:
case op_new_object:
case op_new_promise:
case op_new_generator:
case op_enter:
case op_argument_count:
case op_catch:
case op_profile_control_flow:
case op_create_direct_arguments:
case op_create_cloned_arguments:
case op_get_rest_length:
case op_check_traps:
case op_get_argument:
case op_nop:
case op_unreachable:
case op_super_sampler_begin:
case op_super_sampler_end:
case op_get_scope:
return;
USES(OpToThis, srcDst)
USES(OpCheckTdz, targetVirtualRegister)
USES(OpIdentityWithProfile, srcDst)
USES(OpProfileType, targetVirtualRegister);
USES(OpThrow, value)
USES(OpThrowStaticError, message)
USES(OpEnd, value)
USES(OpRet, value)
USES(OpJtrue, condition)
USES(OpJfalse, condition)
USES(OpJeqNull, value)
USES(OpJneqNull, value)
USES(OpJundefinedOrNull, value)
USES(OpJnundefinedOrNull, value)
USES(OpDec, srcDst)
USES(OpInc, srcDst)
USES(OpLogShadowChickenPrologue, scope)
USES(OpJless, lhs, rhs)
USES(OpJlesseq, lhs, rhs)
USES(OpJgreater, lhs, rhs)
USES(OpJgreatereq, lhs, rhs)
USES(OpJnless, lhs, rhs)
USES(OpJnlesseq, lhs, rhs)
USES(OpJngreater, lhs, rhs)
USES(OpJngreatereq, lhs, rhs)
USES(OpJeq, lhs, rhs)
USES(OpJneq, lhs, rhs)
USES(OpJstricteq, lhs, rhs)
USES(OpJnstricteq, lhs, rhs)
USES(OpJbelow, lhs, rhs)
USES(OpJbeloweq, lhs, rhs)
USES(OpJeqPtr, value, specialPointer)
USES(OpJneqPtr, value, specialPointer)
USES(OpSetFunctionName, function, name)
USES(OpLogShadowChickenTail, thisValue, scope)
USES(OpPutByVal, base, property, value)
USES(OpPutByValDirect, base, property, value)
USES(OpPutById, base, value)
USES(OpPutToScope, scope, value)
USES(OpPutToArguments, arguments, value)
USES(OpPutByIdWithThis, base, thisValue, value)
USES(OpPutByValWithThis, base, thisValue, property, value)
USES(OpPutGetterById, base, accessor)
USES(OpPutSetterById, base, accessor)
USES(OpPutGetterSetterById, base, getter, setter)
USES(OpPutGetterByVal, base, property, accessor)
USES(OpPutSetterByVal, base, property, accessor)
USES(OpDefineDataProperty, base, property, value, attributes)
USES(OpDefineAccessorProperty, base, property, getter, setter, attributes)
USES(OpSpread, argument)
USES(OpGetPropertyEnumerator, base)
USES(OpNewFuncExp, scope)
USES(OpNewGeneratorFuncExp, scope)
USES(OpNewAsyncFuncExp, scope)
USES(OpCreateLexicalEnvironment, scope, symbolTable, initialValue)
USES(OpCreateGeneratorFrameEnvironment, scope, symbolTable, initialValue)
USES(OpResolveScope, scope)
USES(OpResolveScopeForHoistingFuncDeclInEval, scope)
USES(OpGetFromScope, scope)
USES(OpToPrimitive, src)
USES(OpToPropertyKey, src)
USES(OpToPropertyKeyOrNumber, src)
USES(OpTryGetById, base)
USES(OpGetById, base)
USES(OpGetLength, base)
USES(OpGetByIdDirect, base)
USES(OpGetPrototypeOf, value)
USES(OpInById, base)
USES(OpTypeof, value)
USES(OpIsEmpty, operand)
USES(OpTypeofIsUndefined, operand)
USES(OpTypeofIsObject, operand)
USES(OpTypeofIsFunction, operand)
USES(OpIsUndefinedOrNull, operand)
USES(OpIsBoolean, operand)
USES(OpIsNumber, operand)
USES(OpIsBigInt, operand)
USES(OpIsObject, operand)
USES(OpIsCellWithType, operand)
USES(OpIsCallable, operand)
USES(OpIsConstructor, operand)
USES(OpToNumber, operand)
USES(OpToNumeric, operand)
USES(OpToString, operand)
USES(OpToObject, operand)
USES(OpNegate, operand)
USES(OpBitnot, operand)
USES(OpEqNull, operand)
USES(OpNeqNull, operand)
USES(OpNot, operand)
USES(OpUnsigned, operand)
USES(OpMov, src)
USES(OpNewArrayWithSize, length)
USES(OpNewArrayWithSpecies, length, array)
USES(OpCreateThis, callee)
USES(OpCreatePromise, callee)
USES(OpCreateGenerator, callee)
USES(OpCreateAsyncGenerator, callee)
USES(OpDelById, base)
USES(OpNewFunc, scope)
USES(OpNewAsyncGeneratorFunc, scope)
USES(OpNewAsyncGeneratorFuncExp, scope)
USES(OpNewGeneratorFunc, scope)
USES(OpNewAsyncFunc, scope)
USES(OpGetParentScope, scope)
USES(OpCreateScopedArguments, scope)
USES(OpCreateRest, arraySize)
USES(OpGetFromArguments, arguments)
USES(OpNewArrayBuffer, immutableButterfly)
USES(OpGetByVal, base, property)
USES(OpGetPrivateName, base, property)
USES(OpPutPrivateName, base, property, value)
USES(OpSetPrivateBrand, base, brand)
USES(OpCheckPrivateBrand, base, brand)
USES(OpInByVal, base, property)
USES(OpHasPrivateName, base, property)
USES(OpHasPrivateBrand, base, brand)
USES(OpHasStructureWithFlags, operand)
USES(OpOverridesHasInstance, constructor, hasInstanceValue)
USES(OpAdd, lhs, rhs)
USES(OpMul, lhs, rhs)
USES(OpDiv, lhs, rhs)
USES(OpMod, lhs, rhs)
USES(OpSub, lhs, rhs)
USES(OpPow, lhs, rhs)
USES(OpLshift, lhs, rhs)
USES(OpRshift, lhs, rhs)
USES(OpUrshift, lhs, rhs)
USES(OpBitand, lhs, rhs)
USES(OpBitxor, lhs, rhs)
USES(OpBitor, lhs, rhs)
USES(OpLess, lhs, rhs)
USES(OpLesseq, lhs, rhs)
USES(OpGreater, lhs, rhs)
USES(OpGreatereq, lhs, rhs)
USES(OpBelow, lhs, rhs)
USES(OpBeloweq, lhs, rhs)
USES(OpNstricteq, lhs, rhs)
USES(OpStricteq, lhs, rhs)
USES(OpNeq, lhs, rhs)
USES(OpEq, lhs, rhs)
USES(OpPushWithScope, currentScope, newScope)
USES(OpGetByIdWithThis, base, thisValue)
USES(OpDelByVal, base, property)
USES(OpTailCallForwardArguments, callee, thisValue)
USES(OpGetByValWithThis, base, thisValue, property)
case op_call_varargs: {
auto bytecode = instruction->as<OpCallVarargs>();
useAtEachCheckpoint(bytecode.m_callee, bytecode.m_thisValue, bytecode.m_arguments);
return;
}
case op_tail_call_varargs: {
auto bytecode = instruction->as<OpTailCallVarargs>();
useAtEachCheckpoint(bytecode.m_callee, bytecode.m_thisValue, bytecode.m_arguments);
return;
}
case op_construct_varargs: {
auto bytecode = instruction->as<OpConstructVarargs>();
useAtEachCheckpoint(bytecode.m_callee, bytecode.m_thisValue, bytecode.m_arguments);
return;
}
case op_super_construct_varargs: {
auto bytecode = instruction->as<OpSuperConstructVarargs>();
useAtEachCheckpoint(bytecode.m_callee, bytecode.m_thisValue, bytecode.m_arguments);
return;
}
USES(OpSwitchString, scrutinee)
USES(OpSwitchChar, scrutinee)
USES(OpSwitchImm, scrutinee)
USES(OpGetInternalField, base)
USES(OpPutInternalField, base, value)
USES(OpYield, argument)
USES(OpEnumeratorNext, mode, index, base, enumerator)
USES(OpEnumeratorGetByVal, base, mode, propertyName, index, enumerator)
USES(OpEnumeratorInByVal, base, mode, propertyName, index, enumerator)
USES(OpEnumeratorPutByVal, base, mode, propertyName, index, enumerator, value)
USES(OpEnumeratorHasOwnProperty, base, mode, propertyName, index, enumerator)
case op_iterator_open: {
auto bytecode = instruction->as<OpIteratorOpen>();
useAtEachCheckpointStartingWith(OpIteratorOpen::symbolCall, bytecode.m_symbolIterator, bytecode.m_iterable);
useAtEachCheckpointStartingWith(OpIteratorOpen::getNext, bytecode.m_iterator);
return;
}
case op_iterator_next: {
auto bytecode = instruction->as<OpIteratorNext>();
useAtEachCheckpoint(bytecode.m_iterator, bytecode.m_next);
useAtEachCheckpointStartingWith(OpIteratorNext::computeNext, bytecode.m_iterable);
return;
}
case op_new_array_with_spread:
handleNewArrayLike(instruction->as<OpNewArrayWithSpread>());
return;
case op_new_array:
handleNewArrayLike(instruction->as<OpNewArray>());
return;
case op_strcat: {
auto bytecode = instruction->as<OpStrcat>();
int base = bytecode.m_src.offset();
for (int i = 0; i < bytecode.m_count; i++)
functor(VirtualRegister { base - i });
return;
}
case op_construct:
handleOpCallLike(instruction->as<OpConstruct>());
return;
case op_super_construct:
handleOpCallLike(instruction->as<OpSuperConstruct>());
return;
case op_call_direct_eval: {
auto bytecode = instruction->as<OpCallDirectEval>();
handleOpCallLike(bytecode);
functor(bytecode.m_thisValue);
functor(bytecode.m_scope);
return;
}
case op_call:
handleOpCallLike(instruction->as<OpCall>());
return;
case op_tail_call:
handleOpCallLike(instruction->as<OpTailCall>());
return;
case op_call_ignore_result:
handleOpCallLike(instruction->as<OpCallIgnoreResult>());
return;
case op_instanceof: {
auto bytecode = instruction->as<OpInstanceof>();
useAt(OpInstanceof::getHasInstance, bytecode.m_constructor);
useAt(OpInstanceof::getPrototype, bytecode.m_value, bytecode.m_constructor, bytecode.m_hasInstanceOrPrototype);
useAt(OpInstanceof::instanceof, bytecode.m_value, bytecode.m_hasInstanceOrPrototype);
return;
}
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
}
void computeDefsForBytecodeIndexImpl(unsigned numVars, const JSInstruction* instruction, Checkpoint checkpoint, const ScopedLambda<void(VirtualRegister)>& functor)
{
auto defAt = [&] (Checkpoint target, VirtualRegister operand) {
if (target == checkpoint)
functor(operand);
};
switch (instruction->opcodeID()) {
case op_wide16:
case op_wide32:
RELEASE_ASSERT_NOT_REACHED();
// These don't define anything.
case op_put_to_scope:
case op_end:
case op_throw:
case op_throw_static_error:
case op_check_tdz:
case op_debug:
case op_ret:
case op_jmp:
case op_jtrue:
case op_jfalse:
case op_jeq_null:
case op_jneq_null:
case op_jundefined_or_null:
case op_jnundefined_or_null:
case op_jeq_ptr:
case op_jneq_ptr:
case op_jless:
case op_jlesseq:
case op_jgreater:
case op_jgreatereq:
case op_jnless:
case op_jnlesseq:
case op_jngreater:
case op_jngreatereq:
case op_jeq:
case op_jneq:
case op_jstricteq:
case op_jnstricteq:
case op_jbelow:
case op_jbeloweq:
case op_loop_hint:
case op_switch_imm:
case op_switch_char:
case op_switch_string:
case op_put_by_id:
case op_put_by_id_with_this:
case op_put_by_val_with_this:
case op_put_getter_by_id:
case op_put_setter_by_id:
case op_put_getter_setter_by_id:
case op_put_getter_by_val:
case op_put_setter_by_val:
case op_put_by_val:
case op_put_by_val_direct:
case op_enumerator_put_by_val:
case op_put_private_name:
case op_set_private_brand:
case op_check_private_brand:
case op_put_internal_field:
case op_define_data_property:
case op_define_accessor_property:
case op_profile_type:
case op_profile_control_flow:
case op_put_to_arguments:
case op_call_ignore_result:
case op_set_function_name:
case op_check_traps:
case op_log_shadow_chicken_prologue:
case op_log_shadow_chicken_tail:
case op_yield:
case op_nop:
case op_unreachable:
case op_super_sampler_begin:
case op_super_sampler_end:
#define LLINT_HELPER_OPCODES(opcode, length) case opcode:
FOR_EACH_LLINT_OPCODE_EXTENSION(LLINT_HELPER_OPCODES);
#undef LLINT_HELPER_OPCODES
return;
// These all have a single destination for the first argument.
DEFS(OpArgumentCount, dst)
DEFS(OpGetPropertyEnumerator, dst)
DEFS(OpGetParentScope, dst)
DEFS(OpPushWithScope, dst)
DEFS(OpCreateLexicalEnvironment, dst)
DEFS(OpCreateGeneratorFrameEnvironment, dst)
DEFS(OpResolveScope, dst)
DEFS(OpResolveScopeForHoistingFuncDeclInEval, dst)
DEFS(OpStrcat, dst)
DEFS(OpToPrimitive, dst)
DEFS(OpToPropertyKey, dst)
DEFS(OpToPropertyKeyOrNumber, dst)
DEFS(OpCreateThis, dst)
DEFS(OpCreatePromise, dst)
DEFS(OpCreateGenerator, dst)
DEFS(OpCreateAsyncGenerator, dst)
DEFS(OpNewArray, dst)
DEFS(OpNewArrayWithSpread, dst)
DEFS(OpSpread, dst)
DEFS(OpNewArrayBuffer, dst)
DEFS(OpNewArrayWithSize, dst)
DEFS(OpNewArrayWithSpecies, dst)
DEFS(OpNewRegexp, dst)
DEFS(OpNewFunc, dst)
DEFS(OpNewFuncExp, dst)
DEFS(OpNewGeneratorFunc, dst)
DEFS(OpNewGeneratorFuncExp, dst)
DEFS(OpNewAsyncGeneratorFunc, dst)
DEFS(OpNewAsyncGeneratorFuncExp, dst)
DEFS(OpNewAsyncFunc, dst)
DEFS(OpNewAsyncFuncExp, dst)
case op_call_varargs: {
auto bytecode = instruction->as<OpCallVarargs>();
defAt(OpCallVarargs::makeCall, bytecode.m_dst);
return;
}
case op_tail_call_varargs: {
auto bytecode = instruction->as<OpTailCallVarargs>();
defAt(OpTailCallVarargs::makeCall, bytecode.m_dst);
return;
}
case op_construct_varargs: {
auto bytecode = instruction->as<OpConstructVarargs>();
defAt(OpConstructVarargs::makeCall, bytecode.m_dst);
return;
}
case op_super_construct_varargs: {
auto bytecode = instruction->as<OpSuperConstructVarargs>();
defAt(OpSuperConstructVarargs::makeCall, bytecode.m_dst);
return;
}
DEFS(OpTailCallForwardArguments, dst)
DEFS(OpGetFromScope, dst)
DEFS(OpCall, dst)
DEFS(OpTailCall, dst)
DEFS(OpCallDirectEval, dst)
DEFS(OpConstruct, dst)
DEFS(OpSuperConstruct, dst)
DEFS(OpTryGetById, dst)
DEFS(OpGetById, dst)
DEFS(OpGetLength, dst)
DEFS(OpGetByIdDirect, dst)
DEFS(OpGetByIdWithThis, dst)
DEFS(OpGetByValWithThis, dst)
DEFS(OpGetPrototypeOf, dst)
DEFS(OpOverridesHasInstance, dst)
DEFS(OpGetByVal, dst)
DEFS(OpGetPrivateName, dst)
DEFS(OpTypeof, dst)
DEFS(OpIdentityWithProfile, srcDst)
DEFS(OpIsEmpty, dst)
DEFS(OpTypeofIsUndefined, dst)
DEFS(OpTypeofIsObject, dst)
DEFS(OpTypeofIsFunction, dst)
DEFS(OpIsUndefinedOrNull, dst)
DEFS(OpIsBoolean, dst)
DEFS(OpIsNumber, dst)
DEFS(OpIsBigInt, dst)
DEFS(OpIsObject, dst)
DEFS(OpIsCellWithType, dst)
DEFS(OpIsCallable, dst)
DEFS(OpIsConstructor, dst)
DEFS(OpInById, dst)
DEFS(OpInByVal, dst)
DEFS(OpHasPrivateName, dst)
DEFS(OpHasPrivateBrand, dst)
DEFS(OpHasStructureWithFlags, dst)
DEFS(OpToNumber, dst)
DEFS(OpToNumeric, dst)
DEFS(OpToString, dst)
DEFS(OpToObject, dst)
DEFS(OpNegate, dst)
DEFS(OpAdd, dst)
DEFS(OpMul, dst)
DEFS(OpDiv, dst)
DEFS(OpMod, dst)
DEFS(OpSub, dst)
DEFS(OpPow, dst)
DEFS(OpLshift, dst)
DEFS(OpRshift, dst)
DEFS(OpUrshift, dst)
DEFS(OpBitand, dst)
DEFS(OpBitxor, dst)
DEFS(OpBitor, dst)
DEFS(OpBitnot, dst)
DEFS(OpInc, srcDst)
DEFS(OpDec, srcDst)
DEFS(OpEq, dst)
DEFS(OpNeq, dst)
DEFS(OpStricteq, dst)
DEFS(OpNstricteq, dst)
DEFS(OpLess, dst)
DEFS(OpLesseq, dst)
DEFS(OpGreater, dst)
DEFS(OpGreatereq, dst)
DEFS(OpBelow, dst)
DEFS(OpBeloweq, dst)
DEFS(OpNeqNull, dst)
DEFS(OpEqNull, dst)
DEFS(OpNot, dst)
DEFS(OpMov, dst)
DEFS(OpNewObject, dst)
DEFS(OpNewPromise, dst)
DEFS(OpNewGenerator, dst)
DEFS(OpToThis, srcDst)
DEFS(OpGetScope, dst)
DEFS(OpCreateDirectArguments, dst)
DEFS(OpCreateScopedArguments, dst)
DEFS(OpCreateClonedArguments, dst)
DEFS(OpDelById, dst)
DEFS(OpDelByVal, dst)
DEFS(OpUnsigned, dst)
DEFS(OpGetFromArguments, dst)
DEFS(OpGetArgument, dst)
DEFS(OpCreateRest, dst)
DEFS(OpGetRestLength, dst)
DEFS(OpGetInternalField, dst)
DEFS(OpCatch, exception, thrownValue)
DEFS(OpEnumeratorNext, propertyName, mode, index)
DEFS(OpEnumeratorGetByVal, dst)
DEFS(OpEnumeratorInByVal, dst)
DEFS(OpEnumeratorHasOwnProperty, dst)
case op_iterator_open: {
auto bytecode = instruction->as<OpIteratorOpen>();
defAt(OpIteratorOpen::symbolCall, bytecode.m_iterator);
defAt(OpIteratorOpen::getNext, bytecode.m_next);
return;
}
case op_iterator_next: {
auto bytecode = instruction->as<OpIteratorNext>();
defAt(OpIteratorNext::getDone, bytecode.m_done);
// We need to claim we set m_value here because we could early exit from the bytecode if we are done.
defAt(OpIteratorNext::getDone, bytecode.m_value);
defAt(OpIteratorNext::getValue, bytecode.m_value);
return;
}
case op_enter: {
for (unsigned i = numVars; i--;)
functor(virtualRegisterForLocal(i));
return;
}
case op_instanceof: {
auto bytecode = instruction->as<OpInstanceof>();
defAt(OpInstanceof::getHasInstance, bytecode.m_hasInstanceOrPrototype);
defAt(OpInstanceof::getPrototype, bytecode.m_hasInstanceOrPrototype);
defAt(OpInstanceof::instanceof, bytecode.m_dst);
return;
}
}
}
#undef CALL_FUNCTOR
#undef USES_OR_DEFS
#undef USES
#undef DEFS
} // namespace JSC
|