| Index: src/assembler.h
|
| ===================================================================
|
| --- src/assembler.h (revision 7267)
|
| +++ src/assembler.h (working copy)
|
| @@ -37,7 +37,6 @@
|
|
|
| #include "gdb-jit.h"
|
| #include "runtime.h"
|
| -#include "top.h"
|
| #include "token.h"
|
|
|
| namespace v8 {
|
| @@ -318,7 +317,7 @@
|
| INLINE(void set_call_object(Object* target));
|
| INLINE(Object** call_object_address());
|
|
|
| - template<typename StaticVisitor> inline void Visit();
|
| + template<typename StaticVisitor> inline void Visit(Heap* heap);
|
| inline void Visit(ObjectVisitor* v);
|
|
|
| // Patch the code with some other code.
|
| @@ -510,7 +509,7 @@
|
|
|
| explicit ExternalReference(Runtime::FunctionId id);
|
|
|
| - explicit ExternalReference(Runtime::Function* f);
|
| + explicit ExternalReference(const Runtime::Function* f);
|
|
|
| explicit ExternalReference(const IC_Utility& ic_utility);
|
|
|
| @@ -520,10 +519,13 @@
|
|
|
| explicit ExternalReference(StatsCounter* counter);
|
|
|
| - explicit ExternalReference(Top::AddressId id);
|
| + explicit ExternalReference(Isolate::AddressId id);
|
|
|
| explicit ExternalReference(const SCTableReference& table_ref);
|
|
|
| + // Isolate::Current() as an external reference.
|
| + static ExternalReference isolate_address();
|
| +
|
| // One-of-a-kind references. These references are not part of a general
|
| // pattern. This means that they have to be added to the
|
| // ExternalReferenceTable in serialize.cc manually.
|
| @@ -627,29 +629,35 @@
|
| // This lets you register a function that rewrites all external references.
|
| // Used by the ARM simulator to catch calls to external references.
|
| static void set_redirector(ExternalReferenceRedirector* redirector) {
|
| - ASSERT(redirector_ == NULL); // We can't stack them.
|
| - redirector_ = redirector;
|
| + // We can't stack them.
|
| + ASSERT(Isolate::Current()->external_reference_redirector() == NULL);
|
| + Isolate::Current()->set_external_reference_redirector(
|
| + reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector));
|
| }
|
|
|
| private:
|
| explicit ExternalReference(void* address)
|
| : address_(address) {}
|
|
|
| - static ExternalReferenceRedirector* redirector_;
|
| -
|
| static void* Redirect(void* address,
|
| Type type = ExternalReference::BUILTIN_CALL) {
|
| - if (redirector_ == NULL) return address;
|
| - void* answer = (*redirector_)(address, type);
|
| + ExternalReferenceRedirector* redirector =
|
| + reinterpret_cast<ExternalReferenceRedirector*>(
|
| + Isolate::Current()->external_reference_redirector());
|
| + if (redirector == NULL) return address;
|
| + void* answer = (*redirector)(address, type);
|
| return answer;
|
| }
|
|
|
| static void* Redirect(Address address_arg,
|
| Type type = ExternalReference::BUILTIN_CALL) {
|
| + ExternalReferenceRedirector* redirector =
|
| + reinterpret_cast<ExternalReferenceRedirector*>(
|
| + Isolate::Current()->external_reference_redirector());
|
| void* address = reinterpret_cast<void*>(address_arg);
|
| - void* answer = (redirector_ == NULL) ?
|
| + void* answer = (redirector == NULL) ?
|
| address :
|
| - (*redirector_)(address, type);
|
| + (*redirector)(address, type);
|
| return answer;
|
| }
|
|
|
|
|