| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Precondition: there is a current frame. There may or may not be an | 63 // Precondition: there is a current frame. There may or may not be an |
| 64 // expected frame at the label. | 64 // expected frame at the label. |
| 65 ASSERT(code_generator_ != NULL); | 65 ASSERT(code_generator_ != NULL); |
| 66 | 66 |
| 67 VirtualFrame* current_frame = code_generator_->frame(); | 67 VirtualFrame* current_frame = code_generator_->frame(); |
| 68 ASSERT(current_frame != NULL); | 68 ASSERT(current_frame != NULL); |
| 69 | 69 |
| 70 if (expected_frame_ == NULL) { | 70 if (expected_frame_ == NULL) { |
| 71 expected_frame_ = current_frame; | 71 expected_frame_ = current_frame; |
| 72 code_generator_->set_frame(NULL); | 72 code_generator_->set_frame(NULL); |
| 73 // The frame at the actual function return will always have height | 73 // The frame at the actual function return will always have height zero. |
| 74 // zero. | |
| 75 if (code_generator_->IsActualFunctionReturn(this)) { | 74 if (code_generator_->IsActualFunctionReturn(this)) { |
| 76 expected_frame_->Forget(expected_frame_->height()); | 75 expected_frame_->Forget(expected_frame_->height()); |
| 77 } | 76 } |
| 78 } else { | 77 } else { |
| 79 // No code needs to be emitted to merge to the expected frame at the | 78 // No code needs to be emitted to merge to the expected frame at the |
| 80 // actual function return. | 79 // actual function return. |
| 81 if (!code_generator_->IsActualFunctionReturn(this)) { | 80 if (!code_generator_->IsActualFunctionReturn(this)) { |
| 82 current_frame->MergeTo(expected_frame_); | 81 current_frame->MergeTo(expected_frame_); |
| 83 } | 82 } |
| 84 code_generator_->delete_frame(); | 83 code_generator_->delete_frame(); |
| 85 } | 84 } |
| 86 | 85 |
| 87 __ jmp(&label_); | 86 __ jmp(&label_); |
| 88 // Postcondition: there is no current frame but there is an expected frame | 87 // Postcondition: there is no current frame but there is an expected frame |
| 89 // at the label. | 88 // at the label. |
| 90 } | 89 } |
| 91 | 90 |
| 92 | 91 |
| 93 void JumpTarget::Branch(Condition cc, Hint hint) { | 92 void JumpTarget::Branch(Condition cc, Hint hint) { |
| 94 // Precondition: there is a current frame. There may or may not be an | 93 // Precondition: there is a current frame. There may or may not be an |
| 95 // expected frame at the label. | 94 // expected frame at the label. |
| 96 ASSERT(code_generator_ != NULL); | 95 ASSERT(code_generator_ != NULL); |
| 97 ASSERT(masm_ != NULL); | 96 ASSERT(masm_ != NULL); |
| 98 | 97 |
| 99 VirtualFrame* current_frame = code_generator_->frame(); | 98 VirtualFrame* current_frame = code_generator_->frame(); |
| 100 ASSERT(current_frame != NULL); | 99 ASSERT(current_frame != NULL); |
| 101 | 100 |
| 102 if (expected_frame_ == NULL) { | 101 if (expected_frame_ == NULL) { |
| 103 expected_frame_ = new VirtualFrame(current_frame); | 102 expected_frame_ = new VirtualFrame(current_frame); |
| 104 // The frame at the actual function return will always have height | 103 // The frame at the actual function return will always have height zero. |
| 105 // zero. | |
| 106 if (code_generator_->IsActualFunctionReturn(this)) { | 104 if (code_generator_->IsActualFunctionReturn(this)) { |
| 107 expected_frame_->Forget(expected_frame_->height()); | 105 expected_frame_->Forget(expected_frame_->height()); |
| 108 } | 106 } |
| 109 } else { | 107 } else { |
| 110 // No code needs to be emitted to merge to the expected frame at the | 108 // No code needs to be emitted to merge to the expected frame at the |
| 111 // actual function return. | 109 // actual function return. |
| 112 if (!code_generator_->IsActualFunctionReturn(this)) { | 110 if (!code_generator_->IsActualFunctionReturn(this)) { |
| 113 current_frame->MergeTo(expected_frame_); | 111 current_frame->MergeTo(expected_frame_); |
| 114 } | 112 } |
| 115 } | 113 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // the label (and possibly both). The label is unbound. | 146 // the label (and possibly both). The label is unbound. |
| 149 ASSERT(code_generator_ != NULL); | 147 ASSERT(code_generator_ != NULL); |
| 150 ASSERT(masm_ != NULL); | 148 ASSERT(masm_ != NULL); |
| 151 | 149 |
| 152 VirtualFrame* current_frame = code_generator_->frame(); | 150 VirtualFrame* current_frame = code_generator_->frame(); |
| 153 ASSERT(current_frame != NULL || expected_frame_ != NULL); | 151 ASSERT(current_frame != NULL || expected_frame_ != NULL); |
| 154 ASSERT(!label_.is_bound()); | 152 ASSERT(!label_.is_bound()); |
| 155 | 153 |
| 156 if (expected_frame_ == NULL) { | 154 if (expected_frame_ == NULL) { |
| 157 expected_frame_ = new VirtualFrame(current_frame); | 155 expected_frame_ = new VirtualFrame(current_frame); |
| 158 // The frame at the actual function return will always have height | 156 // The frame at the actual function return will always have height zero. |
| 159 // zero. | |
| 160 if (code_generator_->IsActualFunctionReturn(this)) { | 157 if (code_generator_->IsActualFunctionReturn(this)) { |
| 161 expected_frame_->Forget(expected_frame_->height()); | 158 expected_frame_->Forget(expected_frame_->height()); |
| 162 } | 159 } |
| 163 } else if (current_frame == NULL) { | 160 } else if (current_frame == NULL) { |
| 164 code_generator_->set_frame(new VirtualFrame(expected_frame_)); | 161 code_generator_->set_frame(new VirtualFrame(expected_frame_)); |
| 165 } else { | 162 } else { |
| 166 // No code needs to be emitted to merge to the expected frame at the | 163 // No code needs to be emitted to merge to the expected frame at the |
| 167 // actual function return. | 164 // actual function return. |
| 168 if (!code_generator_->IsActualFunctionReturn(this)) { | 165 if (!code_generator_->IsActualFunctionReturn(this)) { |
| 169 current_frame->MergeTo(expected_frame_); | 166 current_frame->MergeTo(expected_frame_); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 205 |
| 209 #ifdef DEBUG | 206 #ifdef DEBUG |
| 210 is_shadowing_ = false; | 207 is_shadowing_ = false; |
| 211 #endif | 208 #endif |
| 212 } | 209 } |
| 213 | 210 |
| 214 #undef __ | 211 #undef __ |
| 215 | 212 |
| 216 | 213 |
| 217 } } // namespace v8::internal | 214 } } // namespace v8::internal |
| OLD | NEW |