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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // You can't jump backwards to an already bound label unless you admitted | 69 // You can't jump backwards to an already bound label unless you admitted |
70 // up front that this was a bidirectional jump target. Bidirectional jump | 70 // up front that this was a bidirectional jump target. Bidirectional jump |
71 // targets will zap their type info when bound in case some later virtual | 71 // targets will zap their type info when bound in case some later virtual |
72 // frame with less precise type info branches to them. | 72 // frame with less precise type info branches to them. |
73 ASSERT(direction_ != FORWARD_ONLY); | 73 ASSERT(direction_ != FORWARD_ONLY); |
74 } | 74 } |
75 __ jmp(&entry_label_); | 75 __ jmp(&entry_label_); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void JumpTarget::DoBranch(Condition cc, Hint ignored) { | 79 void JumpTarget::DoBranch(Condition cond, Hint ignored) { |
80 ASSERT(cgen()->has_valid_frame()); | 80 ASSERT(cgen()->has_valid_frame()); |
81 | 81 |
82 if (entry_frame_set_) { | 82 if (entry_frame_set_) { |
83 if (entry_label_.is_bound()) { | 83 if (entry_label_.is_bound()) { |
84 // If we already bound and generated code at the destination then it | 84 // If we already bound and generated code at the destination then it |
85 // is too late to ask for less optimistic type assumptions. | 85 // is too late to ask for less optimistic type assumptions. |
86 ASSERT(entry_frame_.IsCompatibleWith(cgen()->frame())); | 86 ASSERT(entry_frame_.IsCompatibleWith(cgen()->frame())); |
87 } | 87 } |
88 // We have an expected frame to merge to on the backward edge. | 88 // We have an expected frame to merge to on the backward edge. |
89 cgen()->frame()->MergeTo(&entry_frame_, cc); | 89 cgen()->frame()->MergeTo(&entry_frame_, cond); |
90 } else { | 90 } else { |
91 // Clone the current frame to use as the expected one at the target. | 91 // Clone the current frame to use as the expected one at the target. |
92 set_entry_frame(cgen()->frame()); | 92 set_entry_frame(cgen()->frame()); |
93 } | 93 } |
94 if (entry_label_.is_bound()) { | 94 if (entry_label_.is_bound()) { |
95 // You can't branch backwards to an already bound label unless you admitted | 95 // You can't branch backwards to an already bound label unless you admitted |
96 // up front that this was a bidirectional jump target. Bidirectional jump | 96 // up front that this was a bidirectional jump target. Bidirectional jump |
97 // targets will zap their type info when bound in case some later virtual | 97 // targets will zap their type info when bound in case some later virtual |
98 // frame with less precise type info branches to them. | 98 // frame with less precise type info branches to them. |
99 ASSERT(direction_ != FORWARD_ONLY); | 99 ASSERT(direction_ != FORWARD_ONLY); |
100 } | 100 } |
101 __ b(cc, &entry_label_); | 101 __ b(cond, &entry_label_); |
102 if (cc == al) { | 102 if (cond == al) { |
103 cgen()->DeleteFrame(); | 103 cgen()->DeleteFrame(); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 void JumpTarget::Call() { | 108 void JumpTarget::Call() { |
109 // Call is used to push the address of the catch block on the stack as | 109 // Call is used to push the address of the catch block on the stack as |
110 // a return address when compiling try/catch and try/finally. We | 110 // a return address when compiling try/catch and try/finally. We |
111 // fully spill the frame before making the call. The expected frame | 111 // fully spill the frame before making the call. The expected frame |
112 // at the label (which should be the only one) is the spilled current | 112 // at the label (which should be the only one) is the spilled current |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 __ bind(&entry_label_); | 155 __ bind(&entry_label_); |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 #undef __ | 159 #undef __ |
160 | 160 |
161 | 161 |
162 } } // namespace v8::internal | 162 } } // namespace v8::internal |
163 | 163 |
164 #endif // V8_TARGET_ARCH_ARM | 164 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |