Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 4e0a86b318c2a8225cefe177bb4bce23269e0677..7dc4edf2e0e5d19e62d3c16edbc3d17fab321707 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -8738,6 +8738,24 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) { |
| } |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_NewGlobalContext) { |
| + NoHandleAllocation ha; |
| + ASSERT(args.length() == 2); |
| + |
| + CONVERT_ARG_CHECKED(JSFunction, function, 0); |
| + CONVERT_ARG_CHECKED(ScopeInfo, scope_info, 1); |
| + Object* result; |
| + { MaybeObject* maybe_result = |
| + isolate->heap()->AllocateGlobalContext(function, scope_info); |
| + if (!maybe_result->ToObject(&result)) return maybe_result; |
|
Sven Panne
2012/08/27 06:24:54
Make result a Context*, use "...->To(&result)" and
rossberg
2012/08/27 09:07:16
Done (here and for NewFunctionContext below).
|
| + } |
| + |
| + isolate->set_context(Context::cast(result)); |
| + |
| + return result; // non-failure |
| +} |
| + |
| + |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_NewFunctionContext) { |
| NoHandleAllocation ha; |
| ASSERT(args.length() == 1); |