| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #define __ ACCESS_MASM(cgen()->masm()) | 43 #define __ ACCESS_MASM(cgen()->masm()) |
| 44 | 44 |
| 45 void JumpTarget::DoJump() { | 45 void JumpTarget::DoJump() { |
| 46 ASSERT(cgen()->has_valid_frame()); | 46 ASSERT(cgen()->has_valid_frame()); |
| 47 // Live non-frame registers are not allowed at unconditional jumps | 47 // Live non-frame registers are not allowed at unconditional jumps |
| 48 // because we have no way of invalidating the corresponding results | 48 // because we have no way of invalidating the corresponding results |
| 49 // which are still live in the C++ code. | 49 // which are still live in the C++ code. |
| 50 ASSERT(cgen()->HasValidEntryRegisters()); | 50 ASSERT(cgen()->HasValidEntryRegisters()); |
| 51 | 51 |
| 52 if (entry_frame_set_) { | 52 if (entry_frame_set_) { |
| 53 if (entry_label_.is_bound()) { |
| 54 // If we already bound and generated code at the destination then it |
| 55 // is too late to ask for less optimistic type assumptions. |
| 56 ASSERT(entry_frame_.IsCompatibleWith(cgen()->frame())); |
| 57 } |
| 53 // There already a frame expectation at the target. | 58 // There already a frame expectation at the target. |
| 54 cgen()->frame()->MergeTo(&entry_frame_); | 59 cgen()->frame()->MergeTo(&entry_frame_); |
| 55 cgen()->DeleteFrame(); | 60 cgen()->DeleteFrame(); |
| 56 } else { | 61 } else { |
| 57 // Clone the current frame to use as the expected one at the target. | 62 // Clone the current frame to use as the expected one at the target. |
| 58 set_entry_frame(cgen()->frame()); | 63 set_entry_frame(cgen()->frame()); |
| 59 RegisterFile empty; | 64 RegisterFile empty; |
| 60 cgen()->SetFrame(NULL, &empty); | 65 cgen()->SetFrame(NULL, &empty); |
| 61 } | 66 } |
| 62 __ jmp(&entry_label_); | 67 __ jmp(&entry_label_); |
| 63 } | 68 } |
| 64 | 69 |
| 65 | 70 |
| 66 void JumpTarget::DoBranch(Condition cc, Hint ignored) { | 71 void JumpTarget::DoBranch(Condition cc, Hint ignored) { |
| 67 ASSERT(cgen()->has_valid_frame()); | 72 ASSERT(cgen()->has_valid_frame()); |
| 68 | 73 |
| 69 if (entry_frame_set_) { | 74 if (entry_frame_set_) { |
| 70 // Backward branch. We have an expected frame to merge to on the | 75 if (entry_label_.is_bound()) { |
| 71 // backward edge. | 76 // If we already bound and generated code at the destination then it |
| 77 // is too late to ask for less optimistic type assumptions. |
| 78 ASSERT(entry_frame_.IsCompatibleWith(cgen()->frame())); |
| 79 } |
| 80 // We have an expected frame to merge to on the backward edge. |
| 72 cgen()->frame()->MergeTo(&entry_frame_, cc); | 81 cgen()->frame()->MergeTo(&entry_frame_, cc); |
| 73 } else { | 82 } else { |
| 74 // Clone the current frame to use as the expected one at the target. | 83 // Clone the current frame to use as the expected one at the target. |
| 75 set_entry_frame(cgen()->frame()); | 84 set_entry_frame(cgen()->frame()); |
| 76 } | 85 } |
| 77 __ b(cc, &entry_label_); | 86 __ b(cc, &entry_label_); |
| 78 if (cc == al) { | 87 if (cc == al) { |
| 79 cgen()->DeleteFrame(); | 88 cgen()->DeleteFrame(); |
| 80 } | 89 } |
| 81 } | 90 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 __ bind(&entry_label_); | 139 __ bind(&entry_label_); |
| 131 } | 140 } |
| 132 | 141 |
| 133 | 142 |
| 134 #undef __ | 143 #undef __ |
| 135 | 144 |
| 136 | 145 |
| 137 } } // namespace v8::internal | 146 } } // namespace v8::internal |
| 138 | 147 |
| 139 #endif // V8_TARGET_ARCH_ARM | 148 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |