| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 5afaf2f5051d5ccc9cf0e4b53e722484ba7ff111..5f3185d3c667cb13adde61ba6fae9822643352ac 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -8492,16 +8492,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushWithContext) {
|
| }
|
| }
|
|
|
| - JSFunction* function;
|
| - if (args[1]->IsSmi()) {
|
| - // A smi sentinel indicates a context nested inside global code rather
|
| - // than some function. There is a canonical empty function that can be
|
| - // gotten from the global context.
|
| - function = isolate->context()->global_context()->closure();
|
| - } else {
|
| - function = JSFunction::cast(args[1]);
|
| - }
|
| -
|
| + JSFunction* function = JSFunction::cast(args[1]);
|
| Context* context;
|
| MaybeObject* maybe_context =
|
| isolate->heap()->AllocateWithContext(function,
|
| @@ -8518,15 +8509,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushCatchContext) {
|
| ASSERT(args.length() == 3);
|
| String* name = String::cast(args[0]);
|
| Object* thrown_object = args[1];
|
| - JSFunction* function;
|
| - if (args[2]->IsSmi()) {
|
| - // A smi sentinel indicates a context nested inside global code rather
|
| - // than some function. There is a canonical empty function that can be
|
| - // gotten from the global context.
|
| - function = isolate->context()->global_context()->closure();
|
| - } else {
|
| - function = JSFunction::cast(args[2]);
|
| - }
|
| + JSFunction* function = JSFunction::cast(args[2]);
|
| Context* context;
|
| MaybeObject* maybe_context =
|
| isolate->heap()->AllocateCatchContext(function,
|
| @@ -8543,15 +8526,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushBlockContext) {
|
| NoHandleAllocation ha;
|
| ASSERT(args.length() == 2);
|
| SerializedScopeInfo* scope_info = SerializedScopeInfo::cast(args[0]);
|
| - JSFunction* function;
|
| - if (args[1]->IsSmi()) {
|
| - // A smi sentinel indicates a context nested inside global code rather
|
| - // than some function. There is a canonical empty function that can be
|
| - // gotten from the global context.
|
| - function = isolate->context()->global_context()->closure();
|
| - } else {
|
| - function = JSFunction::cast(args[1]);
|
| - }
|
| + JSFunction* function = JSFunction::cast(args[1]);
|
| Context* context;
|
| MaybeObject* maybe_context =
|
| isolate->heap()->AllocateBlockContext(function,
|
|
|