| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 Label* done, | 565 Label* done, |
| 566 InvokeFlag flag) { | 566 InvokeFlag flag) { |
| 567 bool definitely_matches = false; | 567 bool definitely_matches = false; |
| 568 Label invoke; | 568 Label invoke; |
| 569 if (expected.is_immediate()) { | 569 if (expected.is_immediate()) { |
| 570 ASSERT(actual.is_immediate()); | 570 ASSERT(actual.is_immediate()); |
| 571 if (expected.immediate() == actual.immediate()) { | 571 if (expected.immediate() == actual.immediate()) { |
| 572 definitely_matches = true; | 572 definitely_matches = true; |
| 573 } else { | 573 } else { |
| 574 mov(eax, actual.immediate()); | 574 mov(eax, actual.immediate()); |
| 575 mov(ebx, expected.immediate()); | 575 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
| 576 if (expected.immediate() == sentinel) { |
| 577 // Don't worry about adapting arguments for builtins that |
| 578 // don't want that done. Skip adaption code by making it look |
| 579 // like we have a match between expected and actual number of |
| 580 // arguments. |
| 581 definitely_matches = true; |
| 582 } else { |
| 583 mov(ebx, expected.immediate()); |
| 584 } |
| 576 } | 585 } |
| 577 } else { | 586 } else { |
| 578 if (actual.is_immediate()) { | 587 if (actual.is_immediate()) { |
| 579 // Expected is in register, actual is immediate. This is the | 588 // Expected is in register, actual is immediate. This is the |
| 580 // case when we invoke function values without going through the | 589 // case when we invoke function values without going through the |
| 581 // IC mechanism. | 590 // IC mechanism. |
| 582 cmp(expected.reg(), actual.immediate()); | 591 cmp(expected.reg(), actual.immediate()); |
| 583 j(equal, &invoke); | 592 j(equal, &invoke); |
| 584 ASSERT(expected.reg().is(ebx)); | 593 ASSERT(expected.reg().is(ebx)); |
| 585 mov(eax, actual.immediate()); | 594 mov(eax, actual.immediate()); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 // Indicate that code has changed. | 823 // Indicate that code has changed. |
| 815 CPU::FlushICache(address_, size_); | 824 CPU::FlushICache(address_, size_); |
| 816 | 825 |
| 817 // Check that the code was patched as expected. | 826 // Check that the code was patched as expected. |
| 818 ASSERT(masm_.pc_ == address_ + size_); | 827 ASSERT(masm_.pc_ == address_ + size_); |
| 819 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 828 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 820 } | 829 } |
| 821 | 830 |
| 822 | 831 |
| 823 } } // namespace v8::internal | 832 } } // namespace v8::internal |
| OLD | NEW |