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

Unified Diff: src/assembler.h

Issue 6606006: [Isolates] Merge 6500:6700 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
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/array.js ('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
===================================================================
--- src/assembler.h (revision 7006)
+++ src/assembler.h (working copy)
@@ -184,7 +184,6 @@
DEBUG_BREAK, // Code target for the debugger statement.
CODE_TARGET, // Code target which is not any of the above.
EMBEDDED_OBJECT,
-
GLOBAL_PROPERTY_CELL,
// Everything after runtime_entry (inclusive) is not GC'ed.
@@ -202,7 +201,7 @@
NUMBER_OF_MODES, // must be no greater than 14 - see RelocInfoWriter
NONE, // never recorded
LAST_CODE_ENUM = CODE_TARGET,
- LAST_GCED_ENUM = EMBEDDED_OBJECT
+ LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL
};
@@ -466,9 +465,29 @@
// 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);
@@ -476,9 +495,6 @@
explicit ExternalReference(const Runtime::Function* f);
- // Isolate::Current() as an external reference.
- static ExternalReference isolate_address();
-
explicit ExternalReference(const IC_Utility& ic_utility);
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -491,6 +507,9 @@
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.
@@ -591,28 +610,33 @@
static void set_redirector(ExternalReferenceRedirector* redirector) {
// We can't stack them.
ASSERT(Isolate::Current()->external_reference_redirector() == NULL);
- Isolate::Current()->set_external_reference_redirector(redirector);
+ Isolate::Current()->set_external_reference_redirector(
+ reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector));
}
private:
explicit ExternalReference(void* address)
: address_(address) {}
- static void* Redirect(void* address, bool fp_return = false) {
+ static void* Redirect(void* address,
+ Type type = ExternalReference::BUILTIN_CALL) {
ExternalReferenceRedirector* redirector =
- Isolate::Current()->external_reference_redirector();
+ reinterpret_cast<ExternalReferenceRedirector*>(
+ Isolate::Current()->external_reference_redirector());
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) {
ExternalReferenceRedirector* redirector =
- Isolate::Current()->external_reference_redirector();
+ reinterpret_cast<ExternalReferenceRedirector*>(
+ Isolate::Current()->external_reference_redirector());
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/array.js ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698