| Index: src/runtime/runtime-internal.cc
|
| diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
|
| index 12864066c4e333d3f9c7f7bb84b1164474a77171..c2ccd51e70f9c36c3254b80099125c95abcfe45b 100644
|
| --- a/src/runtime/runtime-internal.cc
|
| +++ b/src/runtime/runtime-internal.cc
|
| @@ -37,22 +37,24 @@ RUNTIME_FUNCTION(Runtime_ExportPrivateSymbols) {
|
| }
|
|
|
|
|
| -RUNTIME_FUNCTION(Runtime_ImportToRuntime) {
|
| +RUNTIME_FUNCTION(Runtime_ExportToRuntime) {
|
| HandleScope scope(isolate);
|
| DCHECK(args.length() == 1);
|
| - CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
|
| - RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
|
| - Bootstrapper::ImportNatives(isolate, container);
|
| - return isolate->heap()->undefined_value();
|
| -}
|
| -
|
| -
|
| -RUNTIME_FUNCTION(Runtime_ImportExperimentalToRuntime) {
|
| - HandleScope scope(isolate);
|
| - DCHECK(args.length() == 1);
|
| - CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
|
| + CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0);
|
| + RUNTIME_ASSERT(array->HasFastElements());
|
| RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
|
| - Bootstrapper::ImportExperimentalNatives(isolate, container);
|
| + Handle<Context> native_context = isolate->native_context();
|
| + Handle<FixedArray> fixed_array(FixedArray::cast(array->elements()));
|
| + int length = Smi::cast(array->length())->value();
|
| + for (int i = 0; i < length; i += 2) {
|
| + RUNTIME_ASSERT(fixed_array->get(i)->IsString());
|
| + Handle<String> name(String::cast(fixed_array->get(i)));
|
| + RUNTIME_ASSERT(fixed_array->get(i + 1)->IsJSObject());
|
| + Handle<JSObject> object(JSObject::cast(fixed_array->get(i + 1)));
|
| + const Runtime::Function* function = Runtime::FunctionForName(name);
|
| + RUNTIME_ASSERT(function->intrinsic_type == Runtime::CONTEXT);
|
| + native_context->set(function->index, *object);
|
| + }
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
|
|