Chromium Code Reviews

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 598072: Direct call C++ functions (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
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 348 matching lines...)
359 359
360 // Convenience function: Same as above, but takes the fid instead. 360 // Convenience function: Same as above, but takes the fid instead.
361 void CallRuntime(Runtime::FunctionId id, int num_arguments); 361 void CallRuntime(Runtime::FunctionId id, int num_arguments);
362 362
363 // Convenience function: call an external reference. 363 // Convenience function: call an external reference.
364 void CallExternalReference(ExternalReference ref, int num_arguments); 364 void CallExternalReference(ExternalReference ref, int num_arguments);
365 365
366 // Convenience function: Same as above, but takes the fid instead. 366 // Convenience function: Same as above, but takes the fid instead.
367 Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments); 367 Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments);
368 368
369 // Tail call of a runtime routine (jump). 369 // Tail call of a runtime routine (jump or equivalent if jump is not
370 // Like JumpToRuntime, but also takes care of passing the number 370 // possible). Like JumpToRuntime, but also takes care of passing the number
371 // of arguments. 371 // of arguments.
372 void TailCallRuntime(const ExternalReference& ext, 372 void TailCallRuntime(Runtime::FunctionId id,
373 int num_arguments, 373 int num_arguments,
374 int result_size); 374 int result_size);
375 375
376 void TailCallExternalReference(const ExternalReference& ext,
377 int num_arguments,
378 int result_size);
379
376 void PushHandleScope(Register scratch); 380 void PushHandleScope(Register scratch);
377 381
378 // Pops a handle scope using the specified scratch register and 382 // Pops a handle scope using the specified scratch register and
379 // ensuring that saved register, it is not no_reg, is left unchanged. 383 // ensuring that saved register, it is not no_reg, is left unchanged.
380 void PopHandleScope(Register saved, Register scratch); 384 void PopHandleScope(Register saved, Register scratch);
381 385
382 // As PopHandleScope, but does not perform a GC. Instead, returns a 386 // As PopHandleScope, but does not perform a GC. Instead, returns a
383 // retry after GC failure object if GC is necessary. 387 // retry after GC failure object if GC is necessary.
384 Object* TryPopHandleScope(Register saved, Register scratch); 388 Object* TryPopHandleScope(Register saved, Register scratch);
385 389
(...skipping 91 matching lines...)
477 Register scratch, 481 Register scratch,
478 AllocationFlags flags); 482 AllocationFlags flags);
479 void UpdateAllocationTopHelper(Register result_end, Register scratch); 483 void UpdateAllocationTopHelper(Register result_end, Register scratch);
480 484
481 // Helper for PopHandleScope. Allowed to perform a GC and returns 485 // Helper for PopHandleScope. Allowed to perform a GC and returns
482 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and 486 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and
483 // possibly returns a failure object indicating an allocation failure. 487 // possibly returns a failure object indicating an allocation failure.
484 Object* PopHandleScopeHelper(Register saved, 488 Object* PopHandleScopeHelper(Register saved,
485 Register scratch, 489 Register scratch,
486 bool gc_allowed); 490 bool gc_allowed);
491
492 void DirectInvokeRuntime(Runtime::Function* f, InvokeFlag flag);
487 }; 493 };
488 494
489 495
490 // The code patcher is used to patch (typically) small parts of code e.g. for 496 // The code patcher is used to patch (typically) small parts of code e.g. for
491 // debugging and other types of instrumentation. When using the code patcher 497 // debugging and other types of instrumentation. When using the code patcher
492 // the exact number of bytes specified must be emitted. Is not legal to emit 498 // the exact number of bytes specified must be emitted. Is not legal to emit
493 // relocation information. If any of these constraints are violated it causes 499 // relocation information. If any of these constraints are violated it causes
494 // an assertion. 500 // an assertion.
495 class CodePatcher { 501 class CodePatcher {
496 public: 502 public:
(...skipping 46 matching lines...)
543 } \ 549 } \
544 masm-> 550 masm->
545 #else 551 #else
546 #define ACCESS_MASM(masm) masm-> 552 #define ACCESS_MASM(masm) masm->
547 #endif 553 #endif
548 554
549 555
550 } } // namespace v8::internal 556 } } // namespace v8::internal
551 557
552 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 558 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine