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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // Generate code for checking access rights - used for security checks | 216 // Generate code for checking access rights - used for security checks |
217 // on access to global objects across environments. The holder register | 217 // on access to global objects across environments. The holder register |
218 // is left untouched, but the scratch register and kScratchRegister, | 218 // is left untouched, but the scratch register and kScratchRegister, |
219 // which must be different, are clobbered. | 219 // which must be different, are clobbered. |
220 void CheckAccessGlobalProxy(Register holder_reg, | 220 void CheckAccessGlobalProxy(Register holder_reg, |
221 Register scratch, | 221 Register scratch, |
222 Label* miss); | 222 Label* miss); |
223 | 223 |
224 | 224 |
225 // --------------------------------------------------------------------------- | 225 // --------------------------------------------------------------------------- |
| 226 // Allocation support |
| 227 |
| 228 // Allocate an object in new space. If the new space is exhausted control |
| 229 // continues at the gc_required label. The allocated object is returned in |
| 230 // result and end of the new object is returned in result_end. The register |
| 231 // scratch can be passed as no_reg in which case an additional object |
| 232 // reference will be added to the reloc info. The returned pointers in result |
| 233 // and result_end have not yet been tagged as heap objects. If |
| 234 // result_contains_top_on_entry is true the content of result is known to be |
| 235 // the allocation top on entry (could be result_end from a previous call to |
| 236 // AllocateObjectInNewSpace). If result_contains_top_on_entry is true scratch |
| 237 // should be no_reg as it is never used. |
| 238 void AllocateObjectInNewSpace(int object_size, |
| 239 Register result, |
| 240 Register result_end, |
| 241 Register scratch, |
| 242 Label* gc_required, |
| 243 bool result_contains_top_on_entry); |
| 244 |
| 245 void AllocateObjectInNewSpace(int header_size, |
| 246 ScaleFactor element_size, |
| 247 Register element_count, |
| 248 Register result, |
| 249 Register result_end, |
| 250 Register scratch, |
| 251 Label* gc_required, |
| 252 bool result_contains_top_on_entry); |
| 253 |
| 254 void AllocateObjectInNewSpace(Register object_size, |
| 255 Register result, |
| 256 Register result_end, |
| 257 Register scratch, |
| 258 Label* gc_required, |
| 259 bool result_contains_top_on_entry); |
| 260 |
| 261 // Undo allocation in new space. The object passed and objects allocated after |
| 262 // it will no longer be allocated. Make sure that no pointers are left to the |
| 263 // object(s) no longer allocated as they would be invalid when allocation is |
| 264 // un-done. |
| 265 void UndoAllocationInNewSpace(Register object); |
| 266 |
| 267 // --------------------------------------------------------------------------- |
226 // Support functions. | 268 // Support functions. |
227 | 269 |
228 // Check if result is zero and op is negative. | 270 // Check if result is zero and op is negative. |
229 void NegativeZeroTest(Register result, Register op, Label* then_label); | 271 void NegativeZeroTest(Register result, Register op, Label* then_label); |
230 | 272 |
231 // Check if result is zero and op is negative in code using jump targets. | 273 // Check if result is zero and op is negative in code using jump targets. |
232 void NegativeZeroTest(CodeGenerator* cgen, | 274 void NegativeZeroTest(CodeGenerator* cgen, |
233 Register result, | 275 Register result, |
234 Register op, | 276 Register op, |
235 JumpTarget* then_target); | 277 JumpTarget* then_target); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 Label* done, | 376 Label* done, |
335 InvokeFlag flag); | 377 InvokeFlag flag); |
336 | 378 |
337 // Get the code for the given builtin. Returns if able to resolve | 379 // Get the code for the given builtin. Returns if able to resolve |
338 // the function in the 'resolved' flag. | 380 // the function in the 'resolved' flag. |
339 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | 381 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); |
340 | 382 |
341 // Activation support. | 383 // Activation support. |
342 void EnterFrame(StackFrame::Type type); | 384 void EnterFrame(StackFrame::Type type); |
343 void LeaveFrame(StackFrame::Type type); | 385 void LeaveFrame(StackFrame::Type type); |
| 386 |
| 387 // Allocation support helpers. |
| 388 void LoadAllocationTopHelper(Register result, |
| 389 Register result_end, |
| 390 Register scratch, |
| 391 bool result_contains_top_on_entry); |
| 392 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
344 }; | 393 }; |
345 | 394 |
346 | 395 |
347 // The code patcher is used to patch (typically) small parts of code e.g. for | 396 // The code patcher is used to patch (typically) small parts of code e.g. for |
348 // debugging and other types of instrumentation. When using the code patcher | 397 // debugging and other types of instrumentation. When using the code patcher |
349 // the exact number of bytes specified must be emitted. Is not legal to emit | 398 // the exact number of bytes specified must be emitted. Is not legal to emit |
350 // relocation information. If any of these constraints are violated it causes | 399 // relocation information. If any of these constraints are violated it causes |
351 // an assertion. | 400 // an assertion. |
352 class CodePatcher { | 401 class CodePatcher { |
353 public: | 402 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } \ | 449 } \ |
401 masm-> | 450 masm-> |
402 #else | 451 #else |
403 #define ACCESS_MASM(masm) masm-> | 452 #define ACCESS_MASM(masm) masm-> |
404 #endif | 453 #endif |
405 | 454 |
406 | 455 |
407 } } // namespace v8::internal | 456 } } // namespace v8::internal |
408 | 457 |
409 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 458 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |