OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 IN_C_ENTRY | 54 IN_C_ENTRY |
55 }; | 55 }; |
56 | 56 |
57 enum HandlerType { | 57 enum HandlerType { |
58 TRY_CATCH_HANDLER, | 58 TRY_CATCH_HANDLER, |
59 TRY_FINALLY_HANDLER, | 59 TRY_FINALLY_HANDLER, |
60 JS_ENTRY_HANDLER | 60 JS_ENTRY_HANDLER |
61 }; | 61 }; |
62 | 62 |
63 | 63 |
| 64 // Flags used for the AllocateObjectInNewSpace functions. |
| 65 enum AllocationFlags { |
| 66 // No special flags. |
| 67 NO_ALLOCATION_FLAGS = 0, |
| 68 // Return the pointer to the allocated already tagged as a heap object. |
| 69 TAG_OBJECT = 1 << 0, |
| 70 // The content of the result register already contains the allocation top in |
| 71 // new space. |
| 72 RESULT_CONTAINS_TOP = 1 << 1 |
| 73 }; |
| 74 |
| 75 |
64 // MacroAssembler implements a collection of frequently used macros. | 76 // MacroAssembler implements a collection of frequently used macros. |
65 class MacroAssembler: public Assembler { | 77 class MacroAssembler: public Assembler { |
66 public: | 78 public: |
67 MacroAssembler(void* buffer, int size); | 79 MacroAssembler(void* buffer, int size); |
68 | 80 |
69 void LoadRoot(Register destination, Heap::RootListIndex index); | 81 void LoadRoot(Register destination, Heap::RootListIndex index); |
70 void CompareRoot(Register with, Heap::RootListIndex index); | 82 void CompareRoot(Register with, Heap::RootListIndex index); |
71 void PushRoot(Heap::RootListIndex index); | 83 void PushRoot(Heap::RootListIndex index); |
72 | 84 |
73 // --------------------------------------------------------------------------- | 85 // --------------------------------------------------------------------------- |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // and result_end have not yet been tagged as heap objects. If | 249 // and result_end have not yet been tagged as heap objects. If |
238 // result_contains_top_on_entry is true the content of result is known to be | 250 // result_contains_top_on_entry is true the content of result is known to be |
239 // the allocation top on entry (could be result_end from a previous call to | 251 // the allocation top on entry (could be result_end from a previous call to |
240 // AllocateObjectInNewSpace). If result_contains_top_on_entry is true scratch | 252 // AllocateObjectInNewSpace). If result_contains_top_on_entry is true scratch |
241 // should be no_reg as it is never used. | 253 // should be no_reg as it is never used. |
242 void AllocateObjectInNewSpace(int object_size, | 254 void AllocateObjectInNewSpace(int object_size, |
243 Register result, | 255 Register result, |
244 Register result_end, | 256 Register result_end, |
245 Register scratch, | 257 Register scratch, |
246 Label* gc_required, | 258 Label* gc_required, |
247 bool result_contains_top_on_entry); | 259 AllocationFlags flags); |
248 | 260 |
249 void AllocateObjectInNewSpace(int header_size, | 261 void AllocateObjectInNewSpace(int header_size, |
250 ScaleFactor element_size, | 262 ScaleFactor element_size, |
251 Register element_count, | 263 Register element_count, |
252 Register result, | 264 Register result, |
253 Register result_end, | 265 Register result_end, |
254 Register scratch, | 266 Register scratch, |
255 Label* gc_required, | 267 Label* gc_required, |
256 bool result_contains_top_on_entry); | 268 AllocationFlags flags); |
257 | 269 |
258 void AllocateObjectInNewSpace(Register object_size, | 270 void AllocateObjectInNewSpace(Register object_size, |
259 Register result, | 271 Register result, |
260 Register result_end, | 272 Register result_end, |
261 Register scratch, | 273 Register scratch, |
262 Label* gc_required, | 274 Label* gc_required, |
263 bool result_contains_top_on_entry); | 275 AllocationFlags flags); |
264 | 276 |
265 // Undo allocation in new space. The object passed and objects allocated after | 277 // Undo allocation in new space. The object passed and objects allocated after |
266 // it will no longer be allocated. Make sure that no pointers are left to the | 278 // it will no longer be allocated. Make sure that no pointers are left to the |
267 // object(s) no longer allocated as they would be invalid when allocation is | 279 // object(s) no longer allocated as they would be invalid when allocation is |
268 // un-done. | 280 // un-done. |
269 void UndoAllocationInNewSpace(Register object); | 281 void UndoAllocationInNewSpace(Register object); |
270 | 282 |
271 // --------------------------------------------------------------------------- | 283 // --------------------------------------------------------------------------- |
272 // Support functions. | 284 // Support functions. |
273 | 285 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | 397 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); |
386 | 398 |
387 // Activation support. | 399 // Activation support. |
388 void EnterFrame(StackFrame::Type type); | 400 void EnterFrame(StackFrame::Type type); |
389 void LeaveFrame(StackFrame::Type type); | 401 void LeaveFrame(StackFrame::Type type); |
390 | 402 |
391 // Allocation support helpers. | 403 // Allocation support helpers. |
392 void LoadAllocationTopHelper(Register result, | 404 void LoadAllocationTopHelper(Register result, |
393 Register result_end, | 405 Register result_end, |
394 Register scratch, | 406 Register scratch, |
395 bool result_contains_top_on_entry); | 407 AllocationFlags flags); |
396 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 408 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
397 }; | 409 }; |
398 | 410 |
399 | 411 |
400 // The code patcher is used to patch (typically) small parts of code e.g. for | 412 // The code patcher is used to patch (typically) small parts of code e.g. for |
401 // debugging and other types of instrumentation. When using the code patcher | 413 // debugging and other types of instrumentation. When using the code patcher |
402 // the exact number of bytes specified must be emitted. Is not legal to emit | 414 // the exact number of bytes specified must be emitted. Is not legal to emit |
403 // relocation information. If any of these constraints are violated it causes | 415 // relocation information. If any of these constraints are violated it causes |
404 // an assertion. | 416 // an assertion. |
405 class CodePatcher { | 417 class CodePatcher { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } \ | 465 } \ |
454 masm-> | 466 masm-> |
455 #else | 467 #else |
456 #define ACCESS_MASM(masm) masm-> | 468 #define ACCESS_MASM(masm) masm-> |
457 #endif | 469 #endif |
458 | 470 |
459 | 471 |
460 } } // namespace v8::internal | 472 } } // namespace v8::internal |
461 | 473 |
462 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 474 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |