OLD | NEW |
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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 isolate()->heap()->ReinitializeJSReceiver( | 1535 isolate()->heap()->ReinitializeJSReceiver( |
1536 *object, JS_FUNCTION_TYPE, JSFunction::kSize)); | 1536 *object, JS_FUNCTION_TYPE, JSFunction::kSize)); |
1537 } | 1537 } |
1538 | 1538 |
1539 | 1539 |
1540 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 1540 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
1541 Handle<String> name, | 1541 Handle<String> name, |
1542 int number_of_literals, | 1542 int number_of_literals, |
1543 bool is_generator, | 1543 bool is_generator, |
1544 Handle<Code> code, | 1544 Handle<Code> code, |
1545 Handle<ScopeInfo> scope_info, | 1545 Handle<ScopeInfo> scope_info) { |
1546 Handle<FixedArray> feedback_vector) { | |
1547 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); | 1546 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); |
1548 shared->set_code(*code); | 1547 shared->set_code(*code); |
1549 shared->set_scope_info(*scope_info); | 1548 shared->set_scope_info(*scope_info); |
1550 shared->set_feedback_vector(*feedback_vector); | |
1551 int literals_array_size = number_of_literals; | 1549 int literals_array_size = number_of_literals; |
1552 // If the function contains object, regexp or array literals, | 1550 // If the function contains object, regexp or array literals, |
1553 // allocate extra space for a literals array prefix containing the | 1551 // allocate extra space for a literals array prefix containing the |
1554 // context. | 1552 // context. |
1555 if (number_of_literals > 0) { | 1553 if (number_of_literals > 0) { |
1556 literals_array_size += JSFunction::kLiteralsPrefixSize; | 1554 literals_array_size += JSFunction::kLiteralsPrefixSize; |
1557 } | 1555 } |
1558 shared->set_num_literals(literals_array_size); | 1556 shared->set_num_literals(literals_array_size); |
1559 if (is_generator) { | 1557 if (is_generator) { |
1560 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 1558 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1991 return Handle<Object>::null(); | 1989 return Handle<Object>::null(); |
1992 } | 1990 } |
1993 | 1991 |
1994 | 1992 |
1995 Handle<Object> Factory::ToBoolean(bool value) { | 1993 Handle<Object> Factory::ToBoolean(bool value) { |
1996 return value ? true_value() : false_value(); | 1994 return value ? true_value() : false_value(); |
1997 } | 1995 } |
1998 | 1996 |
1999 | 1997 |
2000 } } // namespace v8::internal | 1998 } } // namespace v8::internal |
OLD | NEW |