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, | |
4863 replacement_code->entry()); | 4862 replacement_code->entry()); |
4864 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4863 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4865 unoptimized_code, call_target_address, replacement_code); | 4864 unoptimized_code, call_target_address, replacement_code); |
4866 } | 4865 } |
4867 | 4866 |
4868 | 4867 |
4869 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4868 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4870 Isolate* isolate, | 4869 Isolate* isolate, |
4871 Code* unoptimized_code, | 4870 Code* unoptimized_code, |
4872 Address pc) { | 4871 Address pc) { |
4873 Address call_target_address = pc - kIntSize; | 4872 Address call_target_address = pc - kIntSize; |
4874 Address jns_instr_address = call_target_address - 3; | 4873 Address jns_instr_address = call_target_address - 3; |
4875 ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); | 4874 ASSERT_EQ(kCallInstruction, *(call_target_address - 1)); |
4876 | 4875 |
4877 if (*jns_instr_address == kJnsInstruction) { | 4876 if (*jns_instr_address == kJnsInstruction) { |
4878 ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); | 4877 ASSERT_EQ(kJnsOffset, *(call_target_address - 2)); |
4879 ASSERT_EQ(isolate->builtins()->InterruptCheck()->entry(), | 4878 ASSERT_EQ(isolate->builtins()->InterruptCheck()->entry(), |
4880 Assembler::target_address_at(call_target_address, | 4879 Assembler::target_address_at(call_target_address)); |
4881 unoptimized_code)); | |
4882 return INTERRUPT; | 4880 return INTERRUPT; |
4883 } | 4881 } |
4884 | 4882 |
4885 ASSERT_EQ(kNopByteOne, *jns_instr_address); | 4883 ASSERT_EQ(kNopByteOne, *jns_instr_address); |
4886 ASSERT_EQ(kNopByteTwo, *(call_target_address - 2)); | 4884 ASSERT_EQ(kNopByteTwo, *(call_target_address - 2)); |
4887 | 4885 |
4888 if (Assembler::target_address_at(call_target_address, | 4886 if (Assembler::target_address_at(call_target_address) == |
4889 unoptimized_code) == | |
4890 isolate->builtins()->OnStackReplacement()->entry()) { | 4887 isolate->builtins()->OnStackReplacement()->entry()) { |
4891 return ON_STACK_REPLACEMENT; | 4888 return ON_STACK_REPLACEMENT; |
4892 } | 4889 } |
4893 | 4890 |
4894 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4891 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4895 Assembler::target_address_at(call_target_address, | 4892 Assembler::target_address_at(call_target_address)); |
4896 unoptimized_code)); | |
4897 return OSR_AFTER_STACK_CHECK; | 4893 return OSR_AFTER_STACK_CHECK; |
4898 } | 4894 } |
4899 | 4895 |
4900 | 4896 |
4901 } } // namespace v8::internal | 4897 } } // namespace v8::internal |
4902 | 4898 |
4903 #endif // V8_TARGET_ARCH_X64 | 4899 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |