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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // Generate code for checking access rights - used for security checks | 178 // Generate code for checking access rights - used for security checks |
179 // on access to global objects across environments. The holder register | 179 // on access to global objects across environments. The holder register |
180 // is left untouched, but the scratch register is clobbered. | 180 // is left untouched, but the scratch register is clobbered. |
181 void CheckAccessGlobalProxy(Register holder_reg, | 181 void CheckAccessGlobalProxy(Register holder_reg, |
182 Register scratch, | 182 Register scratch, |
183 Label* miss); | 183 Label* miss); |
184 | 184 |
185 | 185 |
186 // --------------------------------------------------------------------------- | 186 // --------------------------------------------------------------------------- |
| 187 // Allocation support |
| 188 |
| 189 // Allocate an object in new space. If the new space is exhausted control |
| 190 // continues at the gc_required label. The allocated object is returned in |
| 191 // result and end of the new object is returned in result_end. The register |
| 192 // scratch can be passed as no_reg in which case an additional object |
| 193 // reference will be added to the reloc info. The returned pointers in result |
| 194 // 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 |
| 196 // 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 |
| 198 // should be no_reg as it is never used. |
| 199 void AllocateObjectInNewSpace(int object_size, |
| 200 Register result, |
| 201 Register result_end, |
| 202 Register scratch, |
| 203 Label* gc_required, |
| 204 bool result_contains_top_on_entry); |
| 205 |
| 206 void AllocateObjectInNewSpace(int header_size, |
| 207 ScaleFactor element_size, |
| 208 Register element_count, |
| 209 Register result, |
| 210 Register result_end, |
| 211 Register scratch, |
| 212 Label* gc_required, |
| 213 bool result_contains_top_on_entry); |
| 214 |
| 215 void AllocateObjectInNewSpace(Register object_size, |
| 216 Register result, |
| 217 Register result_end, |
| 218 Register scratch, |
| 219 Label* gc_required, |
| 220 bool result_contains_top_on_entry); |
| 221 |
| 222 // 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 |
| 224 // object(s) no longer allocated as they would be invalid when allocation is |
| 225 // un-done. |
| 226 void UndoAllocationInNewSpace(Register object); |
| 227 |
| 228 // --------------------------------------------------------------------------- |
187 // Support functions. | 229 // Support functions. |
188 | 230 |
189 // Check if result is zero and op is negative. | 231 // Check if result is zero and op is negative. |
190 void NegativeZeroTest(Register result, Register op, Label* then_label); | 232 void NegativeZeroTest(Register result, Register op, Label* then_label); |
191 | 233 |
192 // Check if result is zero and op is negative in code using jump targets. | 234 // Check if result is zero and op is negative in code using jump targets. |
193 void NegativeZeroTest(CodeGenerator* cgen, | 235 void NegativeZeroTest(CodeGenerator* cgen, |
194 Register result, | 236 Register result, |
195 Register op, | 237 Register op, |
196 JumpTarget* then_target); | 238 JumpTarget* then_target); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 Label* done, | 338 Label* done, |
297 InvokeFlag flag); | 339 InvokeFlag flag); |
298 | 340 |
299 // Get the code for the given builtin. Returns if able to resolve | 341 // Get the code for the given builtin. Returns if able to resolve |
300 // the function in the 'resolved' flag. | 342 // the function in the 'resolved' flag. |
301 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | 343 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); |
302 | 344 |
303 // Activation support. | 345 // Activation support. |
304 void EnterFrame(StackFrame::Type type); | 346 void EnterFrame(StackFrame::Type type); |
305 void LeaveFrame(StackFrame::Type type); | 347 void LeaveFrame(StackFrame::Type type); |
| 348 |
| 349 // Allocation support helpers. |
| 350 void LoadAllocationTopHelper(Register result, |
| 351 Register result_end, |
| 352 Register scratch, |
| 353 bool result_contains_top_on_entry); |
| 354 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
306 }; | 355 }; |
307 | 356 |
308 | 357 |
309 // The code patcher is used to patch (typically) small parts of code e.g. for | 358 // The code patcher is used to patch (typically) small parts of code e.g. for |
310 // debugging and other types of instrumentation. When using the code patcher | 359 // debugging and other types of instrumentation. When using the code patcher |
311 // the exact number of bytes specified must be emitted. Is not legal to emit | 360 // the exact number of bytes specified must be emitted. Is not legal to emit |
312 // relocation information. If any of these constraints are violated it causes | 361 // relocation information. If any of these constraints are violated it causes |
313 // an assertion. | 362 // an assertion. |
314 class CodePatcher { | 363 class CodePatcher { |
315 public: | 364 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } \ | 411 } \ |
363 masm-> | 412 masm-> |
364 #else | 413 #else |
365 #define ACCESS_MASM(masm) masm-> | 414 #define ACCESS_MASM(masm) masm-> |
366 #endif | 415 #endif |
367 | 416 |
368 | 417 |
369 } } // namespace v8::internal | 418 } } // namespace v8::internal |
370 | 419 |
371 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 420 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |