OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4852 // nop | 4852 // nop |
4853 // nop | 4853 // nop |
4854 // call <on-stack replacment> | 4854 // call <on-stack replacment> |
4855 // ok: | 4855 // ok: |
4856 *jns_instr_address = kNopByteOne; | 4856 *jns_instr_address = kNopByteOne; |
4857 *jns_offset_address = kNopByteTwo; | 4857 *jns_offset_address = kNopByteTwo; |
4858 break; | 4858 break; |
4859 } | 4859 } |
4860 | 4860 |
4861 Assembler::set_target_address_at(call_target_address, | 4861 Assembler::set_target_address_at(call_target_address, |
| 4862 unoptimized_code, |
4862 replacement_code->entry()); | 4863 replacement_code->entry()); |
4863 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4864 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4864 unoptimized_code, call_target_address, replacement_code); | 4865 unoptimized_code, call_target_address, replacement_code); |
4865 } | 4866 } |
4866 | 4867 |
4867 | 4868 |
4868 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4869 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4869 Isolate* isolate, | 4870 Isolate* isolate, |
4870 Code* unoptimized_code, | 4871 Code* unoptimized_code, |
4871 Address pc) { | 4872 Address pc) { |
4872 Address call_target_address = pc - kIntSize; | 4873 Address call_target_address = pc - kIntSize; |
4873 Address jns_instr_address = call_target_address - 3; | 4874 Address jns_instr_address = call_target_address - 3; |
4874 ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); | 4875 ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); |
4875 | 4876 |
4876 if (*jns_instr_address == kJnsInstruction) { | 4877 if (*jns_instr_address == kJnsInstruction) { |
4877 ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); | 4878 ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); |
4878 ASSERT_EQ(isolate->builtins()->InterruptCheck()->entry(), | 4879 ASSERT_EQ(isolate->builtins()->InterruptCheck()->entry(), |
4879 Assembler::target_address_at(call_target_address)); | 4880 Assembler::target_address_at(call_target_address, |
| 4881 unoptimized_code)); |
4880 return INTERRUPT; | 4882 return INTERRUPT; |
4881 } | 4883 } |
4882 | 4884 |
4883 ASSERT_EQ(kNopByteOne, *jns_instr_address); | 4885 ASSERT_EQ(kNopByteOne, *jns_instr_address); |
4884 ASSERT_EQ(kNopByteTwo, *(call_target_address - 2)); | 4886 ASSERT_EQ(kNopByteTwo, *(call_target_address - 2)); |
4885 | 4887 |
4886 if (Assembler::target_address_at(call_target_address) == | 4888 if (Assembler::target_address_at(call_target_address, |
| 4889 unoptimized_code) == |
4887 isolate->builtins()->OnStackReplacement()->entry()) { | 4890 isolate->builtins()->OnStackReplacement()->entry()) { |
4888 return ON_STACK_REPLACEMENT; | 4891 return ON_STACK_REPLACEMENT; |
4889 } | 4892 } |
4890 | 4893 |
4891 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4894 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4892 Assembler::target_address_at(call_target_address)); | 4895 Assembler::target_address_at(call_target_address, |
| 4896 unoptimized_code)); |
4893 return OSR_AFTER_STACK_CHECK; | 4897 return OSR_AFTER_STACK_CHECK; |
4894 } | 4898 } |
4895 | 4899 |
4896 | 4900 |
4897 } } // namespace v8::internal | 4901 } } // namespace v8::internal |
4898 | 4902 |
4899 #endif // V8_TARGET_ARCH_X64 | 4903 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |