| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 __ jmp(&label_); | 90 __ jmp(&label_); |
| 91 // Postcondition: there is no current frame but there is an expected frame | 91 // Postcondition: there is no current frame but there is an expected frame |
| 92 // at the label. | 92 // at the label. |
| 93 } | 93 } |
| 94 | 94 |
| 95 | 95 |
| 96 void JumpTarget::Jump(Result* arg) { | 96 void JumpTarget::Jump(Result* arg) { |
| 97 ASSERT(cgen_ != NULL); | 97 ASSERT(cgen_ != NULL); |
| 98 ASSERT(cgen_->frame() != NULL); | 98 ASSERT(cgen_->has_valid_frame()); |
| 99 | 99 |
| 100 cgen_->frame()->Push(arg); | 100 cgen_->frame()->Push(arg); |
| 101 Jump(); | 101 Jump(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 void JumpTarget::Branch(Condition cc, Hint hint) { | 105 void JumpTarget::Branch(Condition cc, Hint hint) { |
| 106 // Precondition: there is a current frame. There may or may not be an | 106 // Precondition: there is a current frame. There may or may not be an |
| 107 // expected frame at the label. | 107 // expected frame at the label. |
| 108 ASSERT(cgen_ != NULL); | 108 ASSERT(cgen_ != NULL); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 ASSERT(cgen_->HasValidEntryRegisters()); | 143 ASSERT(cgen_->HasValidEntryRegisters()); |
| 144 __ j(cc, &label_, hint); | 144 __ j(cc, &label_, hint); |
| 145 } | 145 } |
| 146 // Postcondition: there is both a current frame and an expected frame at | 146 // Postcondition: there is both a current frame and an expected frame at |
| 147 // the label and they match. | 147 // the label and they match. |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 void JumpTarget::Branch(Condition cc, Result* arg, Hint hint) { | 151 void JumpTarget::Branch(Condition cc, Result* arg, Hint hint) { |
| 152 ASSERT(cgen_ != NULL); | 152 ASSERT(cgen_ != NULL); |
| 153 ASSERT(cgen_->frame() != NULL); | 153 ASSERT(cgen_->has_valid_frame()); |
| 154 | 154 |
| 155 #ifdef DEBUG | 155 #ifdef DEBUG |
| 156 // We want register results at the call site to stay in the same registers | 156 // We want register results at the call site to stay in the same registers |
| 157 // on the fall-through branch. | 157 // on the fall-through branch. |
| 158 Result::Type arg_type = arg->type(); | 158 Result::Type arg_type = arg->type(); |
| 159 Register arg_reg = arg->is_register() ? arg->reg() : no_reg; | 159 Register arg_reg = arg->is_register() ? arg->reg() : no_reg; |
| 160 #endif | 160 #endif |
| 161 | 161 |
| 162 cgen_->frame()->Push(arg); | 162 cgen_->frame()->Push(arg); |
| 163 Branch(cc, hint); | 163 Branch(cc, hint); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 ASSERT(cgen_ != NULL); | 238 ASSERT(cgen_ != NULL); |
| 239 | 239 |
| 240 #ifdef DEBUG | 240 #ifdef DEBUG |
| 241 // We want register results at the call site to stay in the same | 241 // We want register results at the call site to stay in the same |
| 242 // registers. | 242 // registers. |
| 243 bool had_entry_frame = false; | 243 bool had_entry_frame = false; |
| 244 Result::Type arg_type; | 244 Result::Type arg_type; |
| 245 Register arg_reg; | 245 Register arg_reg; |
| 246 #endif | 246 #endif |
| 247 | 247 |
| 248 if (cgen_->frame() != NULL) { | 248 if (cgen_->has_valid_frame()) { |
| 249 #ifdef DEBUG | 249 #ifdef DEBUG |
| 250 had_entry_frame = true; | 250 had_entry_frame = true; |
| 251 arg_type = arg->type(); | 251 arg_type = arg->type(); |
| 252 arg_reg = arg->is_register() ? arg->reg() : no_reg; | 252 arg_reg = arg->is_register() ? arg->reg() : no_reg; |
| 253 #endif | 253 #endif |
| 254 cgen_->frame()->Push(arg); | 254 cgen_->frame()->Push(arg); |
| 255 } | 255 } |
| 256 Bind(); | 256 Bind(); |
| 257 *arg = cgen_->frame()->Pop(); | 257 *arg = cgen_->frame()->Pop(); |
| 258 | 258 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 #ifdef DEBUG | 294 #ifdef DEBUG |
| 295 is_shadowing_ = false; | 295 is_shadowing_ = false; |
| 296 #endif | 296 #endif |
| 297 } | 297 } |
| 298 | 298 |
| 299 #undef __ | 299 #undef __ |
| 300 | 300 |
| 301 | 301 |
| 302 } } // namespace v8::internal | 302 } } // namespace v8::internal |
| OLD | NEW |