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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 int arg_count); | 329 int arg_count); |
330 | 330 |
331 // Call load IC. Name and receiver are found on top of the frame. | 331 // Call load IC. Name and receiver are found on top of the frame. |
332 // Receiver is not dropped. | 332 // Receiver is not dropped. |
333 Result CallLoadIC(RelocInfo::Mode mode); | 333 Result CallLoadIC(RelocInfo::Mode mode); |
334 | 334 |
335 // Call keyed load IC. Key and receiver are found on top of the | 335 // Call keyed load IC. Key and receiver are found on top of the |
336 // frame. They are not dropped. | 336 // frame. They are not dropped. |
337 Result CallKeyedLoadIC(RelocInfo::Mode mode); | 337 Result CallKeyedLoadIC(RelocInfo::Mode mode); |
338 | 338 |
339 // Call store IC. Name, value, and receiver are found on top of the | 339 |
340 // frame. Receiver is not dropped. | 340 // Calling a store IC and a keyed store IC differ only by which ic is called |
341 Result CallStoreIC(); | 341 // and by the order of the three arguments on the frame. |
| 342 Result CallCommonStoreIC(Handle<Code> ic, |
| 343 Result* value, |
| 344 Result *key, |
| 345 Result* receiver); |
| 346 |
| 347 // Call store IC. Name, value, and receiver are found on top |
| 348 // of the frame. All are dropped. |
| 349 Result CallStoreIC() { |
| 350 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
| 351 Result name = Pop(); |
| 352 Result value = Pop(); |
| 353 Result receiver = Pop(); |
| 354 return CallCommonStoreIC(ic, &value, &name, &receiver); |
| 355 } |
342 | 356 |
343 // Call keyed store IC. Value, key, and receiver are found on top | 357 // Call keyed store IC. Value, key, and receiver are found on top |
344 // of the frame. Key and receiver are not dropped. | 358 // of the frame. All are dropped. |
345 Result CallKeyedStoreIC(); | 359 Result CallKeyedStoreIC() { |
| 360 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); |
| 361 Result value = Pop(); |
| 362 Result key = Pop(); |
| 363 Result receiver = Pop(); |
| 364 return CallCommonStoreIC(ic, &value, &key, &receiver); |
| 365 } |
346 | 366 |
347 // Call call IC. Function name, arguments, and receiver are found on top | 367 // Call call IC. Function name, arguments, and receiver are found on top |
348 // of the frame and dropped by the call. | 368 // of the frame and dropped by the call. |
349 // The argument count does not include the receiver. | 369 // The argument count does not include the receiver. |
350 Result CallCallIC(RelocInfo::Mode mode, int arg_count, int loop_nesting); | 370 Result CallCallIC(RelocInfo::Mode mode, int arg_count, int loop_nesting); |
351 | 371 |
352 // Allocate and call JS function as constructor. Arguments, | 372 // Allocate and call JS function as constructor. Arguments, |
353 // receiver (global object), and function are found on top of the | 373 // receiver (global object), and function are found on top of the |
354 // frame. Function is not dropped. The argument count does not | 374 // frame. Function is not dropped. The argument count does not |
355 // include the receiver. | 375 // include the receiver. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 // should be equal. | 564 // should be equal. |
545 void MergeMoveMemoryToRegisters(VirtualFrame* expected); | 565 void MergeMoveMemoryToRegisters(VirtualFrame* expected); |
546 | 566 |
547 // Invalidates a frame slot (puts an invalid frame element in it). | 567 // Invalidates a frame slot (puts an invalid frame element in it). |
548 // Copies on the frame are correctly handled, and if this slot was | 568 // Copies on the frame are correctly handled, and if this slot was |
549 // the backing store of copies, the index of the new backing store | 569 // the backing store of copies, the index of the new backing store |
550 // is returned. Otherwise, returns kIllegalIndex. | 570 // is returned. Otherwise, returns kIllegalIndex. |
551 // Register counts are correctly updated. | 571 // Register counts are correctly updated. |
552 int InvalidateFrameSlotAt(int index); | 572 int InvalidateFrameSlotAt(int index); |
553 | 573 |
| 574 // This function assumes that a and b are the only results that could be in |
| 575 // the registers a_reg or b_reg. Other results can be live, but must not |
| 576 // be in the registers a_reg or b_reg. The results a and b are invalidated. |
| 577 void MoveResultsToRegisters(Result* a, |
| 578 Result* b, |
| 579 Register a_reg, |
| 580 Register b_reg); |
| 581 |
554 // Call a code stub that has already been prepared for calling (via | 582 // Call a code stub that has already been prepared for calling (via |
555 // PrepareForCall). | 583 // PrepareForCall). |
556 Result RawCallStub(CodeStub* stub); | 584 Result RawCallStub(CodeStub* stub); |
557 | 585 |
558 // Calls a code object which has already been prepared for calling | 586 // Calls a code object which has already been prepared for calling |
559 // (via PrepareForCall). | 587 // (via PrepareForCall). |
560 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); | 588 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); |
561 | 589 |
562 inline bool Equals(VirtualFrame* other); | 590 inline bool Equals(VirtualFrame* other); |
563 | 591 |
564 // Classes that need raw access to the elements_ array. | 592 // Classes that need raw access to the elements_ array. |
565 friend class DeferredCode; | 593 friend class DeferredCode; |
566 friend class JumpTarget; | 594 friend class JumpTarget; |
567 }; | 595 }; |
568 | 596 |
569 | 597 |
570 } } // namespace v8::internal | 598 } } // namespace v8::internal |
571 | 599 |
572 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ | 600 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ |
OLD | NEW |