OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 if (slot->type() == Slot::PARAMETER) { | 268 if (slot->type() == Slot::PARAMETER) { |
269 PushParameterAt(slot->index()); | 269 PushParameterAt(slot->index()); |
270 return; | 270 return; |
271 } | 271 } |
272 } | 272 } |
273 UNREACHABLE(); | 273 UNREACHABLE(); |
274 } | 274 } |
275 | 275 |
276 | 276 |
| 277 void VirtualFrame::Push(Handle<Object> value) { |
| 278 if (ConstantPoolOverflowed()) { |
| 279 Result temp = cgen()->allocator()->Allocate(); |
| 280 ASSERT(temp.is_valid()); |
| 281 if (value->IsSmi()) { |
| 282 __ Move(temp.reg(), Smi::cast(*value)); |
| 283 } else { |
| 284 __ movq(temp.reg(), value, RelocInfo::EMBEDDED_OBJECT); |
| 285 } |
| 286 Push(&temp); |
| 287 } else { |
| 288 FrameElement element = |
| 289 FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED); |
| 290 elements_.Add(element); |
| 291 } |
| 292 } |
| 293 |
| 294 |
277 void VirtualFrame::Drop(int count) { | 295 void VirtualFrame::Drop(int count) { |
278 ASSERT(count >= 0); | 296 ASSERT(count >= 0); |
279 ASSERT(height() >= count); | 297 ASSERT(height() >= count); |
280 int num_virtual_elements = (element_count() - 1) - stack_pointer_; | 298 int num_virtual_elements = (element_count() - 1) - stack_pointer_; |
281 | 299 |
282 // Emit code to lower the stack pointer if necessary. | 300 // Emit code to lower the stack pointer if necessary. |
283 if (num_virtual_elements < count) { | 301 if (num_virtual_elements < count) { |
284 int num_dropped = count - num_virtual_elements; | 302 int num_dropped = count - num_virtual_elements; |
285 stack_pointer_ -= num_dropped; | 303 stack_pointer_ -= num_dropped; |
286 __ addq(rsp, Immediate(num_dropped * kPointerSize)); | 304 __ addq(rsp, Immediate(num_dropped * kPointerSize)); |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 Adjust(kHandlerSize - 1); | 1283 Adjust(kHandlerSize - 1); |
1266 __ PushTryHandler(IN_JAVASCRIPT, type); | 1284 __ PushTryHandler(IN_JAVASCRIPT, type); |
1267 } | 1285 } |
1268 | 1286 |
1269 | 1287 |
1270 #undef __ | 1288 #undef __ |
1271 | 1289 |
1272 } } // namespace v8::internal | 1290 } } // namespace v8::internal |
1273 | 1291 |
1274 #endif // V8_TARGET_ARCH_X64 | 1292 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |