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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 builtins->set_builtins(*builtins); | 1057 builtins->set_builtins(*builtins); |
1058 builtins->set_global_context(*global_context()); | 1058 builtins->set_global_context(*global_context()); |
1059 builtins->set_global_receiver(*builtins); | 1059 builtins->set_global_receiver(*builtins); |
1060 | 1060 |
1061 // Setup the 'global' properties of the builtins object. The | 1061 // Setup the 'global' properties of the builtins object. The |
1062 // 'global' property that refers to the global object is the only | 1062 // 'global' property that refers to the global object is the only |
1063 // way to get from code running in the builtins context to the | 1063 // way to get from code running in the builtins context to the |
1064 // global object. | 1064 // global object. |
1065 static const PropertyAttributes attributes = | 1065 static const PropertyAttributes attributes = |
1066 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 1066 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
1067 SetProperty(builtins, Factory::LookupAsciiSymbol("global"), | 1067 Handle<String> global_symbol = Factory::LookupAsciiSymbol("global"); |
1068 Handle<Object>(global_context()->global()), attributes); | 1068 SetProperty(builtins, |
| 1069 global_symbol, |
| 1070 Handle<Object>(global_context()->global()), |
| 1071 attributes); |
1069 | 1072 |
1070 // Setup the reference from the global object to the builtins object. | 1073 // Setup the reference from the global object to the builtins object. |
1071 JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); | 1074 JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); |
1072 | 1075 |
1073 // Create a bridge function that has context in the global context. | 1076 // Create a bridge function that has context in the global context. |
1074 Handle<JSFunction> bridge = | 1077 Handle<JSFunction> bridge = |
1075 Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value()); | 1078 Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value()); |
1076 ASSERT(bridge->context() == *Top::global_context()); | 1079 ASSERT(bridge->context() == *Top::global_context()); |
1077 | 1080 |
1078 // Allocate the builtins context. | 1081 // Allocate the builtins context. |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 } | 1858 } |
1856 | 1859 |
1857 | 1860 |
1858 // Restore statics that are thread local. | 1861 // Restore statics that are thread local. |
1859 char* BootstrapperActive::RestoreState(char* from) { | 1862 char* BootstrapperActive::RestoreState(char* from) { |
1860 nesting_ = *reinterpret_cast<int*>(from); | 1863 nesting_ = *reinterpret_cast<int*>(from); |
1861 return from + sizeof(nesting_); | 1864 return from + sizeof(nesting_); |
1862 } | 1865 } |
1863 | 1866 |
1864 } } // namespace v8::internal | 1867 } } // namespace v8::internal |
OLD | NEW |