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