| OLD | NEW |
| 1 // Copyright 2006-2009 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 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 // Tail call a code stub (jump) and return the code object called. Try to | 343 // Tail call a code stub (jump) and return the code object called. Try to |
| 344 // generate the code if necessary. Do not perform a GC but instead return | 344 // generate the code if necessary. Do not perform a GC but instead return |
| 345 // a retry after GC failure. | 345 // a retry after GC failure. |
| 346 Object* TryTailCallStub(CodeStub* stub); | 346 Object* TryTailCallStub(CodeStub* stub); |
| 347 | 347 |
| 348 // Return from a code stub after popping its arguments. | 348 // Return from a code stub after popping its arguments. |
| 349 void StubReturn(int argc); | 349 void StubReturn(int argc); |
| 350 | 350 |
| 351 // Call a runtime routine. | 351 // Call a runtime routine. |
| 352 // Eventually this should be used for all C calls. | |
| 353 void CallRuntime(Runtime::Function* f, int num_arguments); | 352 void CallRuntime(Runtime::Function* f, int num_arguments); |
| 354 | 353 |
| 355 // Call a runtime function, returning the CodeStub object called. | 354 // Call a runtime function, returning the CodeStub object called. |
| 356 // Try to generate the stub code if necessary. Do not perform a GC | 355 // Try to generate the stub code if necessary. Do not perform a GC |
| 357 // but instead return a retry after GC failure. | 356 // but instead return a retry after GC failure. |
| 358 Object* TryCallRuntime(Runtime::Function* f, int num_arguments); | 357 Object* TryCallRuntime(Runtime::Function* f, int num_arguments); |
| 359 | 358 |
| 360 // Convenience function: Same as above, but takes the fid instead. | 359 // Convenience function: Same as above, but takes the fid instead. |
| 361 void CallRuntime(Runtime::FunctionId id, int num_arguments); | 360 void CallRuntime(Runtime::FunctionId id, int num_arguments); |
| 362 | 361 |
| 363 // Convenience function: call an external reference. | 362 // Convenience function: call an external reference. |
| 364 void CallExternalReference(ExternalReference ref, int num_arguments); | 363 void CallExternalReference(ExternalReference ref, int num_arguments); |
| 365 | 364 |
| 366 // Convenience function: Same as above, but takes the fid instead. | 365 // Convenience function: Same as above, but takes the fid instead. |
| 367 Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments); | 366 Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments); |
| 368 | 367 |
| 369 // Tail call of a runtime routine (jump). | 368 // Tail call of a runtime routine (jump). |
| 370 // Like JumpToRuntime, but also takes care of passing the number | 369 // Like JumpToExternalReference, but also takes care of passing the number |
| 371 // of arguments. | 370 // of parameters. |
| 372 void TailCallRuntime(const ExternalReference& ext, | 371 void TailCallExternalReference(const ExternalReference& ext, |
| 372 int num_arguments, |
| 373 int result_size); |
| 374 |
| 375 // Convenience function: tail call a runtime routine (jump). |
| 376 void TailCallRuntime(Runtime::FunctionId fid, |
| 373 int num_arguments, | 377 int num_arguments, |
| 374 int result_size); | 378 int result_size); |
| 375 | 379 |
| 380 // Before calling a C-function from generated code, align arguments on stack. |
| 381 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
| 382 // etc., not pushed. The argument count assumes all arguments are word sized. |
| 383 // Some compilers/platforms require the stack to be aligned when calling |
| 384 // C++ code. |
| 385 // Needs a scratch register to do some arithmetic. This register will be |
| 386 // trashed. |
| 387 void PrepareCallCFunction(int num_arguments, Register scratch); |
| 388 |
| 389 // Calls a C function and cleans up the space for arguments allocated |
| 390 // by PrepareCallCFunction. The called function is not allowed to trigger a |
| 391 // garbage collection, since that might move the code and invalidate the |
| 392 // return address (unless this is somehow accounted for by the called |
| 393 // function). |
| 394 void CallCFunction(ExternalReference function, int num_arguments); |
| 395 void CallCFunction(Register function, int num_arguments); |
| 396 |
| 376 void PushHandleScope(Register scratch); | 397 void PushHandleScope(Register scratch); |
| 377 | 398 |
| 378 // Pops a handle scope using the specified scratch register and | 399 // Pops a handle scope using the specified scratch register and |
| 379 // ensuring that saved register, it is not no_reg, is left unchanged. | 400 // ensuring that saved register, it is not no_reg, is left unchanged. |
| 380 void PopHandleScope(Register saved, Register scratch); | 401 void PopHandleScope(Register saved, Register scratch); |
| 381 | 402 |
| 382 // As PopHandleScope, but does not perform a GC. Instead, returns a | 403 // As PopHandleScope, but does not perform a GC. Instead, returns a |
| 383 // retry after GC failure object if GC is necessary. | 404 // retry after GC failure object if GC is necessary. |
| 384 Object* TryPopHandleScope(Register saved, Register scratch); | 405 Object* TryPopHandleScope(Register saved, Register scratch); |
| 385 | 406 |
| 386 // Jump to a runtime routine. | 407 // Jump to a runtime routine. |
| 387 void JumpToRuntime(const ExternalReference& ext); | 408 void JumpToExternalReference(const ExternalReference& ext); |
| 388 | 409 |
| 389 | 410 |
| 390 // --------------------------------------------------------------------------- | 411 // --------------------------------------------------------------------------- |
| 391 // Utilities | 412 // Utilities |
| 392 | 413 |
| 393 void Ret(); | 414 void Ret(); |
| 394 | 415 |
| 395 // Emit code to discard a non-negative number of pointer-sized elements | 416 // Emit code to discard a non-negative number of pointer-sized elements |
| 396 // from the stack, clobbering only the esp register. | 417 // from the stack, clobbering only the esp register. |
| 397 void Drop(int element_count); | 418 void Drop(int element_count); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 } \ | 564 } \ |
| 544 masm-> | 565 masm-> |
| 545 #else | 566 #else |
| 546 #define ACCESS_MASM(masm) masm-> | 567 #define ACCESS_MASM(masm) masm-> |
| 547 #endif | 568 #endif |
| 548 | 569 |
| 549 | 570 |
| 550 } } // namespace v8::internal | 571 } } // namespace v8::internal |
| 551 | 572 |
| 552 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 573 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
| OLD | NEW |