| Index: src/assembler.h
|
| ===================================================================
|
| --- src/assembler.h (revision 6213)
|
| +++ src/assembler.h (working copy)
|
| @@ -458,9 +458,6 @@
|
| #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
|
| @@ -468,9 +465,20 @@
|
| // addresses when deserializing a heap.
|
| class ExternalReference BASE_EMBEDDED {
|
| public:
|
| + // Used in the simulator to support different native api interfaces.
|
| + // |BUILTIN_CALL| - MaybeObject* f(v8::internal::Arguments)
|
| + // |DIRECT_CALL| - Handle<Value> f(v8::Arguments&)
|
| + enum Type {
|
| + BUILTIN_CALL, // default
|
| + DIRECT_CALL
|
| + };
|
| +
|
| + typedef void* ExternalReferenceRedirector(
|
| + void* original, bool fp_return, Type type);
|
| +
|
| explicit ExternalReference(Builtins::CFunctionId id);
|
|
|
| - explicit ExternalReference(ApiFunction* ptr);
|
| + explicit ExternalReference(ApiFunction* ptr, bool fp_return, Type type);
|
|
|
| explicit ExternalReference(Builtins::Name name);
|
|
|
| @@ -597,17 +605,19 @@
|
|
|
| static ExternalReferenceRedirector* redirector_;
|
|
|
| - static void* Redirect(void* address, bool fp_return = false) {
|
| + static void* Redirect(void* address, bool fp_return = false,
|
| + Type type = ExternalReference::BUILTIN_CALL) {
|
| if (redirector_ == NULL) return address;
|
| - void* answer = (*redirector_)(address, fp_return);
|
| + void* answer = (*redirector_)(address, fp_return, type);
|
| return answer;
|
| }
|
|
|
| - static void* Redirect(Address address_arg, bool fp_return = false) {
|
| + static void* Redirect(Address address_arg, bool fp_return = false,
|
| + Type type = ExternalReference::BUILTIN_CALL) {
|
| void* address = reinterpret_cast<void*>(address_arg);
|
| void* answer = (redirector_ == NULL) ?
|
| address :
|
| - (*redirector_)(address, fp_return);
|
| + (*redirector_)(address, fp_return, type);
|
| return answer;
|
| }
|
|
|
|
|