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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 } | 1241 } |
1242 | 1242 |
1243 JSFunction::SetPrototype(function, prototype); | 1243 JSFunction::SetPrototype(function, prototype); |
1244 return function; | 1244 return function; |
1245 } | 1245 } |
1246 | 1246 |
1247 | 1247 |
1248 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, | 1248 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, |
1249 Handle<Code> code) { | 1249 Handle<Code> code) { |
1250 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, | 1250 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, |
1251 CLASSIC_MODE); | 1251 SLOPPY_MODE); |
1252 function->shared()->set_code(*code); | 1252 function->shared()->set_code(*code); |
1253 function->set_code(*code); | 1253 function->set_code(*code); |
1254 ASSERT(!function->has_initial_map()); | 1254 ASSERT(!function->has_initial_map()); |
1255 ASSERT(!function->has_prototype()); | 1255 ASSERT(!function->has_prototype()); |
1256 return function; | 1256 return function; |
1257 } | 1257 } |
1258 | 1258 |
1259 | 1259 |
1260 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { | 1260 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { |
1261 CALL_HEAP_FUNCTION( | 1261 CALL_HEAP_FUNCTION( |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 Handle<JSFunction> fun = NewFunctionHelper(name, prototype); | 1634 Handle<JSFunction> fun = NewFunctionHelper(name, prototype); |
1635 fun->set_context(isolate()->context()->native_context()); | 1635 fun->set_context(isolate()->context()->native_context()); |
1636 return fun; | 1636 return fun; |
1637 } | 1637 } |
1638 | 1638 |
1639 | 1639 |
1640 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper( | 1640 Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper( |
1641 Handle<String> name, | 1641 Handle<String> name, |
1642 LanguageMode language_mode) { | 1642 LanguageMode language_mode) { |
1643 Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name); | 1643 Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name); |
1644 Handle<Map> map = (language_mode == CLASSIC_MODE) | 1644 Handle<Map> map = (language_mode == SLOPPY_MODE) |
1645 ? isolate()->function_without_prototype_map() | 1645 ? isolate()->function_without_prototype_map() |
1646 : isolate()->strict_mode_function_without_prototype_map(); | 1646 : isolate()->strict_mode_function_without_prototype_map(); |
1647 CALL_HEAP_FUNCTION(isolate(), | 1647 CALL_HEAP_FUNCTION(isolate(), |
1648 isolate()->heap()->AllocateFunction( | 1648 isolate()->heap()->AllocateFunction( |
1649 *map, | 1649 *map, |
1650 *function_share, | 1650 *function_share, |
1651 *the_hole_value()), | 1651 *the_hole_value()), |
1652 JSFunction); | 1652 JSFunction); |
1653 } | 1653 } |
1654 | 1654 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 return Handle<Object>::null(); | 1988 return Handle<Object>::null(); |
1989 } | 1989 } |
1990 | 1990 |
1991 | 1991 |
1992 Handle<Object> Factory::ToBoolean(bool value) { | 1992 Handle<Object> Factory::ToBoolean(bool value) { |
1993 return value ? true_value() : false_value(); | 1993 return value ? true_value() : false_value(); |
1994 } | 1994 } |
1995 | 1995 |
1996 | 1996 |
1997 } } // namespace v8::internal | 1997 } } // namespace v8::internal |
OLD | NEW |