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

Side by Side Diff: src/parser.cc

Issue 716853003: Classes: Add support for arguments in default constructor (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ZoneList<Statement*>* body = NULL; 295 ZoneList<Statement*>* body = NULL;
296 296
297 { 297 {
298 AstNodeFactory<AstConstructionVisitor> function_factory( 298 AstNodeFactory<AstConstructionVisitor> function_factory(
299 ast_value_factory()); 299 ast_value_factory());
300 FunctionState function_state(&function_state_, &scope_, function_scope, 300 FunctionState function_state(&function_state_, &scope_, function_scope,
301 &function_factory); 301 &function_factory);
302 302
303 body = new (zone()) ZoneList<Statement*>(1, zone()); 303 body = new (zone()) ZoneList<Statement*>(1, zone());
304 if (call_super) { 304 if (call_super) {
305 Expression* prop = SuperReference(function_scope, factory(), pos);
306 ZoneList<Expression*>* args = 305 ZoneList<Expression*>* args =
307 new (zone()) ZoneList<Expression*>(0, zone()); 306 new (zone()) ZoneList<Expression*>(0, zone());
308 Call* call = factory()->NewCall(prop, args, pos); 307 CallRuntime* call = factory()->NewCallRuntime(
308 ast_value_factory()->empty_string(),
309 Runtime::FunctionForId(Runtime::kDefaultConstructorSuperCall), args,
310 pos);
309 body->Add(factory()->NewExpressionStatement(call, pos), zone()); 311 body->Add(factory()->NewExpressionStatement(call, pos), zone());
310 } 312 }
311 313
312 materialized_literal_count = function_state.materialized_literal_count(); 314 materialized_literal_count = function_state.materialized_literal_count();
313 expected_property_count = function_state.expected_property_count(); 315 expected_property_count = function_state.expected_property_count();
314 handler_count = function_state.handler_count(); 316 handler_count = function_state.handler_count();
315 317
316 ast_properties = *factory()->visitor()->ast_properties(); 318 ast_properties = *factory()->visitor()->ast_properties();
317 dont_optimize_reason = factory()->visitor()->dont_optimize_reason(); 319 dont_optimize_reason = factory()->visitor()->dont_optimize_reason();
318 } 320 }
(...skipping 4704 matching lines...) Expand 10 before | Expand all | Expand 10 after
5023 5025
5024 // We cannot internalize on a background thread; a foreground task will take 5026 // We cannot internalize on a background thread; a foreground task will take
5025 // care of calling Parser::Internalize just before compilation. 5027 // care of calling Parser::Internalize just before compilation.
5026 5028
5027 if (compile_options() == ScriptCompiler::kProduceParserCache) { 5029 if (compile_options() == ScriptCompiler::kProduceParserCache) {
5028 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); 5030 if (result != NULL) *info_->cached_data() = recorder.GetScriptData();
5029 log_ = NULL; 5031 log_ = NULL;
5030 } 5032 }
5031 } 5033 }
5032 } } // namespace v8::internal 5034 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698