Chromium Code Reviews| Index: src/assembler.h |
| =================================================================== |
| --- src/assembler.h (revision 6551) |
| +++ src/assembler.h (working copy) |
| @@ -459,9 +459,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 |
| @@ -469,9 +466,29 @@ |
| // addresses when deserializing a heap. |
| class ExternalReference BASE_EMBEDDED { |
| public: |
| + // Used in the simulator to support different native api calls. |
| + // |
| + // BUILTIN_CALL - builtin/runtime call. |
|
Søren Thygesen Gjesse
2011/02/02 13:24:38
builtin/runtime -> builtin
Zaheer
2011/02/03 07:27:31
Done.
|
| + // MaybeObject* f(v8::internal::Arguments). |
| + // |
| + // FP_CALL - builtin/runtime call that returns floating point. |
|
Søren Thygesen Gjesse
2011/02/02 13:24:38
Please change "builtin/runtime call that returns f
Zaheer
2011/02/03 07:27:31
if iam not mistaken, native_compare_doubles uses t
Søren Thygesen Gjesse
2011/02/03 08:31:14
You are right it does, and of cause returns an int
|
| + // 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, |
|
Søren Thygesen Gjesse
2011/02/02 13:24:38
FP_RETURN_CALL -> FP_CALL as in comment.
Zaheer
2011/02/03 07:27:31
modified the comment to FP_RETURN_CALL to reflect
|
| + 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 @@ |
| 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; |
| } |