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

Unified Diff: src/runtime/runtime.cc

Issue 1362383002: [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm32 debug build check errors. Created 5 years, 2 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/runtime/runtime.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime.cc
diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc
index 15451c5c6e3828f356df456fe720d834ae633518..90f4e4ce3355ea698f778ac28eaf4ecd63d13363 100644
--- a/src/runtime/runtime.cc
+++ b/src/runtime/runtime.cc
@@ -4,6 +4,7 @@
#include "src/runtime/runtime.h"
+#include "src/assembler.h"
#include "src/contexts.h"
#include "src/handles-inl.h"
#include "src/heap/heap.h"
@@ -94,6 +95,31 @@ const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
}
+const Runtime::Function* Runtime::RuntimeFunctionTable(Isolate* isolate) {
+ if (isolate->external_reference_redirector()) {
+ // When running with the simulator we need to provide a table which has
+ // redirected runtime entry addresses.
+ if (!isolate->runtime_state()->redirected_intrinsic_functions()) {
+ size_t function_count = arraysize(kIntrinsicFunctions);
+ Function* redirected_functions = new Function[function_count];
+ memcpy(redirected_functions, kIntrinsicFunctions,
+ sizeof(kIntrinsicFunctions));
+ for (size_t i = 0; i < function_count; i++) {
+ ExternalReference redirected_entry(static_cast<Runtime::FunctionId>(i),
+ isolate);
+ redirected_functions[i].entry = redirected_entry.address();
+ }
+ isolate->runtime_state()->set_redirected_intrinsic_functions(
+ redirected_functions);
+ }
+
+ return isolate->runtime_state()->redirected_intrinsic_functions();
+ } else {
+ return kIntrinsicFunctions;
+ }
+}
+
+
std::ostream& operator<<(std::ostream& os, Runtime::FunctionId id) {
return os << Runtime::FunctionForId(id)->name;
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698