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

Unified Diff: src/assembler.h

Issue 6538019: Porting of revisions 6639, 6794 and 6805 to the 3.0 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.0
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index 844936a7a20a9cbb04fc9faff78836aa725984c6..9ea4d410c82404fccb7b6abb244d2b8ed52d01bf 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -465,9 +465,6 @@ class Debug_Address;
#endif
-typedef void* ExternalReferenceRedirector(void* original, bool fp_return);
-
-
// An ExternalReference represents a C++ address used in the generated
// code. All references to C++ functions and variables must be encapsulated in
// an ExternalReference instance. This is done in order to track the origin of
@@ -475,9 +472,29 @@ typedef void* ExternalReferenceRedirector(void* original, bool fp_return);
// addresses when deserializing a heap.
class ExternalReference BASE_EMBEDDED {
public:
+ // Used in the simulator to support different native api calls.
+ //
+ // BUILTIN_CALL - builtin call.
+ // MaybeObject* f(v8::internal::Arguments).
+ //
+ // FP_RETURN_CALL - builtin call that returns floating point.
+ // double f(double, double).
+ //
+ // DIRECT_CALL - direct call to API function native callback
+ // from generated code.
+ // Handle<Value> f(v8::Arguments&)
+ //
+ enum Type {
+ BUILTIN_CALL, // default
+ FP_RETURN_CALL,
+ DIRECT_CALL
+ };
+
+ typedef void* ExternalReferenceRedirector(void* original, Type type);
+
explicit ExternalReference(Builtins::CFunctionId id);
- explicit ExternalReference(ApiFunction* ptr);
+ explicit ExternalReference(ApiFunction* ptr, Type type);
explicit ExternalReference(Builtins::Name name);
@@ -605,17 +622,19 @@ class ExternalReference BASE_EMBEDDED {
static ExternalReferenceRedirector* redirector_;
- static void* Redirect(void* address, bool fp_return = false) {
+ static void* Redirect(void* address,
+ Type type = ExternalReference::BUILTIN_CALL) {
if (redirector_ == NULL) return address;
- void* answer = (*redirector_)(address, fp_return);
+ void* answer = (*redirector_)(address, type);
return answer;
}
- static void* Redirect(Address address_arg, bool fp_return = false) {
+ static void* Redirect(Address address_arg,
+ Type type = ExternalReference::BUILTIN_CALL) {
void* address = reinterpret_cast<void*>(address_arg);
void* answer = (redirector_ == NULL) ?
address :
- (*redirector_)(address, fp_return);
+ (*redirector_)(address, type);
return answer;
}
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698