| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 275 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 276 SmiCheck smi_check = INLINE_SMI_CHECK); | 276 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 277 | 277 |
| 278 #ifdef ENABLE_DEBUGGER_SUPPORT | 278 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 279 // --------------------------------------------------------------------------- | 279 // --------------------------------------------------------------------------- |
| 280 // Debugger Support | 280 // Debugger Support |
| 281 | 281 |
| 282 void DebugBreak(); | 282 void DebugBreak(); |
| 283 #endif | 283 #endif |
| 284 | 284 |
| 285 // Generates function and stub prologue code. |
| 286 void Prologue(PrologueFrameMode frame_mode); |
| 287 |
| 285 // Enter specific kind of exit frame; either in normal or | 288 // Enter specific kind of exit frame; either in normal or |
| 286 // debug mode. Expects the number of arguments in register rax and | 289 // debug mode. Expects the number of arguments in register rax and |
| 287 // sets up the number of arguments in register rdi and the pointer | 290 // sets up the number of arguments in register rdi and the pointer |
| 288 // to the first argument in register rsi. | 291 // to the first argument in register rsi. |
| 289 // | 292 // |
| 290 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack | 293 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack |
| 291 // accessible via StackSpaceOperand. | 294 // accessible via StackSpaceOperand. |
| 292 void EnterExitFrame(int arg_stack_space = 0, bool save_doubles = false); | 295 void EnterExitFrame(int arg_stack_space = 0, bool save_doubles = false); |
| 293 | 296 |
| 294 // Enter specific kind of exit frame. Allocates arg_stack_space * kPointerSize | 297 // Enter specific kind of exit frame. Allocates arg_stack_space * kPointerSize |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 void Move(Register dst, Handle<Object> source); | 808 void Move(Register dst, Handle<Object> source); |
| 806 void Move(const Operand& dst, Handle<Object> source); | 809 void Move(const Operand& dst, Handle<Object> source); |
| 807 void Cmp(Register dst, Handle<Object> source); | 810 void Cmp(Register dst, Handle<Object> source); |
| 808 void Cmp(const Operand& dst, Handle<Object> source); | 811 void Cmp(const Operand& dst, Handle<Object> source); |
| 809 void Cmp(Register dst, Smi* src); | 812 void Cmp(Register dst, Smi* src); |
| 810 void Cmp(const Operand& dst, Smi* src); | 813 void Cmp(const Operand& dst, Smi* src); |
| 811 void Push(Handle<Object> source); | 814 void Push(Handle<Object> source); |
| 812 | 815 |
| 813 // Load a heap object and handle the case of new-space objects by | 816 // Load a heap object and handle the case of new-space objects by |
| 814 // indirecting via a global cell. | 817 // indirecting via a global cell. |
| 815 void LoadHeapObject(Register result, Handle<HeapObject> object); | 818 void MoveHeapObject(Register result, Handle<Object> object); |
| 816 void CmpHeapObject(Register reg, Handle<HeapObject> object); | |
| 817 void PushHeapObject(Handle<HeapObject> object); | |
| 818 | |
| 819 void LoadObject(Register result, Handle<Object> object) { | |
| 820 AllowDeferredHandleDereference heap_object_check; | |
| 821 if (object->IsHeapObject()) { | |
| 822 LoadHeapObject(result, Handle<HeapObject>::cast(object)); | |
| 823 } else { | |
| 824 Move(result, object); | |
| 825 } | |
| 826 } | |
| 827 | |
| 828 void CmpObject(Register reg, Handle<Object> object) { | |
| 829 AllowDeferredHandleDereference heap_object_check; | |
| 830 if (object->IsHeapObject()) { | |
| 831 CmpHeapObject(reg, Handle<HeapObject>::cast(object)); | |
| 832 } else { | |
| 833 Cmp(reg, object); | |
| 834 } | |
| 835 } | |
| 836 | 819 |
| 837 // Load a global cell into a register. | 820 // Load a global cell into a register. |
| 838 void LoadGlobalCell(Register dst, Handle<Cell> cell); | 821 void LoadGlobalCell(Register dst, Handle<Cell> cell); |
| 839 | 822 |
| 840 // Emit code to discard a non-negative number of pointer-sized elements | 823 // Emit code to discard a non-negative number of pointer-sized elements |
| 841 // from the stack, clobbering only the rsp register. | 824 // from the stack, clobbering only the rsp register. |
| 842 void Drop(int stack_elements); | 825 void Drop(int stack_elements); |
| 843 | 826 |
| 844 void Call(Label* target) { call(target); } | 827 void Call(Label* target) { call(target); } |
| 845 void Push(Register src) { push(src); } | 828 void Push(Register src) { push(src); } |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 Label* gc_required, | 1091 Label* gc_required, |
| 1109 AllocationFlags flags); | 1092 AllocationFlags flags); |
| 1110 | 1093 |
| 1111 void Allocate(Register object_size, | 1094 void Allocate(Register object_size, |
| 1112 Register result, | 1095 Register result, |
| 1113 Register result_end, | 1096 Register result_end, |
| 1114 Register scratch, | 1097 Register scratch, |
| 1115 Label* gc_required, | 1098 Label* gc_required, |
| 1116 AllocationFlags flags); | 1099 AllocationFlags flags); |
| 1117 | 1100 |
| 1101 // Record a JS object allocation if allocations tracking mode is on. |
| 1102 void RecordObjectAllocation(Isolate* isolate, |
| 1103 Register object, |
| 1104 Register object_size); |
| 1105 |
| 1106 void RecordObjectAllocation(Isolate* isolate, |
| 1107 Register object, |
| 1108 int object_size); |
| 1109 |
| 1118 // Undo allocation in new space. The object passed and objects allocated after | 1110 // Undo allocation in new space. The object passed and objects allocated after |
| 1119 // it will no longer be allocated. Make sure that no pointers are left to the | 1111 // it will no longer be allocated. Make sure that no pointers are left to the |
| 1120 // object(s) no longer allocated as they would be invalid when allocation is | 1112 // object(s) no longer allocated as they would be invalid when allocation is |
| 1121 // un-done. | 1113 // un-done. |
| 1122 void UndoAllocationInNewSpace(Register object); | 1114 void UndoAllocationInNewSpace(Register object); |
| 1123 | 1115 |
| 1124 // Allocate a heap number in new space with undefined value. Returns | 1116 // Allocate a heap number in new space with undefined value. Returns |
| 1125 // tagged pointer in result register, or jumps to gc_required if new | 1117 // tagged pointer in result register, or jumps to gc_required if new |
| 1126 // space is full. | 1118 // space is full. |
| 1127 void AllocateHeapNumber(Register result, | 1119 void AllocateHeapNumber(Register result, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 // Expects object in rax and returns map with validated enum cache | 1388 // Expects object in rax and returns map with validated enum cache |
| 1397 // in rax. Assumes that any other register can be used as a scratch. | 1389 // in rax. Assumes that any other register can be used as a scratch. |
| 1398 void CheckEnumCache(Register null_value, | 1390 void CheckEnumCache(Register null_value, |
| 1399 Label* call_runtime); | 1391 Label* call_runtime); |
| 1400 | 1392 |
| 1401 // AllocationMemento support. Arrays may have an associated | 1393 // AllocationMemento support. Arrays may have an associated |
| 1402 // AllocationMemento object that can be checked for in order to pretransition | 1394 // AllocationMemento object that can be checked for in order to pretransition |
| 1403 // to another type. | 1395 // to another type. |
| 1404 // On entry, receiver_reg should point to the array object. | 1396 // On entry, receiver_reg should point to the array object. |
| 1405 // scratch_reg gets clobbered. | 1397 // scratch_reg gets clobbered. |
| 1406 // If allocation info is present, condition flags are set to equal | 1398 // If allocation info is present, condition flags are set to equal. |
| 1407 void TestJSArrayForAllocationMemento(Register receiver_reg, | 1399 void TestJSArrayForAllocationMemento(Register receiver_reg, |
| 1408 Register scratch_reg); | 1400 Register scratch_reg, |
| 1401 Label* no_memento_found); |
| 1402 |
| 1403 void JumpIfJSArrayHasAllocationMemento(Register receiver_reg, |
| 1404 Register scratch_reg, |
| 1405 Label* memento_found) { |
| 1406 Label no_memento_found; |
| 1407 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, |
| 1408 &no_memento_found); |
| 1409 j(equal, memento_found); |
| 1410 bind(&no_memento_found); |
| 1411 } |
| 1409 | 1412 |
| 1410 private: | 1413 private: |
| 1411 // Order general registers are pushed by Pushad. | 1414 // Order general registers are pushed by Pushad. |
| 1412 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r14, r15. | 1415 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r14, r15. |
| 1413 static const int kSafepointPushRegisterIndices[Register::kNumRegisters]; | 1416 static const int kSafepointPushRegisterIndices[Register::kNumRegisters]; |
| 1414 static const int kNumSafepointSavedRegisters = 11; | 1417 static const int kNumSafepointSavedRegisters = 11; |
| 1415 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; | 1418 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; |
| 1416 | 1419 |
| 1417 bool generating_stub_; | 1420 bool generating_stub_; |
| 1418 bool allow_stub_calls_; | 1421 bool allow_stub_calls_; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 masm->popfq(); \ | 1586 masm->popfq(); \ |
| 1584 } \ | 1587 } \ |
| 1585 masm-> | 1588 masm-> |
| 1586 #else | 1589 #else |
| 1587 #define ACCESS_MASM(masm) masm-> | 1590 #define ACCESS_MASM(masm) masm-> |
| 1588 #endif | 1591 #endif |
| 1589 | 1592 |
| 1590 } } // namespace v8::internal | 1593 } } // namespace v8::internal |
| 1591 | 1594 |
| 1592 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1595 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |