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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 ASSERT(num_args.is_valid()); | 958 ASSERT(num_args.is_valid()); |
959 __ Set(num_args.reg(), Immediate(arg_count)); | 959 __ Set(num_args.reg(), Immediate(arg_count)); |
960 | 960 |
961 function.Unuse(); | 961 function.Unuse(); |
962 num_args.Unuse(); | 962 num_args.Unuse(); |
963 return RawCallCodeObject(ic, RelocInfo::CONSTRUCT_CALL); | 963 return RawCallCodeObject(ic, RelocInfo::CONSTRUCT_CALL); |
964 } | 964 } |
965 | 965 |
966 | 966 |
967 void VirtualFrame::Drop(int count) { | 967 void VirtualFrame::Drop(int count) { |
| 968 ASSERT(count >= 0); |
968 ASSERT(height() >= count); | 969 ASSERT(height() >= count); |
969 int num_virtual_elements = (element_count() - 1) - stack_pointer_; | 970 int num_virtual_elements = (element_count() - 1) - stack_pointer_; |
970 | 971 |
971 // Emit code to lower the stack pointer if necessary. | 972 // Emit code to lower the stack pointer if necessary. |
972 if (num_virtual_elements < count) { | 973 if (num_virtual_elements < count) { |
973 int num_dropped = count - num_virtual_elements; | 974 int num_dropped = count - num_virtual_elements; |
974 stack_pointer_ -= num_dropped; | 975 stack_pointer_ -= num_dropped; |
975 __ add(Operand(esp), Immediate(num_dropped * kPointerSize)); | 976 __ add(Operand(esp), Immediate(num_dropped * kPointerSize)); |
976 } | 977 } |
977 | 978 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 ASSERT(stack_pointer_ == element_count() - 1); | 1076 ASSERT(stack_pointer_ == element_count() - 1); |
1076 elements_.Add(FrameElement::MemoryElement()); | 1077 elements_.Add(FrameElement::MemoryElement()); |
1077 stack_pointer_++; | 1078 stack_pointer_++; |
1078 __ push(immediate); | 1079 __ push(immediate); |
1079 } | 1080 } |
1080 | 1081 |
1081 | 1082 |
1082 #undef __ | 1083 #undef __ |
1083 | 1084 |
1084 } } // namespace v8::internal | 1085 } } // namespace v8::internal |
OLD | NEW |