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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 28 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
29 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 29 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
30 | 30 |
31 #include "assembler.h" | 31 #include "assembler.h" |
| 32 #include "frames.h" |
32 #include "v8globals.h" | 33 #include "v8globals.h" |
33 | 34 |
34 namespace v8 { | 35 namespace v8 { |
35 namespace internal { | 36 namespace internal { |
36 | 37 |
37 // ---------------------------------------------------------------------------- | 38 // ---------------------------------------------------------------------------- |
38 // Static helper functions | 39 // Static helper functions |
39 | 40 |
40 // Generate a MemOperand for loading a field from an object. | 41 // Generate a MemOperand for loading a field from an object. |
41 static inline MemOperand FieldMemOperand(Register object, int offset) { | 42 static inline MemOperand FieldMemOperand(Register object, int offset) { |
(...skipping 30 matching lines...) Expand all Loading... |
72 enum ObjectToDoubleFlags { | 73 enum ObjectToDoubleFlags { |
73 // No special flags. | 74 // No special flags. |
74 NO_OBJECT_TO_DOUBLE_FLAGS = 0, | 75 NO_OBJECT_TO_DOUBLE_FLAGS = 0, |
75 // Object is known to be a non smi. | 76 // Object is known to be a non smi. |
76 OBJECT_NOT_SMI = 1 << 0, | 77 OBJECT_NOT_SMI = 1 << 0, |
77 // Don't load NaNs or infinities, branch to the non number case instead. | 78 // Don't load NaNs or infinities, branch to the non number case instead. |
78 AVOID_NANS_AND_INFINITIES = 1 << 1 | 79 AVOID_NANS_AND_INFINITIES = 1 << 1 |
79 }; | 80 }; |
80 | 81 |
81 | 82 |
| 83 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
| 84 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
| 85 enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved }; |
| 86 |
| 87 |
| 88 bool AreAliased(Register r1, Register r2, Register r3, Register r4); |
| 89 |
| 90 |
82 // MacroAssembler implements a collection of frequently used macros. | 91 // MacroAssembler implements a collection of frequently used macros. |
83 class MacroAssembler: public Assembler { | 92 class MacroAssembler: public Assembler { |
84 public: | 93 public: |
85 // The isolate parameter can be NULL if the macro assembler should | 94 // The isolate parameter can be NULL if the macro assembler should |
86 // not use isolate-dependent functionality. In this case, it's the | 95 // not use isolate-dependent functionality. In this case, it's the |
87 // responsibility of the caller to never invoke such function on the | 96 // responsibility of the caller to never invoke such function on the |
88 // macro assembler. | 97 // macro assembler. |
89 MacroAssembler(Isolate* isolate, void* buffer, int size); | 98 MacroAssembler(Isolate* isolate, void* buffer, int size); |
90 | 99 |
91 // Jump, Call, and Ret pseudo instructions implementing inter-working. | 100 // Jump, Call, and Ret pseudo instructions implementing inter-working. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 159 |
151 // Load an object from the root table. | 160 // Load an object from the root table. |
152 void LoadRoot(Register destination, | 161 void LoadRoot(Register destination, |
153 Heap::RootListIndex index, | 162 Heap::RootListIndex index, |
154 Condition cond = al); | 163 Condition cond = al); |
155 // Store an object to the root table. | 164 // Store an object to the root table. |
156 void StoreRoot(Register source, | 165 void StoreRoot(Register source, |
157 Heap::RootListIndex index, | 166 Heap::RootListIndex index, |
158 Condition cond = al); | 167 Condition cond = al); |
159 | 168 |
| 169 // --------------------------------------------------------------------------- |
| 170 // GC Support |
160 | 171 |
161 // Check if object is in new space. | 172 void IncrementalMarkingRecordWriteHelper(Register object, |
162 // scratch can be object itself, but it will be clobbered. | 173 Register value, |
163 void InNewSpace(Register object, | 174 Register address); |
164 Register scratch, | |
165 Condition cond, // eq for new space, ne otherwise | |
166 Label* branch); | |
167 | 175 |
| 176 enum RememberedSetFinalAction { |
| 177 kReturnAtEnd, |
| 178 kFallThroughAtEnd |
| 179 }; |
168 | 180 |
169 // For the page containing |object| mark the region covering [address] | 181 // Record in the remembered set the fact that we have a pointer to new space |
170 // dirty. The object address must be in the first 8K of an allocated page. | 182 // at the address pointed to by the addr register. Only works if addr is not |
171 void RecordWriteHelper(Register object, | 183 // in new space. |
172 Register address, | 184 void RememberedSetHelper(Register object, // Used for debug code. |
173 Register scratch); | 185 Register addr, |
| 186 Register scratch, |
| 187 SaveFPRegsMode save_fp, |
| 188 RememberedSetFinalAction and_then); |
174 | 189 |
175 // For the page containing |object| mark the region covering | 190 void CheckPageFlag(Register object, |
176 // [object+offset] dirty. The object address must be in the first 8K | 191 Register scratch, |
177 // of an allocated page. The 'scratch' registers are used in the | 192 int mask, |
178 // implementation and all 3 registers are clobbered by the | 193 Condition cc, |
179 // operation, as well as the ip register. RecordWrite updates the | 194 Label* condition_met); |
180 // write barrier even when storing smis. | 195 |
181 void RecordWrite(Register object, | 196 // Check if object is in new space. Jumps if the object is not in new space. |
182 Operand offset, | 197 // The register scratch can be object itself, but scratch will be clobbered. |
| 198 void JumpIfNotInNewSpace(Register object, |
| 199 Register scratch, |
| 200 Label* branch) { |
| 201 InNewSpace(object, scratch, ne, branch); |
| 202 } |
| 203 |
| 204 // Check if object is in new space. Jumps if the object is in new space. |
| 205 // The register scratch can be object itself, but it will be clobbered. |
| 206 void JumpIfInNewSpace(Register object, |
| 207 Register scratch, |
| 208 Label* branch) { |
| 209 InNewSpace(object, scratch, eq, branch); |
| 210 } |
| 211 |
| 212 // Check if an object has a given incremental marking color. |
| 213 void HasColor(Register object, |
| 214 Register scratch0, |
| 215 Register scratch1, |
| 216 Label* has_color, |
| 217 int first_bit, |
| 218 int second_bit); |
| 219 |
| 220 void JumpIfBlack(Register object, |
183 Register scratch0, | 221 Register scratch0, |
184 Register scratch1); | 222 Register scratch1, |
| 223 Label* on_black); |
185 | 224 |
186 // For the page containing |object| mark the region covering | 225 // Checks the color of an object. If the object is already grey or black |
187 // [address] dirty. The object address must be in the first 8K of an | 226 // then we just fall through, since it is already live. If it is white and |
188 // allocated page. All 3 registers are clobbered by the operation, | 227 // we can determine that it doesn't need to be scanned, then we just mark it |
189 // as well as the ip register. RecordWrite updates the write barrier | 228 // black and fall through. For the rest we jump to the label so the |
190 // even when storing smis. | 229 // incremental marker can fix its assumptions. |
191 void RecordWrite(Register object, | 230 void EnsureNotWhite(Register object, |
192 Register address, | 231 Register scratch1, |
193 Register scratch); | 232 Register scratch2, |
| 233 Register scratch3, |
| 234 Label* object_is_white_and_not_data); |
| 235 |
| 236 // Detects conservatively whether an object is data-only, ie it does need to |
| 237 // be scanned by the garbage collector. |
| 238 void JumpIfDataObject(Register value, |
| 239 Register scratch, |
| 240 Label* not_data_object); |
| 241 |
| 242 // Notify the garbage collector that we wrote a pointer into an object. |
| 243 // |object| is the object being stored into, |value| is the object being |
| 244 // stored. value and scratch registers are clobbered by the operation. |
| 245 // The offset is the offset from the start of the object, not the offset from |
| 246 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). |
| 247 void RecordWriteField( |
| 248 Register object, |
| 249 int offset, |
| 250 Register value, |
| 251 Register scratch, |
| 252 LinkRegisterStatus lr_status, |
| 253 SaveFPRegsMode save_fp, |
| 254 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 255 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 256 |
| 257 // As above, but the offset has the tag presubtracted. For use with |
| 258 // MemOperand(reg, off). |
| 259 inline void RecordWriteContextSlot( |
| 260 Register context, |
| 261 int offset, |
| 262 Register value, |
| 263 Register scratch, |
| 264 LinkRegisterStatus lr_status, |
| 265 SaveFPRegsMode save_fp, |
| 266 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 267 SmiCheck smi_check = INLINE_SMI_CHECK) { |
| 268 RecordWriteField(context, |
| 269 offset + kHeapObjectTag, |
| 270 value, |
| 271 scratch, |
| 272 lr_status, |
| 273 save_fp, |
| 274 remembered_set_action, |
| 275 smi_check); |
| 276 } |
| 277 |
| 278 // For a given |object| notify the garbage collector that the slot |address| |
| 279 // has been written. |value| is the object being stored. The value and |
| 280 // address registers are clobbered by the operation. |
| 281 void RecordWrite( |
| 282 Register object, |
| 283 Register address, |
| 284 Register value, |
| 285 LinkRegisterStatus lr_status, |
| 286 SaveFPRegsMode save_fp, |
| 287 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 288 SmiCheck smi_check = INLINE_SMI_CHECK); |
194 | 289 |
195 // Push a handle. | 290 // Push a handle. |
196 void Push(Handle<Object> handle); | 291 void Push(Handle<Object> handle); |
197 | 292 |
198 // Push two registers. Pushes leftmost register first (to highest address). | 293 // Push two registers. Pushes leftmost register first (to highest address). |
199 void Push(Register src1, Register src2, Condition cond = al) { | 294 void Push(Register src1, Register src2, Condition cond = al) { |
200 ASSERT(!src1.is(src2)); | 295 ASSERT(!src1.is(src2)); |
201 if (src1.code() > src2.code()) { | 296 if (src1.code() > src2.code()) { |
202 stm(db_w, sp, src1.bit() | src2.bit(), cond); | 297 stm(db_w, sp, src1.bit() | src2.bit(), cond); |
203 } else { | 298 } else { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const Condition cond = al); | 406 const Condition cond = al); |
312 void VFPCompareAndLoadFlags(const DwVfpRegister src1, | 407 void VFPCompareAndLoadFlags(const DwVfpRegister src1, |
313 const double src2, | 408 const double src2, |
314 const Register fpscr_flags, | 409 const Register fpscr_flags, |
315 const Condition cond = al); | 410 const Condition cond = al); |
316 | 411 |
317 void Vmov(const DwVfpRegister dst, | 412 void Vmov(const DwVfpRegister dst, |
318 const double imm, | 413 const double imm, |
319 const Condition cond = al); | 414 const Condition cond = al); |
320 | 415 |
321 | |
322 // --------------------------------------------------------------------------- | |
323 // Activation frames | |
324 | |
325 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } | |
326 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } | |
327 | |
328 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } | |
329 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } | |
330 | |
331 // Enter exit frame. | 416 // Enter exit frame. |
332 // stack_space - extra stack space, used for alignment before call to C. | 417 // stack_space - extra stack space, used for alignment before call to C. |
333 void EnterExitFrame(bool save_doubles, int stack_space = 0); | 418 void EnterExitFrame(bool save_doubles, int stack_space = 0); |
334 | 419 |
335 // Leave the current exit frame. Expects the return value in r0. | 420 // Leave the current exit frame. Expects the return value in r0. |
336 // Expect the number of values, pushed prior to the exit frame, to | 421 // Expect the number of values, pushed prior to the exit frame, to |
337 // remove in a register (or no_reg, if there is nothing to remove). | 422 // remove in a register (or no_reg, if there is nothing to remove). |
338 void LeaveExitFrame(bool save_doubles, Register argument_count); | 423 void LeaveExitFrame(bool save_doubles, Register argument_count); |
339 | 424 |
340 // Get the actual activation frame alignment for target environment. | 425 // Get the actual activation frame alignment for target environment. |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 void CopyFields(Register dst, Register src, RegList temps, int field_count); | 647 void CopyFields(Register dst, Register src, RegList temps, int field_count); |
563 | 648 |
564 // Copies a number of bytes from src to dst. All registers are clobbered. On | 649 // Copies a number of bytes from src to dst. All registers are clobbered. On |
565 // exit src and dst will point to the place just after where the last byte was | 650 // exit src and dst will point to the place just after where the last byte was |
566 // read or written and length will be zero. | 651 // read or written and length will be zero. |
567 void CopyBytes(Register src, | 652 void CopyBytes(Register src, |
568 Register dst, | 653 Register dst, |
569 Register length, | 654 Register length, |
570 Register scratch); | 655 Register scratch); |
571 | 656 |
| 657 // Initialize fields with filler values. Fields starting at |start_offset| |
| 658 // not including end_offset are overwritten with the value in |filler|. At |
| 659 // the end the loop, |start_offset| takes the value of |end_offset|. |
| 660 void InitializeFieldsWithFiller(Register start_offset, |
| 661 Register end_offset, |
| 662 Register filler); |
| 663 |
572 // --------------------------------------------------------------------------- | 664 // --------------------------------------------------------------------------- |
573 // Support functions. | 665 // Support functions. |
574 | 666 |
575 // Try to get function prototype of a function and puts the value in | 667 // Try to get function prototype of a function and puts the value in |
576 // the result register. Checks that the function really is a | 668 // the result register. Checks that the function really is a |
577 // function and jumps to the miss label if the fast checks fail. The | 669 // function and jumps to the miss label if the fast checks fail. The |
578 // function register will be untouched; the other registers may be | 670 // function register will be untouched; the other registers may be |
579 // clobbered. | 671 // clobbered. |
580 void TryGetFunctionPrototype(Register function, | 672 void TryGetFunctionPrototype(Register function, |
581 Register result, | 673 Register result, |
(...skipping 19 matching lines...) Expand all Loading... |
601 Register type_reg, | 693 Register type_reg, |
602 InstanceType type); | 694 InstanceType type); |
603 | 695 |
604 | 696 |
605 // Check if a map for a JSObject indicates that the object has fast elements. | 697 // Check if a map for a JSObject indicates that the object has fast elements. |
606 // Jump to the specified label if it does not. | 698 // Jump to the specified label if it does not. |
607 void CheckFastElements(Register map, | 699 void CheckFastElements(Register map, |
608 Register scratch, | 700 Register scratch, |
609 Label* fail); | 701 Label* fail); |
610 | 702 |
| 703 // Check if a map for a JSObject indicates that the object can have both smi |
| 704 // and HeapObject elements. Jump to the specified label if it does not. |
| 705 void CheckFastObjectElements(Register map, |
| 706 Register scratch, |
| 707 Label* fail); |
| 708 |
| 709 // Check if a map for a JSObject indicates that the object has fast smi only |
| 710 // elements. Jump to the specified label if it does not. |
| 711 void CheckFastSmiOnlyElements(Register map, |
| 712 Register scratch, |
| 713 Label* fail); |
| 714 |
611 // Check if the map of an object is equal to a specified map (either | 715 // Check if the map of an object is equal to a specified map (either |
612 // given directly or as an index into the root list) and branch to | 716 // given directly or as an index into the root list) and branch to |
613 // label if not. Skip the smi check if not required (object is known | 717 // label if not. Skip the smi check if not required (object is known |
614 // to be a heap object) | 718 // to be a heap object) |
615 void CheckMap(Register obj, | 719 void CheckMap(Register obj, |
616 Register scratch, | 720 Register scratch, |
617 Handle<Map> map, | 721 Handle<Map> map, |
618 Label* fail, | 722 Label* fail, |
619 SmiCheckType smi_check_type); | 723 SmiCheckType smi_check_type); |
620 | 724 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 void SetCallCDoubleArguments(DoubleRegister dreg); | 927 void SetCallCDoubleArguments(DoubleRegister dreg); |
824 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); | 928 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); |
825 void SetCallCDoubleArguments(DoubleRegister dreg, Register reg); | 929 void SetCallCDoubleArguments(DoubleRegister dreg, Register reg); |
826 | 930 |
827 // Calls a C function and cleans up the space for arguments allocated | 931 // Calls a C function and cleans up the space for arguments allocated |
828 // by PrepareCallCFunction. The called function is not allowed to trigger a | 932 // by PrepareCallCFunction. The called function is not allowed to trigger a |
829 // garbage collection, since that might move the code and invalidate the | 933 // garbage collection, since that might move the code and invalidate the |
830 // return address (unless this is somehow accounted for by the called | 934 // return address (unless this is somehow accounted for by the called |
831 // function). | 935 // function). |
832 void CallCFunction(ExternalReference function, int num_arguments); | 936 void CallCFunction(ExternalReference function, int num_arguments); |
833 void CallCFunction(Register function, Register scratch, int num_arguments); | 937 void CallCFunction(Register function, int num_arguments); |
834 void CallCFunction(ExternalReference function, | 938 void CallCFunction(ExternalReference function, |
835 int num_reg_arguments, | 939 int num_reg_arguments, |
836 int num_double_arguments); | 940 int num_double_arguments); |
837 void CallCFunction(Register function, Register scratch, | 941 void CallCFunction(Register function, |
838 int num_reg_arguments, | 942 int num_reg_arguments, |
839 int num_double_arguments); | 943 int num_double_arguments); |
840 | 944 |
841 void GetCFunctionDoubleResult(const DoubleRegister dst); | 945 void GetCFunctionDoubleResult(const DoubleRegister dst); |
842 | 946 |
843 // Calls an API function. Allocates HandleScope, extracts returned value | 947 // Calls an API function. Allocates HandleScope, extracts returned value |
844 // from handle and propagates exceptions. Restores context. | 948 // from handle and propagates exceptions. Restores context. |
845 // stack_space - space to be unwound on exit (includes the call js | 949 // stack_space - space to be unwound on exit (includes the call js |
846 // arguments space and the additional space allocated for the fast call). | 950 // arguments space and the additional space allocated for the fast call). |
847 MaybeObject* TryCallApiFunctionAndReturn(ExternalReference function, | 951 MaybeObject* TryCallApiFunctionAndReturn(ExternalReference function, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 void Check(Condition cond, const char* msg); | 999 void Check(Condition cond, const char* msg); |
896 | 1000 |
897 // Print a message to stdout and abort execution. | 1001 // Print a message to stdout and abort execution. |
898 void Abort(const char* msg); | 1002 void Abort(const char* msg); |
899 | 1003 |
900 // Verify restrictions about code generated in stubs. | 1004 // Verify restrictions about code generated in stubs. |
901 void set_generating_stub(bool value) { generating_stub_ = value; } | 1005 void set_generating_stub(bool value) { generating_stub_ = value; } |
902 bool generating_stub() { return generating_stub_; } | 1006 bool generating_stub() { return generating_stub_; } |
903 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | 1007 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } |
904 bool allow_stub_calls() { return allow_stub_calls_; } | 1008 bool allow_stub_calls() { return allow_stub_calls_; } |
| 1009 void set_has_frame(bool value) { has_frame_ = value; } |
| 1010 bool has_frame() { return has_frame_; } |
| 1011 inline bool AllowThisStubCall(CodeStub* stub); |
905 | 1012 |
906 // EABI variant for double arguments in use. | 1013 // EABI variant for double arguments in use. |
907 bool use_eabi_hardfloat() { | 1014 bool use_eabi_hardfloat() { |
908 #if USE_EABI_HARDFLOAT | 1015 #if USE_EABI_HARDFLOAT |
909 return true; | 1016 return true; |
910 #else | 1017 #else |
911 return false; | 1018 return false; |
912 #endif | 1019 #endif |
913 } | 1020 } |
914 | 1021 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1148 |
1042 void ClampUint8(Register output_reg, Register input_reg); | 1149 void ClampUint8(Register output_reg, Register input_reg); |
1043 | 1150 |
1044 void ClampDoubleToUint8(Register result_reg, | 1151 void ClampDoubleToUint8(Register result_reg, |
1045 DoubleRegister input_reg, | 1152 DoubleRegister input_reg, |
1046 DoubleRegister temp_double_reg); | 1153 DoubleRegister temp_double_reg); |
1047 | 1154 |
1048 | 1155 |
1049 void LoadInstanceDescriptors(Register map, Register descriptors); | 1156 void LoadInstanceDescriptors(Register map, Register descriptors); |
1050 | 1157 |
| 1158 // Activation support. |
| 1159 void EnterFrame(StackFrame::Type type); |
| 1160 void LeaveFrame(StackFrame::Type type); |
| 1161 |
1051 private: | 1162 private: |
1052 void CallCFunctionHelper(Register function, | 1163 void CallCFunctionHelper(Register function, |
1053 ExternalReference function_reference, | |
1054 Register scratch, | |
1055 int num_reg_arguments, | 1164 int num_reg_arguments, |
1056 int num_double_arguments); | 1165 int num_double_arguments); |
1057 | 1166 |
1058 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 1167 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
1059 | 1168 |
1060 // Helper functions for generating invokes. | 1169 // Helper functions for generating invokes. |
1061 void InvokePrologue(const ParameterCount& expected, | 1170 void InvokePrologue(const ParameterCount& expected, |
1062 const ParameterCount& actual, | 1171 const ParameterCount& actual, |
1063 Handle<Code> code_constant, | 1172 Handle<Code> code_constant, |
1064 Register code_reg, | 1173 Register code_reg, |
1065 Label* done, | 1174 Label* done, |
1066 InvokeFlag flag, | 1175 InvokeFlag flag, |
1067 const CallWrapper& call_wrapper, | 1176 const CallWrapper& call_wrapper, |
1068 CallKind call_kind); | 1177 CallKind call_kind); |
1069 | 1178 |
1070 // Activation support. | |
1071 void EnterFrame(StackFrame::Type type); | |
1072 void LeaveFrame(StackFrame::Type type); | |
1073 | |
1074 void InitializeNewString(Register string, | 1179 void InitializeNewString(Register string, |
1075 Register length, | 1180 Register length, |
1076 Heap::RootListIndex map_index, | 1181 Heap::RootListIndex map_index, |
1077 Register scratch1, | 1182 Register scratch1, |
1078 Register scratch2); | 1183 Register scratch2); |
1079 | 1184 |
| 1185 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. |
| 1186 void InNewSpace(Register object, |
| 1187 Register scratch, |
| 1188 Condition cond, // eq for new space, ne otherwise. |
| 1189 Label* branch); |
| 1190 |
| 1191 // Helper for finding the mark bits for an address. Afterwards, the |
| 1192 // bitmap register points at the word with the mark bits and the mask |
| 1193 // the position of the first bit. Leaves addr_reg unchanged. |
| 1194 inline void GetMarkBits(Register addr_reg, |
| 1195 Register bitmap_reg, |
| 1196 Register mask_reg); |
| 1197 |
1080 // Compute memory operands for safepoint stack slots. | 1198 // Compute memory operands for safepoint stack slots. |
1081 static int SafepointRegisterStackIndex(int reg_code); | 1199 static int SafepointRegisterStackIndex(int reg_code); |
1082 MemOperand SafepointRegisterSlot(Register reg); | 1200 MemOperand SafepointRegisterSlot(Register reg); |
1083 MemOperand SafepointRegistersAndDoublesSlot(Register reg); | 1201 MemOperand SafepointRegistersAndDoublesSlot(Register reg); |
1084 | 1202 |
1085 bool generating_stub_; | 1203 bool generating_stub_; |
1086 bool allow_stub_calls_; | 1204 bool allow_stub_calls_; |
| 1205 bool has_frame_; |
1087 // This handle will be patched with the code object on installation. | 1206 // This handle will be patched with the code object on installation. |
1088 Handle<Object> code_object_; | 1207 Handle<Object> code_object_; |
1089 | 1208 |
1090 // Needs access to SafepointRegisterStackIndex for optimized frame | 1209 // Needs access to SafepointRegisterStackIndex for optimized frame |
1091 // traversal. | 1210 // traversal. |
1092 friend class OptimizedFrame; | 1211 friend class OptimizedFrame; |
1093 }; | 1212 }; |
1094 | 1213 |
1095 | 1214 |
1096 #ifdef ENABLE_DEBUGGER_SUPPORT | 1215 #ifdef ENABLE_DEBUGGER_SUPPORT |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1264 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1146 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1265 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1147 #else | 1266 #else |
1148 #define ACCESS_MASM(masm) masm-> | 1267 #define ACCESS_MASM(masm) masm-> |
1149 #endif | 1268 #endif |
1150 | 1269 |
1151 | 1270 |
1152 } } // namespace v8::internal | 1271 } } // namespace v8::internal |
1153 | 1272 |
1154 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1273 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |