| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index e8abdef7f5c17f27468cf1ef7901206b3dc7b281..0255e6db32f23b003038d5619d37fcbd6d7257cd 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -1242,6 +1242,38 @@ static Object* Runtime_FinishArrayPrototypeSetup(Arguments args) {
|
| }
|
|
|
|
|
| +static Handle<JSFunction> InstallFunction(Handle<JSObject> holder,
|
| + const char* name,
|
| + Builtins::Name builtin_name) {
|
| + Handle<String> key = Factory::LookupAsciiSymbol(name);
|
| + Handle<Code> code(Builtins::builtin(builtin_name));
|
| + Handle<JSFunction> optimized = Factory::NewFunction(key,
|
| + JS_OBJECT_TYPE,
|
| + JSObject::kHeaderSize,
|
| + code,
|
| + false);
|
| + optimized->shared()->DontAdaptArguments();
|
| + SetProperty(holder, key, optimized, NONE);
|
| + return optimized;
|
| +}
|
| +
|
| +
|
| +static Object* Runtime_SpecialArrayFunctions(Arguments args) {
|
| + HandleScope scope;
|
| + ASSERT(args.length() == 1);
|
| + CONVERT_ARG_CHECKED(JSObject, holder, 0);
|
| +
|
| + InstallFunction(holder, "pop", Builtins::ArrayPop);
|
| + InstallFunction(holder, "push", Builtins::ArrayPush);
|
| + InstallFunction(holder, "shift", Builtins::ArrayShift);
|
| + InstallFunction(holder, "unshift", Builtins::ArrayUnshift);
|
| + InstallFunction(holder, "slice", Builtins::ArraySlice);
|
| + InstallFunction(holder, "splice", Builtins::ArraySplice);
|
| +
|
| + return *holder;
|
| +}
|
| +
|
| +
|
| static Object* Runtime_MaterializeRegExpLiteral(Arguments args) {
|
| HandleScope scope;
|
| ASSERT(args.length() == 4);
|
|
|