| 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;
|
| }
|
|
|