OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 IN_C_ENTRY | 49 IN_C_ENTRY |
50 }; | 50 }; |
51 | 51 |
52 enum HandlerType { | 52 enum HandlerType { |
53 TRY_CATCH_HANDLER, | 53 TRY_CATCH_HANDLER, |
54 TRY_FINALLY_HANDLER, | 54 TRY_FINALLY_HANDLER, |
55 JS_ENTRY_HANDLER | 55 JS_ENTRY_HANDLER |
56 }; | 56 }; |
57 | 57 |
58 | 58 |
| 59 // Flags used for the AllocateObjectInNewSpace functions. |
| 60 enum AllocationFlags { |
| 61 // No special flags. |
| 62 NO_ALLOCATION_FLAGS = 0, |
| 63 // Return the pointer to the allocated already tagged as a heap object. |
| 64 TAG_OBJECT = 1 << 0, |
| 65 // The content of the result register already contains the allocation top in |
| 66 // new space. |
| 67 RESULT_CONTAINS_TOP = 1 << 1 |
| 68 }; |
| 69 |
| 70 |
59 // MacroAssembler implements a collection of frequently used macros. | 71 // MacroAssembler implements a collection of frequently used macros. |
60 class MacroAssembler: public Assembler { | 72 class MacroAssembler: public Assembler { |
61 public: | 73 public: |
62 MacroAssembler(void* buffer, int size); | 74 MacroAssembler(void* buffer, int size); |
63 | 75 |
64 // --------------------------------------------------------------------------- | 76 // --------------------------------------------------------------------------- |
65 // GC Support | 77 // GC Support |
66 | 78 |
67 // Set the remembered set bit for [object+offset]. | 79 // Set the remembered set bit for [object+offset]. |
68 // object is the object being stored into, value is the object being stored. | 80 // object is the object being stored into, value is the object being stored. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // and result_end have not yet been tagged as heap objects. If | 206 // and result_end have not yet been tagged as heap objects. If |
195 // result_contains_top_on_entry is true the contnt of result is known to be | 207 // result_contains_top_on_entry is true the contnt of result is known to be |
196 // the allocation top on entry (could be result_end from a previous call to | 208 // the allocation top on entry (could be result_end from a previous call to |
197 // AllocateObjectInNewSpace). If result_contains_top_on_entry is true scratch | 209 // AllocateObjectInNewSpace). If result_contains_top_on_entry is true scratch |
198 // should be no_reg as it is never used. | 210 // should be no_reg as it is never used. |
199 void AllocateObjectInNewSpace(int object_size, | 211 void AllocateObjectInNewSpace(int object_size, |
200 Register result, | 212 Register result, |
201 Register result_end, | 213 Register result_end, |
202 Register scratch, | 214 Register scratch, |
203 Label* gc_required, | 215 Label* gc_required, |
204 bool result_contains_top_on_entry); | 216 AllocationFlags flags); |
205 | 217 |
206 void AllocateObjectInNewSpace(int header_size, | 218 void AllocateObjectInNewSpace(int header_size, |
207 ScaleFactor element_size, | 219 ScaleFactor element_size, |
208 Register element_count, | 220 Register element_count, |
209 Register result, | 221 Register result, |
210 Register result_end, | 222 Register result_end, |
211 Register scratch, | 223 Register scratch, |
212 Label* gc_required, | 224 Label* gc_required, |
213 bool result_contains_top_on_entry); | 225 AllocationFlags flags); |
214 | 226 |
215 void AllocateObjectInNewSpace(Register object_size, | 227 void AllocateObjectInNewSpace(Register object_size, |
216 Register result, | 228 Register result, |
217 Register result_end, | 229 Register result_end, |
218 Register scratch, | 230 Register scratch, |
219 Label* gc_required, | 231 Label* gc_required, |
220 bool result_contains_top_on_entry); | 232 AllocationFlags flags); |
221 | 233 |
222 // Undo allocation in new space. The object passed and objects allocated after | 234 // Undo allocation in new space. The object passed and objects allocated after |
223 // it will no longer be allocated. Make sure that no pointers are left to the | 235 // it will no longer be allocated. Make sure that no pointers are left to the |
224 // object(s) no longer allocated as they would be invalid when allocation is | 236 // object(s) no longer allocated as they would be invalid when allocation is |
225 // un-done. | 237 // un-done. |
226 void UndoAllocationInNewSpace(Register object); | 238 void UndoAllocationInNewSpace(Register object); |
227 | 239 |
228 // --------------------------------------------------------------------------- | 240 // --------------------------------------------------------------------------- |
229 // Support functions. | 241 // Support functions. |
230 | 242 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | 355 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); |
344 | 356 |
345 // Activation support. | 357 // Activation support. |
346 void EnterFrame(StackFrame::Type type); | 358 void EnterFrame(StackFrame::Type type); |
347 void LeaveFrame(StackFrame::Type type); | 359 void LeaveFrame(StackFrame::Type type); |
348 | 360 |
349 // Allocation support helpers. | 361 // Allocation support helpers. |
350 void LoadAllocationTopHelper(Register result, | 362 void LoadAllocationTopHelper(Register result, |
351 Register result_end, | 363 Register result_end, |
352 Register scratch, | 364 Register scratch, |
353 bool result_contains_top_on_entry); | 365 AllocationFlags flags); |
354 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 366 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
355 }; | 367 }; |
356 | 368 |
357 | 369 |
358 // The code patcher is used to patch (typically) small parts of code e.g. for | 370 // The code patcher is used to patch (typically) small parts of code e.g. for |
359 // debugging and other types of instrumentation. When using the code patcher | 371 // debugging and other types of instrumentation. When using the code patcher |
360 // the exact number of bytes specified must be emitted. Is not legal to emit | 372 // the exact number of bytes specified must be emitted. Is not legal to emit |
361 // relocation information. If any of these constraints are violated it causes | 373 // relocation information. If any of these constraints are violated it causes |
362 // an assertion. | 374 // an assertion. |
363 class CodePatcher { | 375 class CodePatcher { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } \ | 423 } \ |
412 masm-> | 424 masm-> |
413 #else | 425 #else |
414 #define ACCESS_MASM(masm) masm-> | 426 #define ACCESS_MASM(masm) masm-> |
415 #endif | 427 #endif |
416 | 428 |
417 | 429 |
418 } } // namespace v8::internal | 430 } } // namespace v8::internal |
419 | 431 |
420 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 432 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |