| Index: src/assembler.h
|
| diff --git a/src/assembler.h b/src/assembler.h
|
| index a29aa064b876b2504108cfe4e8a0576c21dfc387..e8bc5d6caa675366cb3d895e59aafb3c62c85d36 100644
|
| --- a/src/assembler.h
|
| +++ b/src/assembler.h
|
| @@ -459,9 +459,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
|
| @@ -469,9 +466,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);
|
|
|
| @@ -599,17 +616,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;
|
| }
|
|
|
|
|