OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CodePatcher patcher( | 75 CodePatcher patcher( |
76 code->instruction_start() + pc_offset + gap_code_size, | 76 code->instruction_start() + pc_offset + gap_code_size, |
77 Assembler::kCallInstructionLength); | 77 Assembler::kCallInstructionLength); |
78 patcher.masm()->Call(GetDeoptimizationEntry(deoptimization_index, LAZY), | 78 patcher.masm()->Call(GetDeoptimizationEntry(deoptimization_index, LAZY), |
79 RelocInfo::NONE); | 79 RelocInfo::NONE); |
80 last_pc_offset += gap_code_size + Assembler::kCallInstructionLength; | 80 last_pc_offset += gap_code_size + Assembler::kCallInstructionLength; |
81 } | 81 } |
82 } | 82 } |
83 #ifdef DEBUG | 83 #ifdef DEBUG |
84 // Destroy the code which is not supposed to run again. | 84 // Destroy the code which is not supposed to run again. |
| 85 CHECK(code->safepoint_table_start() >= last_pc_offset); |
85 unsigned instructions = code->safepoint_table_start() - last_pc_offset; | 86 unsigned instructions = code->safepoint_table_start() - last_pc_offset; |
86 CodePatcher destroyer(code->instruction_start() + last_pc_offset, | 87 CodePatcher destroyer(code->instruction_start() + last_pc_offset, |
87 instructions); | 88 instructions); |
88 for (unsigned i = 0; i < instructions; i++) { | 89 for (unsigned i = 0; i < instructions; i++) { |
89 destroyer.masm()->int3(); | 90 destroyer.masm()->int3(); |
90 } | 91 } |
91 #endif | 92 #endif |
92 | 93 |
93 // Add the deoptimizing code to the list. | 94 // Add the deoptimizing code to the list. |
94 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); | 95 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 500 } |
500 __ bind(&done); | 501 __ bind(&done); |
501 } | 502 } |
502 | 503 |
503 #undef __ | 504 #undef __ |
504 | 505 |
505 | 506 |
506 } } // namespace v8::internal | 507 } } // namespace v8::internal |
507 | 508 |
508 #endif // V8_TARGET_ARCH_X64 | 509 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |