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

Side by Side Diff: src/full-codegen.cc

Issue 160073006: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extra parens in parameter lists now recognized, no longer segfaults on "()" Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
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 "v8.h" 5 #include "v8.h"
6 6
7 #include "codegen.h" 7 #include "codegen.h"
8 #include "compiler.h" 8 #include "compiler.h"
9 #include "debug.h" 9 #include "debug.h"
10 #include "full-codegen.h" 10 #include "full-codegen.h"
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 expr->extension()->GetNativeFunctionTemplate( 1546 expr->extension()->GetNativeFunctionTemplate(
1547 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); 1547 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name));
1548 ASSERT(!fun_template.IsEmpty()); 1548 ASSERT(!fun_template.IsEmpty());
1549 1549
1550 // Instantiate the function and create a shared function info from it. 1550 // Instantiate the function and create a shared function info from it.
1551 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); 1551 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction());
1552 const int literals = fun->NumberOfLiterals(); 1552 const int literals = fun->NumberOfLiterals();
1553 Handle<Code> code = Handle<Code>(fun->shared()->code()); 1553 Handle<Code> code = Handle<Code>(fun->shared()->code());
1554 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); 1554 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
1555 bool is_generator = false; 1555 bool is_generator = false;
1556 bool is_arrow = false;
1556 Handle<SharedFunctionInfo> shared = 1557 Handle<SharedFunctionInfo> shared =
1557 isolate()->factory()->NewSharedFunctionInfo( 1558 isolate()->factory()->NewSharedFunctionInfo(
1558 name, literals, is_generator, 1559 name, literals, is_generator, is_arrow,
1559 code, Handle<ScopeInfo>(fun->shared()->scope_info()), 1560 code, Handle<ScopeInfo>(fun->shared()->scope_info()),
1560 Handle<FixedArray>(fun->shared()->feedback_vector())); 1561 Handle<FixedArray>(fun->shared()->feedback_vector()));
1561 shared->set_construct_stub(*construct_stub); 1562 shared->set_construct_stub(*construct_stub);
1562 1563
1563 // Copy the function data to the shared function info. 1564 // Copy the function data to the shared function info.
1564 shared->set_function_data(fun->shared()->function_data()); 1565 shared->set_function_data(fun->shared()->function_data());
1565 int parameters = fun->shared()->formal_parameter_count(); 1566 int parameters = fun->shared()->formal_parameter_count();
1566 shared->set_formal_parameter_count(parameters); 1567 shared->set_formal_parameter_count(parameters);
1567 1568
1568 EmitNewClosure(shared, false); 1569 EmitNewClosure(shared, false);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 } 1698 }
1698 return true; 1699 return true;
1699 } 1700 }
1700 #endif // DEBUG 1701 #endif // DEBUG
1701 1702
1702 1703
1703 #undef __ 1704 #undef __
1704 1705
1705 1706
1706 } } // namespace v8::internal 1707 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/messages.js » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698