| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_X87_MACRO_ASSEMBLER_X87_H_ |
| 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_X87_MACRO_ASSEMBLER_X87_H_ |
| 7 | 7 |
| 8 #include "assembler.h" | 8 #include "assembler.h" |
| 9 #include "frames.h" | 9 #include "frames.h" |
| 10 #include "v8globals.h" | 10 #include "v8globals.h" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 // Convenience for platform-independent signatures. We do not normally | 15 // Convenience for platform-independent signatures. We do not normally |
| 16 // distinguish memory operands from other operands on ia32. | 16 // distinguish memory operands from other operands on ia32. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 kReturnAtEnd, | 56 kReturnAtEnd, |
| 57 kFallThroughAtEnd | 57 kFallThroughAtEnd |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Record in the remembered set the fact that we have a pointer to new space | 60 // Record in the remembered set the fact that we have a pointer to new space |
| 61 // at the address pointed to by the addr register. Only works if addr is not | 61 // at the address pointed to by the addr register. Only works if addr is not |
| 62 // in new space. | 62 // in new space. |
| 63 void RememberedSetHelper(Register object, // Used for debug code. | 63 void RememberedSetHelper(Register object, // Used for debug code. |
| 64 Register addr, | 64 Register addr, |
| 65 Register scratch, | 65 Register scratch, |
| 66 SaveFPRegsMode save_fp, | |
| 67 RememberedSetFinalAction and_then); | 66 RememberedSetFinalAction and_then); |
| 68 | 67 |
| 69 void CheckPageFlag(Register object, | 68 void CheckPageFlag(Register object, |
| 70 Register scratch, | 69 Register scratch, |
| 71 int mask, | 70 int mask, |
| 72 Condition cc, | 71 Condition cc, |
| 73 Label* condition_met, | 72 Label* condition_met, |
| 74 Label::Distance condition_met_distance = Label::kFar); | 73 Label::Distance condition_met_distance = Label::kFar); |
| 75 | 74 |
| 76 void CheckPageFlagForMap( | 75 void CheckPageFlagForMap( |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Notify the garbage collector that we wrote a pointer into an object. | 130 // Notify the garbage collector that we wrote a pointer into an object. |
| 132 // |object| is the object being stored into, |value| is the object being | 131 // |object| is the object being stored into, |value| is the object being |
| 133 // stored. value and scratch registers are clobbered by the operation. | 132 // stored. value and scratch registers are clobbered by the operation. |
| 134 // The offset is the offset from the start of the object, not the offset from | 133 // The offset is the offset from the start of the object, not the offset from |
| 135 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). | 134 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). |
| 136 void RecordWriteField( | 135 void RecordWriteField( |
| 137 Register object, | 136 Register object, |
| 138 int offset, | 137 int offset, |
| 139 Register value, | 138 Register value, |
| 140 Register scratch, | 139 Register scratch, |
| 141 SaveFPRegsMode save_fp, | |
| 142 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 140 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 143 SmiCheck smi_check = INLINE_SMI_CHECK); | 141 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 144 | 142 |
| 145 // As above, but the offset has the tag presubtracted. For use with | 143 // As above, but the offset has the tag presubtracted. For use with |
| 146 // Operand(reg, off). | 144 // Operand(reg, off). |
| 147 void RecordWriteContextSlot( | 145 void RecordWriteContextSlot( |
| 148 Register context, | 146 Register context, |
| 149 int offset, | 147 int offset, |
| 150 Register value, | 148 Register value, |
| 151 Register scratch, | 149 Register scratch, |
| 152 SaveFPRegsMode save_fp, | |
| 153 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 150 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 154 SmiCheck smi_check = INLINE_SMI_CHECK) { | 151 SmiCheck smi_check = INLINE_SMI_CHECK) { |
| 155 RecordWriteField(context, | 152 RecordWriteField(context, |
| 156 offset + kHeapObjectTag, | 153 offset + kHeapObjectTag, |
| 157 value, | 154 value, |
| 158 scratch, | 155 scratch, |
| 159 save_fp, | |
| 160 remembered_set_action, | 156 remembered_set_action, |
| 161 smi_check); | 157 smi_check); |
| 162 } | 158 } |
| 163 | 159 |
| 164 // Notify the garbage collector that we wrote a pointer into a fixed array. | 160 // Notify the garbage collector that we wrote a pointer into a fixed array. |
| 165 // |array| is the array being stored into, |value| is the | 161 // |array| is the array being stored into, |value| is the |
| 166 // object being stored. |index| is the array index represented as a | 162 // object being stored. |index| is the array index represented as a |
| 167 // Smi. All registers are clobbered by the operation RecordWriteArray | 163 // Smi. All registers are clobbered by the operation RecordWriteArray |
| 168 // filters out smis so it does not update the write barrier if the | 164 // filters out smis so it does not update the write barrier if the |
| 169 // value is a smi. | 165 // value is a smi. |
| 170 void RecordWriteArray( | 166 void RecordWriteArray( |
| 171 Register array, | 167 Register array, |
| 172 Register value, | 168 Register value, |
| 173 Register index, | 169 Register index, |
| 174 SaveFPRegsMode save_fp, | |
| 175 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 170 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 176 SmiCheck smi_check = INLINE_SMI_CHECK); | 171 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 177 | 172 |
| 178 // For page containing |object| mark region covering |address| | 173 // For page containing |object| mark region covering |address| |
| 179 // dirty. |object| is the object being stored into, |value| is the | 174 // dirty. |object| is the object being stored into, |value| is the |
| 180 // object being stored. The address and value registers are clobbered by the | 175 // object being stored. The address and value registers are clobbered by the |
| 181 // operation. RecordWrite filters out smis so it does not update the | 176 // operation. RecordWrite filters out smis so it does not update the |
| 182 // write barrier if the value is a smi. | 177 // write barrier if the value is a smi. |
| 183 void RecordWrite( | 178 void RecordWrite( |
| 184 Register object, | 179 Register object, |
| 185 Register address, | 180 Register address, |
| 186 Register value, | 181 Register value, |
| 187 SaveFPRegsMode save_fp, | |
| 188 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 182 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 189 SmiCheck smi_check = INLINE_SMI_CHECK); | 183 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 190 | 184 |
| 191 // For page containing |object| mark the region covering the object's map | 185 // For page containing |object| mark the region covering the object's map |
| 192 // dirty. |object| is the object being stored into, |map| is the Map object | 186 // dirty. |object| is the object being stored into, |map| is the Map object |
| 193 // that was stored. | 187 // that was stored. |
| 194 void RecordWriteForMap( | 188 void RecordWriteForMap( |
| 195 Register object, | 189 Register object, |
| 196 Handle<Map> map, | 190 Handle<Map> map, |
| 197 Register scratch1, | 191 Register scratch1, |
| 198 Register scratch2, | 192 Register scratch2); |
| 199 SaveFPRegsMode save_fp); | |
| 200 | 193 |
| 201 // --------------------------------------------------------------------------- | 194 // --------------------------------------------------------------------------- |
| 202 // Debugger Support | 195 // Debugger Support |
| 203 | 196 |
| 204 void DebugBreak(); | 197 void DebugBreak(); |
| 205 | 198 |
| 206 // Generates function and stub prologue code. | 199 // Generates function and stub prologue code. |
| 207 void StubPrologue(); | 200 void StubPrologue(); |
| 208 void Prologue(bool code_pre_aging); | 201 void Prologue(bool code_pre_aging); |
| 209 | 202 |
| 210 // Enter specific kind of exit frame. Expects the number of | 203 // Enter specific kind of exit frame. Expects the number of |
| 211 // arguments in register eax and sets up the number of arguments in | 204 // arguments in register eax and sets up the number of arguments in |
| 212 // register edi and the pointer to the first argument in register | 205 // register edi and the pointer to the first argument in register |
| 213 // esi. | 206 // esi. |
| 214 void EnterExitFrame(bool save_doubles); | 207 void EnterExitFrame(); |
| 215 | 208 |
| 216 void EnterApiExitFrame(int argc); | 209 void EnterApiExitFrame(int argc); |
| 217 | 210 |
| 218 // Leave the current exit frame. Expects the return value in | 211 // Leave the current exit frame. Expects the return value in |
| 219 // register eax:edx (untouched) and the pointer to the first | 212 // register eax:edx (untouched) and the pointer to the first |
| 220 // argument in register esi. | 213 // argument in register esi. |
| 221 void LeaveExitFrame(bool save_doubles); | 214 void LeaveExitFrame(); |
| 222 | 215 |
| 223 // Leave the current exit frame. Expects the return value in | 216 // Leave the current exit frame. Expects the return value in |
| 224 // register eax (untouched). | 217 // register eax (untouched). |
| 225 void LeaveApiExitFrame(bool restore_context); | 218 void LeaveApiExitFrame(bool restore_context); |
| 226 | 219 |
| 227 // Find the function context up the context chain. | 220 // Find the function context up the context chain. |
| 228 void LoadContext(Register dst, int context_chain_length); | 221 void LoadContext(Register dst, int context_chain_length); |
| 229 | 222 |
| 230 // Conditionally load the cached Array transitioned map of type | 223 // Conditionally load the cached Array transitioned map of type |
| 231 // transitioned_kind from the native context if the map in register | 224 // transitioned_kind from the native context if the map in register |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 InvokeFlag flag, | 312 InvokeFlag flag, |
| 320 const CallWrapper& call_wrapper = NullCallWrapper()); | 313 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 321 | 314 |
| 322 // Store the function for the given builtin in the target register. | 315 // Store the function for the given builtin in the target register. |
| 323 void GetBuiltinFunction(Register target, Builtins::JavaScript id); | 316 void GetBuiltinFunction(Register target, Builtins::JavaScript id); |
| 324 | 317 |
| 325 // Store the code object for the given builtin in the target register. | 318 // Store the code object for the given builtin in the target register. |
| 326 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 319 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
| 327 | 320 |
| 328 // Expression support | 321 // Expression support |
| 329 // cvtsi2sd instruction only writes to the low 64-bit of dst register, which | |
| 330 // hinders register renaming and makes dependence chains longer. So we use | |
| 331 // xorps to clear the dst register before cvtsi2sd to solve this issue. | |
| 332 void Cvtsi2sd(XMMRegister dst, Register src) { Cvtsi2sd(dst, Operand(src)); } | |
| 333 void Cvtsi2sd(XMMRegister dst, const Operand& src); | |
| 334 | |
| 335 // Support for constant splitting. | 322 // Support for constant splitting. |
| 336 bool IsUnsafeImmediate(const Immediate& x); | 323 bool IsUnsafeImmediate(const Immediate& x); |
| 337 void SafeMove(Register dst, const Immediate& x); | 324 void SafeMove(Register dst, const Immediate& x); |
| 338 void SafePush(const Immediate& x); | 325 void SafePush(const Immediate& x); |
| 339 | 326 |
| 340 // Compare object type for heap object. | 327 // Compare object type for heap object. |
| 341 // Incoming register is heap_object and outgoing register is map. | 328 // Incoming register is heap_object and outgoing register is map. |
| 342 void CmpObjectType(Register heap_object, InstanceType type, Register map); | 329 void CmpObjectType(Register heap_object, InstanceType type, Register map); |
| 343 | 330 |
| 344 // Compare instance type for map. | 331 // Compare instance type for map. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 361 void CheckFastSmiElements(Register map, | 348 void CheckFastSmiElements(Register map, |
| 362 Label* fail, | 349 Label* fail, |
| 363 Label::Distance distance = Label::kFar); | 350 Label::Distance distance = Label::kFar); |
| 364 | 351 |
| 365 // Check to see if maybe_number can be stored as a double in | 352 // Check to see if maybe_number can be stored as a double in |
| 366 // FastDoubleElements. If it can, store it at the index specified by key in | 353 // FastDoubleElements. If it can, store it at the index specified by key in |
| 367 // the FastDoubleElements array elements, otherwise jump to fail. | 354 // the FastDoubleElements array elements, otherwise jump to fail. |
| 368 void StoreNumberToDoubleElements(Register maybe_number, | 355 void StoreNumberToDoubleElements(Register maybe_number, |
| 369 Register elements, | 356 Register elements, |
| 370 Register key, | 357 Register key, |
| 371 Register scratch1, | 358 Register scratch, |
| 372 XMMRegister scratch2, | |
| 373 Label* fail, | 359 Label* fail, |
| 374 int offset = 0); | 360 int offset = 0); |
| 375 | 361 |
| 376 // Compare an object's map with the specified map. | 362 // Compare an object's map with the specified map. |
| 377 void CompareMap(Register obj, Handle<Map> map); | 363 void CompareMap(Register obj, Handle<Map> map); |
| 378 | 364 |
| 379 // Check if the map of an object is equal to a specified map and branch to | 365 // Check if the map of an object is equal to a specified map and branch to |
| 380 // label if not. Skip the smi check if not required (object is known to be a | 366 // label if not. Skip the smi check if not required (object is known to be a |
| 381 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match | 367 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match |
| 382 // against maps that are ElementsKind transition maps of the specified map. | 368 // against maps that are ElementsKind transition maps of the specified map. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 409 |
| 424 // The contents of the scratch register will be overwritten. | 410 // The contents of the scratch register will be overwritten. |
| 425 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail); | 411 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail); |
| 426 | 412 |
| 427 // FCmp is similar to integer cmp, but requires unsigned | 413 // FCmp is similar to integer cmp, but requires unsigned |
| 428 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). | 414 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). |
| 429 void FCmp(); | 415 void FCmp(); |
| 430 | 416 |
| 431 void ClampUint8(Register reg); | 417 void ClampUint8(Register reg); |
| 432 | 418 |
| 433 void ClampDoubleToUint8(XMMRegister input_reg, | |
| 434 XMMRegister scratch_reg, | |
| 435 Register result_reg); | |
| 436 | |
| 437 void SlowTruncateToI(Register result_reg, Register input_reg, | 419 void SlowTruncateToI(Register result_reg, Register input_reg, |
| 438 int offset = HeapNumber::kValueOffset - kHeapObjectTag); | 420 int offset = HeapNumber::kValueOffset - kHeapObjectTag); |
| 439 | 421 |
| 440 void TruncateHeapNumberToI(Register result_reg, Register input_reg); | 422 void TruncateHeapNumberToI(Register result_reg, Register input_reg); |
| 441 void TruncateDoubleToI(Register result_reg, XMMRegister input_reg); | 423 void TruncateX87TOSToI(Register result_reg); |
| 442 | 424 |
| 443 void DoubleToI(Register result_reg, XMMRegister input_reg, | 425 void X87TOSToI(Register result_reg, MinusZeroMode minus_zero_mode, |
| 444 XMMRegister scratch, MinusZeroMode minus_zero_mode, | |
| 445 Label* conversion_failed, Label::Distance dst = Label::kFar); | 426 Label* conversion_failed, Label::Distance dst = Label::kFar); |
| 446 | 427 |
| 447 void TaggedToI(Register result_reg, Register input_reg, XMMRegister temp, | 428 void TaggedToI(Register result_reg, Register input_reg, |
| 448 MinusZeroMode minus_zero_mode, Label* lost_precision); | 429 MinusZeroMode minus_zero_mode, Label* lost_precision); |
| 449 | 430 |
| 450 // Smi tagging support. | 431 // Smi tagging support. |
| 451 void SmiTag(Register reg) { | 432 void SmiTag(Register reg) { |
| 452 STATIC_ASSERT(kSmiTag == 0); | 433 STATIC_ASSERT(kSmiTag == 0); |
| 453 STATIC_ASSERT(kSmiTagSize == 1); | 434 STATIC_ASSERT(kSmiTagSize == 1); |
| 454 add(reg, reg); | 435 add(reg, reg); |
| 455 } | 436 } |
| 456 void SmiUntag(Register reg) { | 437 void SmiUntag(Register reg) { |
| 457 sar(reg, kSmiTagSize); | 438 sar(reg, kSmiTagSize); |
| 458 } | 439 } |
| 459 | 440 |
| 460 // Modifies the register even if it does not contain a Smi! | 441 // Modifies the register even if it does not contain a Smi! |
| 461 void SmiUntag(Register reg, Label* is_smi) { | 442 void SmiUntag(Register reg, Label* is_smi) { |
| 462 STATIC_ASSERT(kSmiTagSize == 1); | 443 STATIC_ASSERT(kSmiTagSize == 1); |
| 463 sar(reg, kSmiTagSize); | 444 sar(reg, kSmiTagSize); |
| 464 STATIC_ASSERT(kSmiTag == 0); | 445 STATIC_ASSERT(kSmiTag == 0); |
| 465 j(not_carry, is_smi); | 446 j(not_carry, is_smi); |
| 466 } | 447 } |
| 467 | 448 |
| 468 void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch); | 449 void LoadUint32NoSSE2(Register src); |
| 469 | 450 |
| 470 // Jump the register contains a smi. | 451 // Jump the register contains a smi. |
| 471 inline void JumpIfSmi(Register value, | 452 inline void JumpIfSmi(Register value, |
| 472 Label* smi_label, | 453 Label* smi_label, |
| 473 Label::Distance distance = Label::kFar) { | 454 Label::Distance distance = Label::kFar) { |
| 474 test(value, Immediate(kSmiTagMask)); | 455 test(value, Immediate(kSmiTagMask)); |
| 475 j(zero, smi_label, distance); | 456 j(zero, smi_label, distance); |
| 476 } | 457 } |
| 477 // Jump if the operand is a smi. | 458 // Jump if the operand is a smi. |
| 478 inline void JumpIfSmi(Operand value, | 459 inline void JumpIfSmi(Operand value, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 493 void EnumLength(Register dst, Register map); | 474 void EnumLength(Register dst, Register map); |
| 494 void NumberOfOwnDescriptors(Register dst, Register map); | 475 void NumberOfOwnDescriptors(Register dst, Register map); |
| 495 | 476 |
| 496 template<typename Field> | 477 template<typename Field> |
| 497 void DecodeField(Register reg) { | 478 void DecodeField(Register reg) { |
| 498 static const int shift = Field::kShift; | 479 static const int shift = Field::kShift; |
| 499 static const int mask = Field::kMask >> Field::kShift; | 480 static const int mask = Field::kMask >> Field::kShift; |
| 500 sar(reg, shift); | 481 sar(reg, shift); |
| 501 and_(reg, Immediate(mask)); | 482 and_(reg, Immediate(mask)); |
| 502 } | 483 } |
| 503 void LoadPowerOf2(XMMRegister dst, Register scratch, int power); | |
| 504 | 484 |
| 505 // Abort execution if argument is not a number, enabled via --debug-code. | 485 // Abort execution if argument is not a number, enabled via --debug-code. |
| 506 void AssertNumber(Register object); | 486 void AssertNumber(Register object); |
| 507 | 487 |
| 508 // Abort execution if argument is not a smi, enabled via --debug-code. | 488 // Abort execution if argument is not a smi, enabled via --debug-code. |
| 509 void AssertSmi(Register object); | 489 void AssertSmi(Register object); |
| 510 | 490 |
| 511 // Abort execution if argument is a smi, enabled via --debug-code. | 491 // Abort execution if argument is a smi, enabled via --debug-code. |
| 512 void AssertNotSmi(Register object); | 492 void AssertNotSmi(Register object); |
| 513 | 493 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // Call a code stub. Generate the code if necessary. | 690 // Call a code stub. Generate the code if necessary. |
| 711 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); | 691 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); |
| 712 | 692 |
| 713 // Tail call a code stub (jump). Generate the code if necessary. | 693 // Tail call a code stub (jump). Generate the code if necessary. |
| 714 void TailCallStub(CodeStub* stub); | 694 void TailCallStub(CodeStub* stub); |
| 715 | 695 |
| 716 // Return from a code stub after popping its arguments. | 696 // Return from a code stub after popping its arguments. |
| 717 void StubReturn(int argc); | 697 void StubReturn(int argc); |
| 718 | 698 |
| 719 // Call a runtime routine. | 699 // Call a runtime routine. |
| 720 void CallRuntime(const Runtime::Function* f, | 700 void CallRuntime(const Runtime::Function* f, int num_arguments); |
| 721 int num_arguments, | 701 // Convenience function: Same as above, but takes the fid instead. |
| 722 SaveFPRegsMode save_doubles = kDontSaveFPRegs); | 702 void CallRuntime(Runtime::FunctionId id) { |
| 723 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | |
| 724 const Runtime::Function* function = Runtime::FunctionForId(id); | 703 const Runtime::Function* function = Runtime::FunctionForId(id); |
| 725 CallRuntime(function, function->nargs, kSaveFPRegs); | 704 CallRuntime(function, function->nargs); |
| 726 } | 705 } |
| 727 | 706 void CallRuntime(Runtime::FunctionId id, int num_arguments) { |
| 728 // Convenience function: Same as above, but takes the fid instead. | 707 CallRuntime(Runtime::FunctionForId(id), num_arguments); |
| 729 void CallRuntime(Runtime::FunctionId id, | |
| 730 int num_arguments, | |
| 731 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { | |
| 732 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles); | |
| 733 } | 708 } |
| 734 | 709 |
| 735 // Convenience function: call an external reference. | 710 // Convenience function: call an external reference. |
| 736 void CallExternalReference(ExternalReference ref, int num_arguments); | 711 void CallExternalReference(ExternalReference ref, int num_arguments); |
| 737 | 712 |
| 738 // Tail call of a runtime routine (jump). | 713 // Tail call of a runtime routine (jump). |
| 739 // Like JumpToExternalReference, but also takes care of passing the number | 714 // Like JumpToExternalReference, but also takes care of passing the number |
| 740 // of parameters. | 715 // of parameters. |
| 741 void TailCallExternalReference(const ExternalReference& ext, | 716 void TailCallExternalReference(const ExternalReference& ext, |
| 742 int num_arguments, | 717 int num_arguments, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 call(self, RelocInfo::CODE_TARGET); | 783 call(self, RelocInfo::CODE_TARGET); |
| 809 } | 784 } |
| 810 | 785 |
| 811 // Move if the registers are not identical. | 786 // Move if the registers are not identical. |
| 812 void Move(Register target, Register source); | 787 void Move(Register target, Register source); |
| 813 | 788 |
| 814 // Move a constant into a destination using the most efficient encoding. | 789 // Move a constant into a destination using the most efficient encoding. |
| 815 void Move(Register dst, const Immediate& x); | 790 void Move(Register dst, const Immediate& x); |
| 816 void Move(const Operand& dst, const Immediate& x); | 791 void Move(const Operand& dst, const Immediate& x); |
| 817 | 792 |
| 818 // Move an immediate into an XMM register. | |
| 819 void Move(XMMRegister dst, double val); | |
| 820 | |
| 821 // Push a handle value. | 793 // Push a handle value. |
| 822 void Push(Handle<Object> handle) { push(Immediate(handle)); } | 794 void Push(Handle<Object> handle) { push(Immediate(handle)); } |
| 823 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } | 795 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } |
| 824 | 796 |
| 825 Handle<Object> CodeObject() { | 797 Handle<Object> CodeObject() { |
| 826 ASSERT(!code_object_.is_null()); | 798 ASSERT(!code_object_.is_null()); |
| 827 return code_object_; | 799 return code_object_; |
| 828 } | 800 } |
| 829 | 801 |
| 802 // Insert code to verify that the x87 stack has the specified depth (0-7) |
| 803 void VerifyX87StackDepth(uint32_t depth); |
| 804 |
| 830 // Emit code for a truncating division by a constant. The dividend register is | 805 // Emit code for a truncating division by a constant. The dividend register is |
| 831 // unchanged, the result is in edx, and eax gets clobbered. | 806 // unchanged, the result is in edx, and eax gets clobbered. |
| 832 void TruncatingDiv(Register dividend, int32_t divisor); | 807 void TruncatingDiv(Register dividend, int32_t divisor); |
| 833 | 808 |
| 834 // --------------------------------------------------------------------------- | 809 // --------------------------------------------------------------------------- |
| 835 // StatsCounter support | 810 // StatsCounter support |
| 836 | 811 |
| 837 void SetCounter(StatsCounter* counter, int value); | 812 void SetCounter(StatsCounter* counter, int value); |
| 838 void IncrementCounter(StatsCounter* counter, int value); | 813 void IncrementCounter(StatsCounter* counter, int value); |
| 839 void DecrementCounter(StatsCounter* counter, int value); | 814 void DecrementCounter(StatsCounter* counter, int value); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 const ParameterCount& actual, | 931 const ParameterCount& actual, |
| 957 Handle<Code> code_constant, | 932 Handle<Code> code_constant, |
| 958 const Operand& code_operand, | 933 const Operand& code_operand, |
| 959 Label* done, | 934 Label* done, |
| 960 bool* definitely_mismatches, | 935 bool* definitely_mismatches, |
| 961 InvokeFlag flag, | 936 InvokeFlag flag, |
| 962 Label::Distance done_distance, | 937 Label::Distance done_distance, |
| 963 const CallWrapper& call_wrapper = NullCallWrapper()); | 938 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 964 | 939 |
| 965 void EnterExitFramePrologue(); | 940 void EnterExitFramePrologue(); |
| 966 void EnterExitFrameEpilogue(int argc, bool save_doubles); | 941 void EnterExitFrameEpilogue(int argc); |
| 967 | 942 |
| 968 void LeaveExitFrameEpilogue(bool restore_context); | 943 void LeaveExitFrameEpilogue(bool restore_context); |
| 969 | 944 |
| 970 // Allocation support helpers. | 945 // Allocation support helpers. |
| 971 void LoadAllocationTopHelper(Register result, | 946 void LoadAllocationTopHelper(Register result, |
| 972 Register scratch, | 947 Register scratch, |
| 973 AllocationFlags flags); | 948 AllocationFlags flags); |
| 974 | 949 |
| 975 void UpdateAllocationTopHelper(Register result_end, | 950 void UpdateAllocationTopHelper(Register result_end, |
| 976 Register scratch, | 951 Register scratch, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 masm->popfd(); \ | 1057 masm->popfd(); \ |
| 1083 } \ | 1058 } \ |
| 1084 masm-> | 1059 masm-> |
| 1085 #else | 1060 #else |
| 1086 #define ACCESS_MASM(masm) masm-> | 1061 #define ACCESS_MASM(masm) masm-> |
| 1087 #endif | 1062 #endif |
| 1088 | 1063 |
| 1089 | 1064 |
| 1090 } } // namespace v8::internal | 1065 } } // namespace v8::internal |
| 1091 | 1066 |
| 1092 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1067 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ |
| OLD | NEW |