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

Unified Diff: src/parser.cc

Issue 18143: Change the handling of catch blocks to use context extension objects... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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/codegen-ia32.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
===================================================================
--- src/parser.cc (revision 1089)
+++ src/parser.cc (working copy)
@@ -2064,32 +2064,6 @@
}
-Expression* Parser::MakeCatchContext(Handle<String> id, VariableProxy* value) {
- ZoneListWrapper<ObjectLiteral::Property> properties =
- factory()->NewList<ObjectLiteral::Property>(1);
- Literal* key = NEW(Literal(id));
- ObjectLiteral::Property* property = NEW(ObjectLiteral::Property(key, value));
- properties.Add(property);
-
- // This must be called always, even during pre-parsing!
- // (Computation of literal index must happen before pre-parse bailout.)
- int literal_index = temp_scope_->NextMaterializedLiteralIndex();
- if (is_pre_parsing_) {
- return NULL;
- }
-
- // Construct the expression for calling Runtime::CreateObjectLiteral
- // with the literal array as argument.
- Handle<FixedArray> constant_properties = Factory::empty_fixed_array();
- ZoneList<Expression*>* arguments = new ZoneList<Expression*>(1);
- arguments->Add(new Literal(constant_properties));
-
- return new ObjectLiteral(constant_properties,
- properties.elements(),
- literal_index);
-}
-
-
TryStatement* Parser::ParseTryStatement(bool* ok) {
// TryStatement ::
// 'try' Block Catch
@@ -2141,7 +2115,8 @@
// Allocate a temporary for holding the finally state while
// executing the finally block.
catch_var = top_scope_->NewTemporary(Factory::catch_var_symbol());
- Expression* obj = MakeCatchContext(name, catch_var);
+ Literal* name_literal = NEW(Literal(name));
+ Expression* obj = NEW(CatchExtensionObject(name_literal, catch_var));
{ Target target(this, &catch_collector);
catch_block = WithHelper(obj, NULL, true, CHECK_OK);
}
@@ -3103,10 +3078,6 @@
constant_properties->set(position++, *literal->handle());
}
- // Construct the expression for calling Runtime::CreateObjectLiteral
- // with the literal array as argument.
- ZoneList<Expression*>* arguments = new ZoneList<Expression*>(1);
- arguments->Add(new Literal(constant_properties));
return new ObjectLiteral(constant_properties,
properties.elements(),
literal_index);
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698