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

Side by Side Diff: src/factory.cc

Issue 160073006: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement handling of arrow functions in the parser Created 6 years, 9 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 isolate(), 1579 isolate(),
1580 isolate()->heap()->ReinitializeJSReceiver( 1580 isolate()->heap()->ReinitializeJSReceiver(
1581 *object, JS_FUNCTION_TYPE, JSFunction::kSize)); 1581 *object, JS_FUNCTION_TYPE, JSFunction::kSize));
1582 } 1582 }
1583 1583
1584 1584
1585 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( 1585 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
1586 Handle<String> name, 1586 Handle<String> name,
1587 int number_of_literals, 1587 int number_of_literals,
1588 bool is_generator, 1588 bool is_generator,
1589 bool is_arrow,
1589 Handle<Code> code, 1590 Handle<Code> code,
1590 Handle<ScopeInfo> scope_info) { 1591 Handle<ScopeInfo> scope_info) {
1591 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); 1592 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name);
1592 shared->set_code(*code); 1593 shared->set_code(*code);
1593 shared->set_scope_info(*scope_info); 1594 shared->set_scope_info(*scope_info);
1595 shared->set_is_arrow(is_arrow);
1594 int literals_array_size = number_of_literals; 1596 int literals_array_size = number_of_literals;
1595 // If the function contains object, regexp or array literals, 1597 // If the function contains object, regexp or array literals,
1596 // allocate extra space for a literals array prefix containing the 1598 // allocate extra space for a literals array prefix containing the
1597 // context. 1599 // context.
1598 if (number_of_literals > 0) { 1600 if (number_of_literals > 0) {
1599 literals_array_size += JSFunction::kLiteralsPrefixSize; 1601 literals_array_size += JSFunction::kLiteralsPrefixSize;
1600 } 1602 }
1601 shared->set_num_literals(literals_array_size); 1603 shared->set_num_literals(literals_array_size);
1602 if (is_generator) { 1604 if (is_generator) {
1603 shared->set_instance_class_name(isolate()->heap()->Generator_string()); 1605 shared->set_instance_class_name(isolate()->heap()->Generator_string());
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 return Handle<Object>::null(); 2036 return Handle<Object>::null();
2035 } 2037 }
2036 2038
2037 2039
2038 Handle<Object> Factory::ToBoolean(bool value) { 2040 Handle<Object> Factory::ToBoolean(bool value) {
2039 return value ? true_value() : false_value(); 2041 return value ? true_value() : false_value();
2040 } 2042 }
2041 2043
2042 2044
2043 } } // namespace v8::internal 2045 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698