OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // on access to global objects across environments. The holder register | 183 // on access to global objects across environments. The holder register |
184 // is left untouched, whereas both scratch registers are clobbered. | 184 // is left untouched, whereas both scratch registers are clobbered. |
185 void CheckAccessGlobalProxy(Register holder_reg, | 185 void CheckAccessGlobalProxy(Register holder_reg, |
186 Register scratch, | 186 Register scratch, |
187 Label* miss); | 187 Label* miss); |
188 | 188 |
189 | 189 |
190 // --------------------------------------------------------------------------- | 190 // --------------------------------------------------------------------------- |
191 // Allocation support | 191 // Allocation support |
192 | 192 |
193 // Allocate an object in new space. If the new space is exhausted control | 193 // Allocate an object in new space. The object_size is specified in words (not |
194 // continues at the gc_required label. The allocated object is returned in | 194 // bytes). If the new space is exhausted control continues at the gc_required |
195 // result. If the flag tag_allocated_object is true the result is tagged as | 195 // label. The allocated object is returned in result. If the flag |
196 // as a heap object. | 196 // tag_allocated_object is true the result is tagged as as a heap object. |
197 void AllocateObjectInNewSpace(int object_size, | 197 void AllocateObjectInNewSpace(int object_size, |
198 Register result, | 198 Register result, |
199 Register scratch1, | 199 Register scratch1, |
200 Register scratch2, | 200 Register scratch2, |
201 Label* gc_required, | 201 Label* gc_required, |
202 bool tag_allocated_object); | 202 bool tag_allocated_object); |
| 203 void AllocateObjectInNewSpace(Register object_size, |
| 204 Register result, |
| 205 Register scratch1, |
| 206 Register scratch2, |
| 207 Label* gc_required, |
| 208 bool tag_allocated_object); |
| 209 |
| 210 // Undo allocation in new space. The object passed and objects allocated after |
| 211 // it will no longer be allocated. The caller must make sure that no pointers |
| 212 // are left to the object(s) no longer allocated as they would be invalid when |
| 213 // allocation is undone. |
| 214 void UndoAllocationInNewSpace(Register object, Register scratch); |
203 | 215 |
204 // --------------------------------------------------------------------------- | 216 // --------------------------------------------------------------------------- |
205 // Support functions. | 217 // Support functions. |
206 | 218 |
207 // Try to get function prototype of a function and puts the value in | 219 // Try to get function prototype of a function and puts the value in |
208 // the result register. Checks that the function really is a | 220 // the result register. Checks that the function really is a |
209 // function and jumps to the miss label if the fast checks fail. The | 221 // function and jumps to the miss label if the fast checks fail. The |
210 // function register will be untouched; the other registers may be | 222 // function register will be untouched; the other registers may be |
211 // clobbered. | 223 // clobbered. |
212 void TryGetFunctionPrototype(Register function, | 224 void TryGetFunctionPrototype(Register function, |
213 Register result, | 225 Register result, |
214 Register scratch, | 226 Register scratch, |
215 Label* miss); | 227 Label* miss); |
216 | 228 |
217 // Compare object type for heap object. heap_object contains a non-Smi | 229 // Compare object type for heap object. heap_object contains a non-Smi |
218 // whose object type should be compared with the given type. This both | 230 // whose object type should be compared with the given type. This both |
219 // sets the flags and leaves the object type in the type_reg register. | 231 // sets the flags and leaves the object type in the type_reg register. |
220 // It leaves the map in the map register (unless the type_reg and map register | 232 // It leaves the map in the map register (unless the type_reg and map register |
221 // are the same register). It leaves the heap object in the heap_object | 233 // are the same register). It leaves the heap object in the heap_object |
222 // register unless the heap_object register is the same register as one of the | 234 // register unless the heap_object register is the same register as one of the |
223 // other // registers. | 235 // other registers. |
224 void CompareObjectType(Register heap_object, | 236 void CompareObjectType(Register heap_object, |
225 Register map, | 237 Register map, |
226 Register type_reg, | 238 Register type_reg, |
227 InstanceType type); | 239 InstanceType type); |
228 | 240 |
| 241 // Compare instance type in a map. map contains a valid map object whose |
| 242 // object type should be compared with the given type. This both |
| 243 // sets the flags and leaves the object type in the type_reg register. It |
| 244 // leaves the heap object in the heap_object register unless the heap_object |
| 245 // register is the same register as type_reg. |
| 246 void CompareInstanceType(Register map, |
| 247 Register type_reg, |
| 248 InstanceType type); |
| 249 |
229 inline void BranchOnSmi(Register value, Label* smi_label) { | 250 inline void BranchOnSmi(Register value, Label* smi_label) { |
230 tst(value, Operand(kSmiTagMask)); | 251 tst(value, Operand(kSmiTagMask)); |
231 b(eq, smi_label); | 252 b(eq, smi_label); |
232 } | 253 } |
233 | 254 |
234 inline void BranchOnNotSmi(Register value, Label* not_smi_label) { | 255 inline void BranchOnNotSmi(Register value, Label* not_smi_label) { |
235 tst(value, Operand(kSmiTagMask)); | 256 tst(value, Operand(kSmiTagMask)); |
236 b(ne, not_smi_label); | 257 b(ne, not_smi_label); |
237 } | 258 } |
238 | 259 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 375 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
355 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 376 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
356 #else | 377 #else |
357 #define ACCESS_MASM(masm) masm-> | 378 #define ACCESS_MASM(masm) masm-> |
358 #endif | 379 #endif |
359 | 380 |
360 | 381 |
361 } } // namespace v8::internal | 382 } } // namespace v8::internal |
362 | 383 |
363 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 384 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |