| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 // Clear the dirty bits for the range of elements in | 155 // Clear the dirty bits for the range of elements in |
| 156 // [min(stack_pointer_ + 1,begin), end]. | 156 // [min(stack_pointer_ + 1,begin), end]. |
| 157 void VirtualFrame::SyncRange(int begin, int end) { | 157 void VirtualFrame::SyncRange(int begin, int end) { |
| 158 ASSERT(begin >= 0); | 158 ASSERT(begin >= 0); |
| 159 ASSERT(end < element_count()); | 159 ASSERT(end < element_count()); |
| 160 // Sync elements below the range if they have not been materialized | 160 // Sync elements below the range if they have not been materialized |
| 161 // on the stack. | 161 // on the stack. |
| 162 int start = Min(begin, stack_pointer_ + 1); | 162 int start = Min(begin, stack_pointer_ + 1); |
| 163 | 163 |
| 164 // If positive we have to adjust the stack pointer. | 164 // Emit normal 'push' instructions for elements above stack pointer |
| 165 int delta = end - stack_pointer_; | 165 // and use mov instructions if we are below stack pointer. |
| 166 if (delta > 0) { | |
| 167 stack_pointer_ = end; | |
| 168 __ sub(Operand(esp), Immediate(delta * kPointerSize)); | |
| 169 } | |
| 170 | |
| 171 for (int i = start; i <= end; i++) { | 166 for (int i = start; i <= end; i++) { |
| 172 if (!elements_[i].is_synced()) SyncElementBelowStackPointer(i); | 167 if (!elements_[i].is_synced()) { |
| 168 if (i <= stack_pointer_) { |
| 169 SyncElementBelowStackPointer(i); |
| 170 } else { |
| 171 SyncElementByPushing(i); |
| 172 } |
| 173 } |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 | 177 |
| 177 void VirtualFrame::MakeMergable() { | 178 void VirtualFrame::MakeMergable() { |
| 178 for (int i = 0; i < element_count(); i++) { | 179 for (int i = 0; i < element_count(); i++) { |
| 179 FrameElement element = elements_[i]; | 180 FrameElement element = elements_[i]; |
| 180 | 181 |
| 181 if (element.is_constant() || element.is_copy()) { | 182 if (element.is_constant() || element.is_copy()) { |
| 182 if (element.is_synced()) { | 183 if (element.is_synced()) { |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 ASSERT(stack_pointer_ == element_count() - 1); | 1077 ASSERT(stack_pointer_ == element_count() - 1); |
| 1077 elements_.Add(FrameElement::MemoryElement()); | 1078 elements_.Add(FrameElement::MemoryElement()); |
| 1078 stack_pointer_++; | 1079 stack_pointer_++; |
| 1079 __ push(immediate); | 1080 __ push(immediate); |
| 1080 } | 1081 } |
| 1081 | 1082 |
| 1082 | 1083 |
| 1083 #undef __ | 1084 #undef __ |
| 1084 | 1085 |
| 1085 } } // namespace v8::internal | 1086 } } // namespace v8::internal |
| OLD | NEW |