Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/runtime.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 360
361 class Runtime : public AllStatic { 361 class Runtime : public AllStatic {
362 public: 362 public:
363 enum FunctionId { 363 enum FunctionId {
364 #define F(name, nargs, ressize) k##name, 364 #define F(name, nargs, ressize) k##name,
365 RUNTIME_FUNCTION_LIST(F) 365 RUNTIME_FUNCTION_LIST(F)
366 kNofFunctions 366 kNofFunctions
367 #undef F 367 #undef F
368 }; 368 };
369 369
370 enum CallingConvention {
371 // Calling with exit frame. Callee may iterate through the stack frames
372 // and perform garbage collection.
373 EXIT_FRAME_CALL,
374
375 // The callee always returns a valid object.
376 DIRECT_CALL_NOT_FAILS
Søren Thygesen Gjesse 2010/02/22 12:38:22 NOT -> NEVER.
377 };
378
370 // Runtime function descriptor. 379 // Runtime function descriptor.
371 struct Function { 380 struct Function {
372 // The JS name of the function. 381 // The JS name of the function.
373 const char* name; 382 const char* name;
374 383
375 // The C++ (native) entry point. 384 // The C++ (native) entry point.
376 byte* entry; 385 byte* entry;
377 386
378 // The number of arguments expected; nargs < 0 if variable no. of 387 // The number of arguments expected; nargs < 0 if variable no. of
379 // arguments. 388 // arguments.
380 int nargs; 389 int nargs;
381 int stub_id; 390 int stub_id;
382 // Size of result, if complex (larger than a single pointer), 391 // Size of result, if complex (larger than a single pointer),
383 // otherwise zero. 392 // otherwise zero.
384 int result_size; 393 int result_size;
394
395 CallingConvention calling_convention;
385 }; 396 };
386 397
387 // Get the runtime function with the given function id. 398 // Get the runtime function with the given function id.
388 static Function* FunctionForId(FunctionId fid); 399 static Function* FunctionForId(FunctionId fid);
389 400
390 // Get the runtime function with the given name. 401 // Get the runtime function with the given name.
391 static Function* FunctionForName(const char* name); 402 static Function* FunctionForName(const char* name);
392 403
393 static int StringMatch(Handle<String> sub, Handle<String> pat, int index); 404 static int StringMatch(Handle<String> sub, Handle<String> pat, int index);
394 405
(...skipping 26 matching lines...) Expand all
421 int position); 432 int position);
422 433
423 // Helper functions used stubs. 434 // Helper functions used stubs.
424 static void PerformGC(Object* result); 435 static void PerformGC(Object* result);
425 }; 436 };
426 437
427 438
428 } } // namespace v8::internal 439 } } // namespace v8::internal
429 440
430 #endif // V8_RUNTIME_H_ 441 #endif // V8_RUNTIME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698