OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "factory.h" | 5 #include "factory.h" |
6 | 6 |
7 #include "isolate-inl.h" | 7 #include "isolate-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 | 1663 |
1664 Handle<JSFunction> Factory::NewFunctionWithoutPrototype( | 1664 Handle<JSFunction> Factory::NewFunctionWithoutPrototype( |
1665 Handle<String> name, | 1665 Handle<String> name, |
1666 StrictMode strict_mode) { | 1666 StrictMode strict_mode) { |
1667 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name, strict_mode); | 1667 Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name, strict_mode); |
1668 fun->set_context(isolate()->context()->native_context()); | 1668 fun->set_context(isolate()->context()->native_context()); |
1669 return fun; | 1669 return fun; |
1670 } | 1670 } |
1671 | 1671 |
1672 | 1672 |
1673 Handle<Object> Factory::ToObject(Handle<Object> object) { | |
1674 CALL_HEAP_FUNCTION(isolate(), object->ToObject(isolate()), Object); | |
1675 } | |
1676 | |
1677 | |
1678 Handle<Object> Factory::ToObject(Handle<Object> object, | |
1679 Handle<Context> native_context) { | |
1680 CALL_HEAP_FUNCTION(isolate(), object->ToObject(*native_context), Object); | |
1681 } | |
1682 | |
1683 | |
1684 #ifdef ENABLE_DEBUGGER_SUPPORT | 1673 #ifdef ENABLE_DEBUGGER_SUPPORT |
1685 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { | 1674 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { |
1686 // Get the original code of the function. | 1675 // Get the original code of the function. |
1687 Handle<Code> code(shared->code()); | 1676 Handle<Code> code(shared->code()); |
1688 | 1677 |
1689 // Create a copy of the code before allocating the debug info object to avoid | 1678 // Create a copy of the code before allocating the debug info object to avoid |
1690 // allocation while setting up the debug info object. | 1679 // allocation while setting up the debug info object. |
1691 Handle<Code> original_code(*Factory::CopyCode(code)); | 1680 Handle<Code> original_code(*Factory::CopyCode(code)); |
1692 | 1681 |
1693 // Allocate initial fixed array for active break points before allocating the | 1682 // Allocate initial fixed array for active break points before allocating the |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1990 if (String::Equals(name, infinity_string())) return infinity_value(); | 1979 if (String::Equals(name, infinity_string())) return infinity_value(); |
1991 return Handle<Object>::null(); | 1980 return Handle<Object>::null(); |
1992 } | 1981 } |
1993 | 1982 |
1994 | 1983 |
1995 Handle<Object> Factory::ToBoolean(bool value) { | 1984 Handle<Object> Factory::ToBoolean(bool value) { |
1996 return value ? true_value() : false_value(); | 1985 return value ? true_value() : false_value(); |
1997 } | 1986 } |
1998 | 1987 |
1999 } } // namespace v8::internal | 1988 } } // namespace v8::internal |
OLD | NEW |