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

Unified Diff: src/factory.cc

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
« src/ast.h ('K') | « src/factory.h ('k') | src/flag-definitions.h » ('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 5ecdfcfd2f4aec25c94ab22927b53363715b3b59..54917473925c6942ea464b83fac986d9512067b0 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1231,6 +1231,9 @@ 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());
+
+ // TODO(arv): This does not look correct. We need to make sure we use
+ // a Map that has no prototype property.
if (info->is_arrow()) function->RemovePrototype();
}
@@ -1350,8 +1353,8 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> info,
Handle<Context> context,
PretenureFlag pretenure) {
- int map_index = Context::FunctionMapIndex(info->strict_mode(),
- info->is_generator());
+ int map_index = Context::FunctionMapIndex(
+ info->strict_mode(), info->is_generator(), info->is_concise_method());
Handle<Map> map(Map::cast(context->native_context()->get(map_index)));
Handle<JSFunction> result = NewFunction(map, info, context, pretenure);
@@ -1893,12 +1896,13 @@ Handle<FixedArray> Factory::NewTypeFeedbackVector(int slot_count) {
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name, int number_of_literals, bool is_generator,
- bool is_arrow, Handle<Code> code, Handle<ScopeInfo> scope_info,
- Handle<FixedArray> feedback_vector) {
+ bool is_arrow, bool is_concise_method, 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);
+ shared->set_is_concise_method(is_concise_method);
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
« src/ast.h ('K') | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698