OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 HandleScope scope; | 1798 HandleScope scope; |
1799 SaveContext saved_context; | 1799 SaveContext saved_context; |
1800 | 1800 |
1801 Handle<Context> new_context = Snapshot::NewContextFromSnapshot(); | 1801 Handle<Context> new_context = Snapshot::NewContextFromSnapshot(); |
1802 if (!new_context.is_null()) { | 1802 if (!new_context.is_null()) { |
1803 global_context_ = | 1803 global_context_ = |
1804 Handle<Context>::cast(GlobalHandles::Create(*new_context)); | 1804 Handle<Context>::cast(GlobalHandles::Create(*new_context)); |
1805 AddToWeakGlobalContextList(*global_context_); | 1805 AddToWeakGlobalContextList(*global_context_); |
1806 Top::set_context(*global_context_); | 1806 Top::set_context(*global_context_); |
1807 i::Counters::contexts_created_by_snapshot.Increment(); | 1807 i::Counters::contexts_created_by_snapshot.Increment(); |
1808 result_ = global_context_; | |
1809 JSFunction* empty_function = | 1808 JSFunction* empty_function = |
1810 JSFunction::cast(result_->function_map()->prototype()); | 1809 JSFunction::cast(global_context_->function_map()->prototype()); |
1811 empty_function_ = Handle<JSFunction>(empty_function); | 1810 empty_function_ = Handle<JSFunction>(empty_function); |
1812 Handle<GlobalObject> inner_global; | 1811 Handle<GlobalObject> inner_global; |
1813 Handle<JSGlobalProxy> global_proxy = | 1812 Handle<JSGlobalProxy> global_proxy = |
1814 CreateNewGlobals(global_template, | 1813 CreateNewGlobals(global_template, |
1815 global_object, | 1814 global_object, |
1816 &inner_global); | 1815 &inner_global); |
1817 | 1816 |
1818 HookUpGlobalProxy(inner_global, global_proxy); | 1817 HookUpGlobalProxy(inner_global, global_proxy); |
1819 HookUpInnerGlobal(inner_global); | 1818 HookUpInnerGlobal(inner_global); |
1820 | 1819 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 } | 1881 } |
1883 | 1882 |
1884 | 1883 |
1885 // Restore statics that are thread local. | 1884 // Restore statics that are thread local. |
1886 char* BootstrapperActive::RestoreState(char* from) { | 1885 char* BootstrapperActive::RestoreState(char* from) { |
1887 nesting_ = *reinterpret_cast<int*>(from); | 1886 nesting_ = *reinterpret_cast<int*>(from); |
1888 return from + sizeof(nesting_); | 1887 return from + sizeof(nesting_); |
1889 } | 1888 } |
1890 | 1889 |
1891 } } // namespace v8::internal | 1890 } } // namespace v8::internal |
OLD | NEW |