| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // MacroAssembler implements a collection of frequently used macros. | 93 // MacroAssembler implements a collection of frequently used macros. |
| 94 class MacroAssembler: public Assembler { | 94 class MacroAssembler: public Assembler { |
| 95 public: | 95 public: |
| 96 // The isolate parameter can be NULL if the macro assembler should | 96 // The isolate parameter can be NULL if the macro assembler should |
| 97 // not use isolate-dependent functionality. In this case, it's the | 97 // not use isolate-dependent functionality. In this case, it's the |
| 98 // responsibility of the caller to never invoke such function on the | 98 // responsibility of the caller to never invoke such function on the |
| 99 // macro assembler. | 99 // macro assembler. |
| 100 MacroAssembler(Isolate* isolate, void* buffer, int size); | 100 MacroAssembler(Isolate* isolate, void* buffer, int size); |
| 101 | 101 |
| 102 // Arguments macros. | 102 // Arguments macros. |
| 103 #define COND_TYPED_ARGS Condition cond, Register r1, const Operand& r2 | 103 #define COND_TYPED_ARGS Condition cond, Register r1, const Operand& r2 |
| 104 #define COND_ARGS cond, r1, r2 | 104 #define COND_ARGS cond, r1, r2 |
| 105 | 105 |
| 106 // Prototypes. | 106 // Cases when relocation is not needed. |
| 107 | |
| 108 // Prototypes for functions with no target (eg Ret()). | |
| 109 #define DECLARE_NOTARGET_PROTOTYPE(Name) \ | |
| 110 void Name(BranchDelaySlot bd = PROTECT); \ | |
| 111 void Name(COND_TYPED_ARGS, BranchDelaySlot bd = PROTECT); \ | |
| 112 inline void Name(BranchDelaySlot bd, COND_TYPED_ARGS) { \ | |
| 113 Name(COND_ARGS, bd); \ | |
| 114 } | |
| 115 | |
| 116 // Prototypes for functions with a target. | |
| 117 | |
| 118 // Cases when relocation may be needed. | |
| 119 #define DECLARE_RELOC_PROTOTYPE(Name, target_type) \ | |
| 120 void Name(target_type target, \ | |
| 121 RelocInfo::Mode rmode, \ | |
| 122 BranchDelaySlot bd = PROTECT); \ | |
| 123 inline void Name(BranchDelaySlot bd, \ | |
| 124 target_type target, \ | |
| 125 RelocInfo::Mode rmode) { \ | |
| 126 Name(target, rmode, bd); \ | |
| 127 } \ | |
| 128 void Name(target_type target, \ | |
| 129 RelocInfo::Mode rmode, \ | |
| 130 COND_TYPED_ARGS, \ | |
| 131 BranchDelaySlot bd = PROTECT); \ | |
| 132 inline void Name(BranchDelaySlot bd, \ | |
| 133 target_type target, \ | |
| 134 RelocInfo::Mode rmode, \ | |
| 135 COND_TYPED_ARGS) { \ | |
| 136 Name(target, rmode, COND_ARGS, bd); \ | |
| 137 } | |
| 138 | |
| 139 // Cases when relocation is not needed. | |
| 140 #define DECLARE_NORELOC_PROTOTYPE(Name, target_type) \ | 107 #define DECLARE_NORELOC_PROTOTYPE(Name, target_type) \ |
| 141 void Name(target_type target, BranchDelaySlot bd = PROTECT); \ | 108 void Name(target_type target, BranchDelaySlot bd = PROTECT); \ |
| 142 inline void Name(BranchDelaySlot bd, target_type target) { \ | 109 inline void Name(BranchDelaySlot bd, target_type target) { \ |
| 143 Name(target, bd); \ | 110 Name(target, bd); \ |
| 144 } \ | 111 } \ |
| 145 void Name(target_type target, \ | 112 void Name(target_type target, \ |
| 146 COND_TYPED_ARGS, \ | 113 COND_TYPED_ARGS, \ |
| 147 BranchDelaySlot bd = PROTECT); \ | 114 BranchDelaySlot bd = PROTECT); \ |
| 148 inline void Name(BranchDelaySlot bd, \ | 115 inline void Name(BranchDelaySlot bd, \ |
| 149 target_type target, \ | 116 target_type target, \ |
| 150 COND_TYPED_ARGS) { \ | 117 COND_TYPED_ARGS) { \ |
| 151 Name(target, COND_ARGS, bd); \ | 118 Name(target, COND_ARGS, bd); \ |
| 152 } | 119 } |
| 153 | 120 |
| 154 // Target prototypes. | |
| 155 | |
| 156 #define DECLARE_JUMP_CALL_PROTOTYPES(Name) \ | |
| 157 DECLARE_NORELOC_PROTOTYPE(Name, Register) \ | |
| 158 DECLARE_NORELOC_PROTOTYPE(Name, const Operand&) \ | |
| 159 DECLARE_RELOC_PROTOTYPE(Name, byte*) \ | |
| 160 DECLARE_RELOC_PROTOTYPE(Name, Handle<Code>) | |
| 161 | |
| 162 #define DECLARE_BRANCH_PROTOTYPES(Name) \ | 121 #define DECLARE_BRANCH_PROTOTYPES(Name) \ |
| 163 DECLARE_NORELOC_PROTOTYPE(Name, Label*) \ | 122 DECLARE_NORELOC_PROTOTYPE(Name, Label*) \ |
| 164 DECLARE_NORELOC_PROTOTYPE(Name, int16_t) | 123 DECLARE_NORELOC_PROTOTYPE(Name, int16_t) |
| 165 | 124 |
| 125 DECLARE_BRANCH_PROTOTYPES(Branch) |
| 126 DECLARE_BRANCH_PROTOTYPES(BranchAndLink) |
| 166 | 127 |
| 167 DECLARE_JUMP_CALL_PROTOTYPES(Jump) | 128 #undef DECLARE_BRANCH_PROTOTYPES |
| 168 DECLARE_JUMP_CALL_PROTOTYPES(Call) | |
| 169 | |
| 170 DECLARE_BRANCH_PROTOTYPES(Branch) | |
| 171 DECLARE_BRANCH_PROTOTYPES(BranchAndLink) | |
| 172 | |
| 173 DECLARE_NOTARGET_PROTOTYPE(Ret) | |
| 174 | |
| 175 #undef COND_TYPED_ARGS | 129 #undef COND_TYPED_ARGS |
| 176 #undef COND_ARGS | 130 #undef COND_ARGS |
| 177 #undef DECLARE_NOTARGET_PROTOTYPE | |
| 178 #undef DECLARE_NORELOC_PROTOTYPE | |
| 179 #undef DECLARE_RELOC_PROTOTYPE | |
| 180 #undef DECLARE_JUMP_CALL_PROTOTYPES | |
| 181 #undef DECLARE_BRANCH_PROTOTYPES | |
| 182 | 131 |
| 183 void CallWithAstId(Handle<Code> code, | |
| 184 RelocInfo::Mode rmode, | |
| 185 unsigned ast_id, | |
| 186 Condition cond = al, | |
| 187 Register r1 = zero_reg, | |
| 188 const Operand& r2 = Operand(zero_reg)); | |
| 189 | 132 |
| 190 int CallSize(Register reg); | 133 // Jump, Call, and Ret pseudo instructions implementing inter-working. |
| 191 int CallSize(Handle<Code> code, RelocInfo::Mode rmode); | 134 #define COND_ARGS Condition cond = al, Register rs = zero_reg, \ |
| 135 const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT |
| 136 |
| 137 void Jump(Register target, COND_ARGS); |
| 138 void Jump(intptr_t target, RelocInfo::Mode rmode, COND_ARGS); |
| 139 void Jump(Address target, RelocInfo::Mode rmode, COND_ARGS); |
| 140 void Jump(Handle<Code> code, RelocInfo::Mode rmode, COND_ARGS); |
| 141 int CallSize(Register target, COND_ARGS); |
| 142 void Call(Register target, COND_ARGS); |
| 143 int CallSize(Address target, RelocInfo::Mode rmode, COND_ARGS); |
| 144 void Call(Address target, RelocInfo::Mode rmode, COND_ARGS); |
| 145 int CallSize(Handle<Code> code, |
| 146 RelocInfo::Mode rmode = RelocInfo::CODE_TARGET, |
| 147 unsigned ast_id = kNoASTId, |
| 148 COND_ARGS); |
| 149 void Call(Handle<Code> code, |
| 150 RelocInfo::Mode rmode = RelocInfo::CODE_TARGET, |
| 151 unsigned ast_id = kNoASTId, |
| 152 COND_ARGS); |
| 153 void Ret(COND_ARGS); |
| 154 inline void Ret(BranchDelaySlot bd) { |
| 155 Ret(al, zero_reg, Operand(zero_reg), bd); |
| 156 } |
| 157 |
| 158 #undef COND_ARGS |
| 192 | 159 |
| 193 // Emit code to discard a non-negative number of pointer-sized elements | 160 // Emit code to discard a non-negative number of pointer-sized elements |
| 194 // from the stack, clobbering only the sp register. | 161 // from the stack, clobbering only the sp register. |
| 195 void Drop(int count, | 162 void Drop(int count, |
| 196 Condition cond = cc_always, | 163 Condition cond = cc_always, |
| 197 Register reg = no_reg, | 164 Register reg = no_reg, |
| 198 const Operand& op = Operand(no_reg)); | 165 const Operand& op = Operand(no_reg)); |
| 199 | 166 |
| 200 void DropAndRet(int drop = 0, | 167 void DropAndRet(int drop = 0, |
| 201 Condition cond = cc_always, | 168 Condition cond = cc_always, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 // --------------------------------------------------------------------------- | 259 // --------------------------------------------------------------------------- |
| 293 // Inline caching support. | 260 // Inline caching support. |
| 294 | 261 |
| 295 // Generate code for checking access rights - used for security checks | 262 // Generate code for checking access rights - used for security checks |
| 296 // on access to global objects across environments. The holder register | 263 // on access to global objects across environments. The holder register |
| 297 // is left untouched, whereas both scratch registers are clobbered. | 264 // is left untouched, whereas both scratch registers are clobbered. |
| 298 void CheckAccessGlobalProxy(Register holder_reg, | 265 void CheckAccessGlobalProxy(Register holder_reg, |
| 299 Register scratch, | 266 Register scratch, |
| 300 Label* miss); | 267 Label* miss); |
| 301 | 268 |
| 269 |
| 270 void LoadFromNumberDictionary(Label* miss, |
| 271 Register elements, |
| 272 Register key, |
| 273 Register result, |
| 274 Register reg0, |
| 275 Register reg1, |
| 276 Register reg2); |
| 277 |
| 278 |
| 302 inline void MarkCode(NopMarkerTypes type) { | 279 inline void MarkCode(NopMarkerTypes type) { |
| 303 nop(type); | 280 nop(type); |
| 304 } | 281 } |
| 305 | 282 |
| 306 // Check if the given instruction is a 'type' marker. | 283 // Check if the given instruction is a 'type' marker. |
| 307 // ie. check if it is a sll zero_reg, zero_reg, <type> (referenced as | 284 // ie. check if it is a sll zero_reg, zero_reg, <type> (referenced as |
| 308 // nop(type)). These instructions are generated to mark special location in | 285 // nop(type)). These instructions are generated to mark special location in |
| 309 // the code, like some special IC code. | 286 // the code, like some special IC code. |
| 310 static inline bool IsMarkedCode(Instr instr, int type) { | 287 static inline bool IsMarkedCode(Instr instr, int type) { |
| 311 ASSERT((FIRST_IC_MARKER <= type) && (type < LAST_CODE_MARKER)); | 288 ASSERT((FIRST_IC_MARKER <= type) && (type < LAST_CODE_MARKER)); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 429 |
| 453 // Load int32 in the rd register. | 430 // Load int32 in the rd register. |
| 454 void li(Register rd, Operand j, bool gen2instr = false); | 431 void li(Register rd, Operand j, bool gen2instr = false); |
| 455 inline void li(Register rd, int32_t j, bool gen2instr = false) { | 432 inline void li(Register rd, int32_t j, bool gen2instr = false) { |
| 456 li(rd, Operand(j), gen2instr); | 433 li(rd, Operand(j), gen2instr); |
| 457 } | 434 } |
| 458 inline void li(Register dst, Handle<Object> value, bool gen2instr = false) { | 435 inline void li(Register dst, Handle<Object> value, bool gen2instr = false) { |
| 459 li(dst, Operand(value), gen2instr); | 436 li(dst, Operand(value), gen2instr); |
| 460 } | 437 } |
| 461 | 438 |
| 462 // Exception-generating instructions and debugging support. | |
| 463 void stop(const char* msg); | |
| 464 | |
| 465 // Push multiple registers on the stack. | 439 // Push multiple registers on the stack. |
| 466 // Registers are saved in numerical order, with higher numbered registers | 440 // Registers are saved in numerical order, with higher numbered registers |
| 467 // saved in higher memory addresses. | 441 // saved in higher memory addresses. |
| 468 void MultiPush(RegList regs); | 442 void MultiPush(RegList regs); |
| 469 void MultiPushReversed(RegList regs); | 443 void MultiPushReversed(RegList regs); |
| 470 | 444 |
| 471 // Lower case push() for compatibility with arch-independent code. | 445 // Lower case push() for compatibility with arch-independent code. |
| 472 void push(Register src) { | 446 void push(Register src) { |
| 473 Addu(sp, sp, Operand(-kPointerSize)); | 447 Addu(sp, sp, Operand(-kPointerSize)); |
| 474 sw(src, MemOperand(sp, 0)); | 448 sw(src, MemOperand(sp, 0)); |
| 475 } | 449 } |
| 476 | 450 |
| 451 // Push a handle. |
| 452 void Push(Handle<Object> handle); |
| 453 |
| 477 // Push two registers. Pushes leftmost register first (to highest address). | 454 // Push two registers. Pushes leftmost register first (to highest address). |
| 478 void Push(Register src1, Register src2) { | 455 void Push(Register src1, Register src2) { |
| 479 Subu(sp, sp, Operand(2 * kPointerSize)); | 456 Subu(sp, sp, Operand(2 * kPointerSize)); |
| 480 sw(src1, MemOperand(sp, 1 * kPointerSize)); | 457 sw(src1, MemOperand(sp, 1 * kPointerSize)); |
| 481 sw(src2, MemOperand(sp, 0 * kPointerSize)); | 458 sw(src2, MemOperand(sp, 0 * kPointerSize)); |
| 482 } | 459 } |
| 483 | 460 |
| 484 // Push three registers. Pushes leftmost register first (to highest address). | 461 // Push three registers. Pushes leftmost register first (to highest address). |
| 485 void Push(Register src1, Register src2, Register src3) { | 462 void Push(Register src1, Register src2, Register src3) { |
| 486 Subu(sp, sp, Operand(3 * kPointerSize)); | 463 Subu(sp, sp, Operand(3 * kPointerSize)); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 // This will truncate a floating-point value outside of the singed 32bit | 546 // This will truncate a floating-point value outside of the singed 32bit |
| 570 // integer range to a 32bit signed integer. | 547 // integer range to a 32bit signed integer. |
| 571 // Expects the double value loaded in input_high and input_low. | 548 // Expects the double value loaded in input_high and input_low. |
| 572 // Exits with the answer in 'result'. | 549 // Exits with the answer in 'result'. |
| 573 // Note that this code does not work for values in the 32bit range! | 550 // Note that this code does not work for values in the 32bit range! |
| 574 void EmitOutOfInt32RangeTruncate(Register result, | 551 void EmitOutOfInt32RangeTruncate(Register result, |
| 575 Register input_high, | 552 Register input_high, |
| 576 Register input_low, | 553 Register input_low, |
| 577 Register scratch); | 554 Register scratch); |
| 578 | 555 |
| 556 // Performs a truncating conversion of a floating point number as used by |
| 557 // the JS bitwise operations. See ECMA-262 9.5: ToInt32. |
| 558 // Exits with 'result' holding the answer and all other registers clobbered. |
| 559 void EmitECMATruncate(Register result, |
| 560 FPURegister double_input, |
| 561 FPURegister single_scratch, |
| 562 Register scratch, |
| 563 Register scratch2, |
| 564 Register scratch3); |
| 565 |
| 579 // ------------------------------------------------------------------------- | 566 // ------------------------------------------------------------------------- |
| 580 // Activation frames. | 567 // Activation frames. |
| 581 | 568 |
| 582 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } | 569 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } |
| 583 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } | 570 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } |
| 584 | 571 |
| 585 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } | 572 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } |
| 586 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } | 573 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } |
| 587 | 574 |
| 588 // Enter exit frame. | 575 // Enter exit frame. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 617 // Setup call kind marking in t1. The method takes t1 as an | 604 // Setup call kind marking in t1. The method takes t1 as an |
| 618 // explicit first parameter to make the code more readable at the | 605 // explicit first parameter to make the code more readable at the |
| 619 // call sites. | 606 // call sites. |
| 620 void SetCallKind(Register dst, CallKind kind); | 607 void SetCallKind(Register dst, CallKind kind); |
| 621 | 608 |
| 622 // Invoke the JavaScript function code by either calling or jumping. | 609 // Invoke the JavaScript function code by either calling or jumping. |
| 623 void InvokeCode(Register code, | 610 void InvokeCode(Register code, |
| 624 const ParameterCount& expected, | 611 const ParameterCount& expected, |
| 625 const ParameterCount& actual, | 612 const ParameterCount& actual, |
| 626 InvokeFlag flag, | 613 InvokeFlag flag, |
| 627 const CallWrapper& call_wrapper = NullCallWrapper(), | 614 const CallWrapper& call_wrapper, |
| 628 CallKind call_kind = CALL_AS_METHOD); | 615 CallKind call_kind); |
| 629 | 616 |
| 630 void InvokeCode(Handle<Code> code, | 617 void InvokeCode(Handle<Code> code, |
| 631 const ParameterCount& expected, | 618 const ParameterCount& expected, |
| 632 const ParameterCount& actual, | 619 const ParameterCount& actual, |
| 633 RelocInfo::Mode rmode, | 620 RelocInfo::Mode rmode, |
| 634 InvokeFlag flag, | 621 InvokeFlag flag, |
| 635 CallKind call_kind = CALL_AS_METHOD); | 622 CallKind call_kind); |
| 636 | 623 |
| 637 // Invoke the JavaScript function in the given register. Changes the | 624 // Invoke the JavaScript function in the given register. Changes the |
| 638 // current context to the context in the function before invoking. | 625 // current context to the context in the function before invoking. |
| 639 void InvokeFunction(Register function, | 626 void InvokeFunction(Register function, |
| 640 const ParameterCount& actual, | 627 const ParameterCount& actual, |
| 641 InvokeFlag flag, | 628 InvokeFlag flag, |
| 642 const CallWrapper& call_wrapper = NullCallWrapper(), | 629 const CallWrapper& call_wrapper, |
| 643 CallKind call_kind = CALL_AS_METHOD); | 630 CallKind call_kind); |
| 644 | 631 |
| 645 void InvokeFunction(JSFunction* function, | 632 void InvokeFunction(JSFunction* function, |
| 646 const ParameterCount& actual, | 633 const ParameterCount& actual, |
| 647 InvokeFlag flag); | 634 InvokeFlag flag, |
| 635 CallKind call_kind); |
| 648 | 636 |
| 649 | 637 |
| 650 void IsObjectJSObjectType(Register heap_object, | 638 void IsObjectJSObjectType(Register heap_object, |
| 651 Register map, | 639 Register map, |
| 652 Register scratch, | 640 Register scratch, |
| 653 Label* fail); | 641 Label* fail); |
| 654 | 642 |
| 655 void IsInstanceJSObjectType(Register map, | 643 void IsInstanceJSObjectType(Register map, |
| 656 Register scratch, | 644 Register scratch, |
| 657 Label* fail); | 645 Label* fail); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // clobbered. | 696 // clobbered. |
| 709 void TryGetFunctionPrototype(Register function, | 697 void TryGetFunctionPrototype(Register function, |
| 710 Register result, | 698 Register result, |
| 711 Register scratch, | 699 Register scratch, |
| 712 Label* miss); | 700 Label* miss); |
| 713 | 701 |
| 714 void GetObjectType(Register function, | 702 void GetObjectType(Register function, |
| 715 Register map, | 703 Register map, |
| 716 Register type_reg); | 704 Register type_reg); |
| 717 | 705 |
| 706 // Check if a map for a JSObject indicates that the object has fast elements. |
| 707 // Jump to the specified label if it does not. |
| 708 void CheckFastElements(Register map, |
| 709 Register scratch, |
| 710 Label* fail); |
| 711 |
| 718 // Check if the map of an object is equal to a specified map (either | 712 // Check if the map of an object is equal to a specified map (either |
| 719 // given directly or as an index into the root list) and branch to | 713 // given directly or as an index into the root list) and branch to |
| 720 // label if not. Skip the smi check if not required (object is known | 714 // label if not. Skip the smi check if not required (object is known |
| 721 // to be a heap object). | 715 // to be a heap object). |
| 722 void CheckMap(Register obj, | 716 void CheckMap(Register obj, |
| 723 Register scratch, | 717 Register scratch, |
| 724 Handle<Map> map, | 718 Handle<Map> map, |
| 725 Label* fail, | 719 Label* fail, |
| 726 SmiCheckType smi_check_type); | 720 SmiCheckType smi_check_type); |
| 727 | 721 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 Label* failure); | 1075 Label* failure); |
| 1082 | 1076 |
| 1083 void LoadInstanceDescriptors(Register map, Register descriptors); | 1077 void LoadInstanceDescriptors(Register map, Register descriptors); |
| 1084 | 1078 |
| 1085 private: | 1079 private: |
| 1086 void CallCFunctionHelper(Register function, | 1080 void CallCFunctionHelper(Register function, |
| 1087 ExternalReference function_reference, | 1081 ExternalReference function_reference, |
| 1088 Register scratch, | 1082 Register scratch, |
| 1089 int num_arguments); | 1083 int num_arguments); |
| 1090 | 1084 |
| 1091 void Jump(intptr_t target, RelocInfo::Mode rmode, | 1085 void BranchShort(int16_t offset, BranchDelaySlot bdslot = PROTECT); |
| 1092 BranchDelaySlot bd = PROTECT); | 1086 void BranchShort(int16_t offset, Condition cond, Register rs, |
| 1093 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = cc_always, | 1087 const Operand& rt, |
| 1094 Register r1 = zero_reg, const Operand& r2 = Operand(zero_reg), | 1088 BranchDelaySlot bdslot = PROTECT); |
| 1095 BranchDelaySlot bd = PROTECT); | 1089 void BranchShort(Label* L, BranchDelaySlot bdslot = PROTECT); |
| 1096 void Call(intptr_t target, RelocInfo::Mode rmode, | 1090 void BranchShort(Label* L, Condition cond, Register rs, |
| 1097 BranchDelaySlot bd = PROTECT); | 1091 const Operand& rt, |
| 1098 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = cc_always, | 1092 BranchDelaySlot bdslot = PROTECT); |
| 1099 Register r1 = zero_reg, const Operand& r2 = Operand(zero_reg), | 1093 void BranchAndLinkShort(int16_t offset, BranchDelaySlot bdslot = PROTECT); |
| 1100 BranchDelaySlot bd = PROTECT); | 1094 void BranchAndLinkShort(int16_t offset, Condition cond, Register rs, |
| 1095 const Operand& rt, |
| 1096 BranchDelaySlot bdslot = PROTECT); |
| 1097 void BranchAndLinkShort(Label* L, BranchDelaySlot bdslot = PROTECT); |
| 1098 void BranchAndLinkShort(Label* L, Condition cond, Register rs, |
| 1099 const Operand& rt, |
| 1100 BranchDelaySlot bdslot = PROTECT); |
| 1101 void J(Label* L, BranchDelaySlot bdslot); |
| 1102 void Jr(Label* L, BranchDelaySlot bdslot); |
| 1103 void Jalr(Label* L, BranchDelaySlot bdslot); |
| 1101 | 1104 |
| 1102 // Helper functions for generating invokes. | 1105 // Helper functions for generating invokes. |
| 1103 void InvokePrologue(const ParameterCount& expected, | 1106 void InvokePrologue(const ParameterCount& expected, |
| 1104 const ParameterCount& actual, | 1107 const ParameterCount& actual, |
| 1105 Handle<Code> code_constant, | 1108 Handle<Code> code_constant, |
| 1106 Register code_reg, | 1109 Register code_reg, |
| 1107 Label* done, | 1110 Label* done, |
| 1108 InvokeFlag flag, | 1111 InvokeFlag flag, |
| 1109 const CallWrapper& call_wrapper = NullCallWrapper(), | 1112 const CallWrapper& call_wrapper, |
| 1110 CallKind call_kind = CALL_AS_METHOD); | 1113 CallKind call_kind); |
| 1111 | 1114 |
| 1112 // Get the code for the given builtin. Returns if able to resolve | 1115 // Get the code for the given builtin. Returns if able to resolve |
| 1113 // the function in the 'resolved' flag. | 1116 // the function in the 'resolved' flag. |
| 1114 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | 1117 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); |
| 1115 | 1118 |
| 1116 // Activation support. | 1119 // Activation support. |
| 1117 void EnterFrame(StackFrame::Type type); | 1120 void EnterFrame(StackFrame::Type type); |
| 1118 void LeaveFrame(StackFrame::Type type); | 1121 void LeaveFrame(StackFrame::Type type); |
| 1119 | 1122 |
| 1120 void InitializeNewString(Register string, | 1123 void InitializeNewString(Register string, |
| 1121 Register length, | 1124 Register length, |
| 1122 Heap::RootListIndex map_index, | 1125 Heap::RootListIndex map_index, |
| 1123 Register scratch1, | 1126 Register scratch1, |
| 1124 Register scratch2); | 1127 Register scratch2); |
| 1125 | 1128 |
| 1126 // Compute memory operands for safepoint stack slots. | 1129 // Compute memory operands for safepoint stack slots. |
| 1127 static int SafepointRegisterStackIndex(int reg_code); | 1130 static int SafepointRegisterStackIndex(int reg_code); |
| 1128 MemOperand SafepointRegisterSlot(Register reg); | 1131 MemOperand SafepointRegisterSlot(Register reg); |
| 1129 MemOperand SafepointRegistersAndDoublesSlot(Register reg); | 1132 MemOperand SafepointRegistersAndDoublesSlot(Register reg); |
| 1130 | 1133 |
| 1134 bool UseAbsoluteCodePointers(); |
| 1135 |
| 1131 bool generating_stub_; | 1136 bool generating_stub_; |
| 1132 bool allow_stub_calls_; | 1137 bool allow_stub_calls_; |
| 1133 // This handle will be patched with the code object on installation. | 1138 // This handle will be patched with the code object on installation. |
| 1134 Handle<Object> code_object_; | 1139 Handle<Object> code_object_; |
| 1135 | 1140 |
| 1136 // Needs access to SafepointRegisterStackIndex for optimized frame | 1141 // Needs access to SafepointRegisterStackIndex for optimized frame |
| 1137 // traversal. | 1142 // traversal. |
| 1138 friend class OptimizedFrame; | 1143 friend class OptimizedFrame; |
| 1139 }; | 1144 }; |
| 1140 | 1145 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1210 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 1206 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1211 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1207 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1212 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1208 #else | 1213 #else |
| 1209 #define ACCESS_MASM(masm) masm-> | 1214 #define ACCESS_MASM(masm) masm-> |
| 1210 #endif | 1215 #endif |
| 1211 | 1216 |
| 1212 } } // namespace v8::internal | 1217 } } // namespace v8::internal |
| 1213 | 1218 |
| 1214 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1219 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| OLD | NEW |