Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: src/runtime.cc

Issue 8065002: Simplify pushing function argument for context allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698