Changeset 153200 in webkit for trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
- Timestamp:
- Jul 24, 2013, 9:01:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r153074 r153200 374 374 expectedFunction = NoExpectedFunction; 375 375 RefPtr<RegisterID> func = generator.emitNode(m_expr); 376 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get()); 376 377 CallArguments callArguments(generator, m_args); 377 return generator.emitConstruct( generator.finalDestinationOrIgnored(dst), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());378 return generator.emitConstruct(returnValue.get(), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 378 379 } 379 380 … … 420 421 { 421 422 RefPtr<RegisterID> func = generator.emitNode(m_expr); 423 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get()); 422 424 CallArguments callArguments(generator, m_args); 423 425 generator.emitLoad(callArguments.thisRegister(), jsUndefined()); 424 return generator.emitCall( generator.finalDestinationOrIgnored(dst, func.get()), func.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());426 return generator.emitCall(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 425 427 } 426 428 … … 434 436 if (RegisterID* local = resolveResult.local()) { 435 437 RefPtr<RegisterID> func = generator.emitMove(generator.tempDestination(dst), local); 438 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get()); 436 439 CallArguments callArguments(generator, m_args); 437 440 generator.emitLoad(callArguments.thisRegister(), jsUndefined()); 438 441 // This passes NoExpectedFunction because we expect that if the function is in a 439 442 // local variable, then it's not one of our built-in constructors. 440 return generator.emitCall( generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), func.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());443 return generator.emitCall(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 441 444 } 442 445 443 446 if (resolveResult.isStatic()) { 444 447 RefPtr<RegisterID> func = generator.newTemporary(); 448 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get()); 445 449 CallArguments callArguments(generator, m_args); 446 450 generator.emitGetStaticVar(func.get(), resolveResult, m_ident); 447 451 generator.emitLoad(callArguments.thisRegister(), jsUndefined()); 448 return generator.emitCall( generator.finalDestinationOrIgnored(dst, func.get()), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());452 return generator.emitCall(returnValue.get(), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 449 453 } 450 454 451 455 RefPtr<RegisterID> func = generator.newTemporary(); 456 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get()); 452 457 CallArguments callArguments(generator, m_args); 453 458 int identifierStart = divot() - divotStartOffset(); … … 455 460 generator.emitExpressionInfo(identifierStart + m_ident.length(), m_ident.length(), 0, divotLine(), divotLineStart()); 456 461 generator.emitResolveWithThis(callArguments.thisRegister(), func.get(), resolveResult, m_ident); 457 return generator.emitCall( generator.finalDestinationOrIgnored(dst, func.get()), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());462 return generator.emitCall(returnValue.get(), func.get(), expectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 458 463 } 459 464 … … 466 471 generator.emitExpressionInfo(subexpressionDivot(), subexpressionStartOffset(), subexpressionEndOffset(), subexpressionLine(), subexpressionLineStart()); 467 472 RefPtr<RegisterID> function = generator.emitGetByVal(generator.tempDestination(dst), base.get(), property); 473 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get()); 468 474 CallArguments callArguments(generator, m_args); 469 475 generator.emitMove(callArguments.thisRegister(), base.get()); 470 return generator.emitCall( generator.finalDestinationOrIgnored(dst, function.get()), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());476 return generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 471 477 } 472 478 … … 476 482 { 477 483 RefPtr<RegisterID> function = generator.tempDestination(dst); 484 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get()); 478 485 CallArguments callArguments(generator, m_args); 479 486 generator.emitNode(callArguments.thisRegister(), m_base); 480 487 generator.emitExpressionInfo(subexpressionDivot(), subexpressionStartOffset(), subexpressionEndOffset(), subexpressionLine(), subexpressionLineStart()); 481 488 generator.emitGetById(function.get(), callArguments.thisRegister(), m_ident); 482 return generator.emitCall( generator.finalDestinationOrIgnored(dst, function.get()), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());489 return generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 483 490 } 484 491 … … 490 497 generator.emitExpressionInfo(subexpressionDivot(), subexpressionStartOffset(), subexpressionEndOffset(), subexpressionLine(), subexpressionLineStart()); 491 498 RefPtr<RegisterID> function = generator.emitGetById(generator.tempDestination(dst), base.get(), m_ident); 492 RefPtr<RegisterID> finalDestinationOrIgnored = generator.finalDestinationOrIgnored(dst, function.get());499 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get()); 493 500 generator.emitJumpIfNotFunctionCall(function.get(), realCall.get()); 494 501 { … … 500 507 CallArguments callArguments(generator, m_args); 501 508 generator.emitNode(callArguments.thisRegister(), oldList->m_expr); 502 generator.emitCall( finalDestinationOrIgnored.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());509 generator.emitCall(returnValue.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 503 510 generator.emitJump(end.get()); 504 511 … … 508 515 CallArguments callArguments(generator, m_args); 509 516 generator.emitLoad(callArguments.thisRegister(), jsUndefined()); 510 generator.emitCall( finalDestinationOrIgnored.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());517 generator.emitCall(returnValue.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 511 518 generator.emitJump(end.get()); 512 519 } … … 516 523 CallArguments callArguments(generator, m_args); 517 524 generator.emitMove(callArguments.thisRegister(), base.get()); 518 generator.emitCall( finalDestinationOrIgnored.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());525 generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 519 526 } 520 527 generator.emitLabel(end.get()); 521 return finalDestinationOrIgnored.get();528 return returnValue.get(); 522 529 } 523 530 … … 540 547 generator.emitExpressionInfo(subexpressionDivot(), subexpressionStartOffset(), subexpressionEndOffset(), subexpressionLine(), subexpressionLineStart()); 541 548 RefPtr<RegisterID> function = generator.emitGetById(generator.tempDestination(dst), base.get(), m_ident); 542 RefPtr<RegisterID> finalDestinationOrIgnored = generator.finalDestinationOrIgnored(dst, function.get());549 RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get()); 543 550 generator.emitJumpIfNotFunctionApply(function.get(), realCall.get()); 544 551 { … … 553 560 CallArguments callArguments(generator, m_args); 554 561 generator.emitNode(callArguments.thisRegister(), oldList->m_expr); 555 generator.emitCall( finalDestinationOrIgnored.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());562 generator.emitCall(returnValue.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 556 563 } else { 557 564 m_args->m_listNode = m_args->m_listNode->m_next; … … 559 566 CallArguments callArguments(generator, m_args); 560 567 generator.emitNode(callArguments.thisRegister(), oldList->m_expr); 561 generator.emitCall( finalDestinationOrIgnored.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());568 generator.emitCall(returnValue.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 562 569 } 563 570 m_args->m_listNode = oldList; … … 566 573 CallArguments callArguments(generator, m_args); 567 574 generator.emitLoad(callArguments.thisRegister(), jsUndefined()); 568 generator.emitCall( finalDestinationOrIgnored.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());575 generator.emitCall(returnValue.get(), realFunction.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 569 576 } 570 577 } else { … … 587 594 generator.emitNode(args->m_expr); 588 595 589 generator.emitCallVarargs( finalDestinationOrIgnored.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());596 generator.emitCallVarargs(returnValue.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 590 597 } 591 598 generator.emitJump(end.get()); … … 595 602 CallArguments callArguments(generator, m_args); 596 603 generator.emitMove(callArguments.thisRegister(), base.get()); 597 generator.emitCall( finalDestinationOrIgnored.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());604 generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart()); 598 605 } 599 606 generator.emitLabel(end.get()); 600 return finalDestinationOrIgnored.get();607 return returnValue.get(); 601 608 } 602 609
Note:
See TracChangeset
for help on using the changeset viewer.