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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 | 301 |
302 // Forget the frame elements that will be popped by the call. | 302 // Forget the frame elements that will be popped by the call. |
303 Forget(dropped_args); | 303 Forget(dropped_args); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 void VirtualFrame::PrepareForReturn() { | 307 void VirtualFrame::PrepareForReturn() { |
308 // Spill all locals. This is necessary to make sure all locals have | 308 // Spill all locals. This is necessary to make sure all locals have |
309 // the right value when breaking at the return site in the debugger. | 309 // the right value when breaking at the return site in the debugger. |
310 // | 310 // Set their static type to unknown so that they will match the known |
311 // TODO(203): It is also necessary to ensure that merging at the | 311 // return frame. |
312 // return site does not generate code to overwrite eax, where the | 312 for (int i = 0; i < expression_base_index(); i++) { |
313 // return value is kept in a non-refcounted register reference. | 313 SpillElementAt(i); |
314 for (int i = 0; i < expression_base_index(); i++) SpillElementAt(i); | 314 elements_[i].set_static_type(StaticType::unknown()); |
| 315 } |
315 } | 316 } |
316 | 317 |
317 | 318 |
318 void VirtualFrame::SetElementAt(int index, Result* value) { | 319 void VirtualFrame::SetElementAt(int index, Result* value) { |
319 int frame_index = elements_.length() - index - 1; | 320 int frame_index = elements_.length() - index - 1; |
320 ASSERT(frame_index >= 0); | 321 ASSERT(frame_index >= 0); |
321 ASSERT(frame_index < elements_.length()); | 322 ASSERT(frame_index < elements_.length()); |
322 ASSERT(value->is_valid()); | 323 ASSERT(value->is_valid()); |
323 FrameElement original = elements_[frame_index]; | 324 FrameElement original = elements_[frame_index]; |
324 | 325 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. | 471 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. |
471 // The function ResizeAdd becomes a real function, whose implementation is the | 472 // The function ResizeAdd becomes a real function, whose implementation is the |
472 // inlined ResizeAddInternal. | 473 // inlined ResizeAddInternal. |
473 template <> | 474 template <> |
474 void List<FrameElement, | 475 void List<FrameElement, |
475 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { | 476 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { |
476 ResizeAddInternal(element); | 477 ResizeAddInternal(element); |
477 } | 478 } |
478 | 479 |
479 } } // namespace v8::internal | 480 } } // namespace v8::internal |
OLD | NEW |