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

Unified Diff: src/factory.cc

Issue 382893003: Implement basic code generation for arrow functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test failures fixed, some minor corrections Created 6 years, 5 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/factory.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 4c142c604a88948273e612fc5bf7dd4e6cb3d5de..3a6c2e1da26ada573b89cf3465c13f626253f236 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1217,6 +1217,7 @@ void Factory::InitializeFunction(Handle<JSFunction> function,
function->set_prototype_or_initial_map(*the_hole_value());
function->set_literals_or_bindings(*empty_fixed_array());
function->set_next_function_link(*undefined_value());
+ if (info->is_arrow()) function->RemovePrototype();
}
@@ -1876,15 +1877,13 @@ Handle<FixedArray> Factory::NewTypeFeedbackVector(int slot_count) {
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
- Handle<String> name,
- int number_of_literals,
- bool is_generator,
- Handle<Code> code,
- Handle<ScopeInfo> scope_info,
+ Handle<String> name, int number_of_literals, bool is_generator,
+ bool is_arrow, Handle<Code> code, Handle<ScopeInfo> scope_info,
Handle<FixedArray> feedback_vector) {
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name, code);
shared->set_scope_info(*scope_info);
shared->set_feedback_vector(*feedback_vector);
+ shared->set_is_arrow(is_arrow);
int literals_array_size = number_of_literals;
// If the function contains object, regexp or array literals,
// allocate extra space for a literals array prefix containing the
« no previous file with comments | « src/factory.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698