| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 Register function, | 499 Register function, |
| 500 Register scratch) { | 500 Register scratch) { |
| 501 ASSERT(!AreAliased(function, scratch)); | 501 ASSERT(!AreAliased(function, scratch)); |
| 502 | 502 |
| 503 // Check that the value is a JSFunction. | 503 // Check that the value is a JSFunction. |
| 504 __ JumpIfSmi(function, miss); | 504 __ JumpIfSmi(function, miss); |
| 505 __ JumpIfNotObjectType(function, scratch, scratch, JS_FUNCTION_TYPE, miss); | 505 __ JumpIfNotObjectType(function, scratch, scratch, JS_FUNCTION_TYPE, miss); |
| 506 | 506 |
| 507 // Invoke the function. | 507 // Invoke the function. |
| 508 ParameterCount actual(argc); | 508 ParameterCount actual(argc); |
| 509 __ InvokeFunction( | 509 __ InvokeFunction(function, actual, JUMP_FUNCTION, NullCallWrapper()); |
| 510 function, actual, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | |
| 511 } | 510 } |
| 512 | 511 |
| 513 | 512 |
| 514 void CallICBase::GenerateNormal(MacroAssembler* masm, int argc) { | 513 void CallICBase::GenerateNormal(MacroAssembler* masm, int argc) { |
| 515 // ----------- S t a t e ------------- | 514 // ----------- S t a t e ------------- |
| 516 // -- x2 : name | 515 // -- x2 : name |
| 517 // -- lr : return address | 516 // -- lr : return address |
| 518 // ----------------------------------- | 517 // ----------------------------------- |
| 519 Label miss; | 518 Label miss; |
| 520 Register name = x2; | 519 Register name = x2; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 __ B(ne, &invoke); | 583 __ B(ne, &invoke); |
| 585 | 584 |
| 586 // Patch the receiver on the stack. | 585 // Patch the receiver on the stack. |
| 587 __ Bind(&global); | 586 __ Bind(&global); |
| 588 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); | 587 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); |
| 589 __ Poke(x2, argc * kXRegSizeInBytes); | 588 __ Poke(x2, argc * kXRegSizeInBytes); |
| 590 __ Bind(&invoke); | 589 __ Bind(&invoke); |
| 591 } | 590 } |
| 592 | 591 |
| 593 // Invoke the function. | 592 // Invoke the function. |
| 594 CallKind call_kind = CallICBase::Contextual::decode(extra_state) | |
| 595 ? CALL_AS_FUNCTION | |
| 596 : CALL_AS_METHOD; | |
| 597 ParameterCount actual(argc); | 593 ParameterCount actual(argc); |
| 598 __ InvokeFunction(x1, | 594 __ InvokeFunction(x1, actual, JUMP_FUNCTION, NullCallWrapper()); |
| 599 actual, | |
| 600 JUMP_FUNCTION, | |
| 601 NullCallWrapper(), | |
| 602 call_kind); | |
| 603 } | 595 } |
| 604 | 596 |
| 605 | 597 |
| 606 void CallIC::GenerateMegamorphic(MacroAssembler* masm, | 598 void CallIC::GenerateMegamorphic(MacroAssembler* masm, |
| 607 int argc, | 599 int argc, |
| 608 ExtraICState extra_ic_state) { | 600 ExtraICState extra_ic_state) { |
| 609 // ----------- S t a t e ------------- | 601 // ----------- S t a t e ------------- |
| 610 // -- x2 : name | 602 // -- x2 : name |
| 611 // -- lr : return address | 603 // -- lr : return address |
| 612 // ----------------------------------- | 604 // ----------------------------------- |
| (...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 ASSERT(to_patch->Mask(TestBranchMask) == TBNZ); | 1809 ASSERT(to_patch->Mask(TestBranchMask) == TBNZ); |
| 1818 // This is JumpIfSmi(smi_reg, branch_imm). | 1810 // This is JumpIfSmi(smi_reg, branch_imm). |
| 1819 patcher.tbz(smi_reg, 0, branch_imm); | 1811 patcher.tbz(smi_reg, 0, branch_imm); |
| 1820 } | 1812 } |
| 1821 } | 1813 } |
| 1822 | 1814 |
| 1823 | 1815 |
| 1824 } } // namespace v8::internal | 1816 } } // namespace v8::internal |
| 1825 | 1817 |
| 1826 #endif // V8_TARGET_ARCH_A64 | 1818 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |