OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 | 1673 |
1674 bool Genesis::InstallExperimentalNatives() { | 1674 bool Genesis::InstallExperimentalNatives() { |
1675 for (int i = ExperimentalNatives::GetDebuggerCount(); | 1675 for (int i = ExperimentalNatives::GetDebuggerCount(); |
1676 i < ExperimentalNatives::GetBuiltinsCount(); | 1676 i < ExperimentalNatives::GetBuiltinsCount(); |
1677 i++) { | 1677 i++) { |
1678 if (FLAG_harmony_proxies && | 1678 if (FLAG_harmony_proxies && |
1679 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 1679 strcmp(ExperimentalNatives::GetScriptName(i).start(), |
1680 "native proxy.js") == 0) { | 1680 "native proxy.js") == 0) { |
1681 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 1681 if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
1682 } | 1682 } |
| 1683 if (FLAG_harmony_weakmaps && |
| 1684 strcmp(ExperimentalNatives::GetScriptName(i).start(), |
| 1685 "native weakmap.js") == 0) { |
| 1686 if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
| 1687 } |
1683 } | 1688 } |
1684 | 1689 |
1685 InstallExperimentalNativeFunctions(); | 1690 InstallExperimentalNativeFunctions(); |
1686 | 1691 |
1687 return true; | 1692 return true; |
1688 } | 1693 } |
1689 | 1694 |
1690 | 1695 |
1691 static Handle<JSObject> ResolveBuiltinIdHolder( | 1696 static Handle<JSObject> ResolveBuiltinIdHolder( |
1692 Handle<Context> global_context, | 1697 Handle<Context> global_context, |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 InstallJSFunctionResultCaches(); | 2167 InstallJSFunctionResultCaches(); |
2163 InitializeNormalizedMapCaches(); | 2168 InitializeNormalizedMapCaches(); |
2164 if (!InstallNatives()) return; | 2169 if (!InstallNatives()) return; |
2165 | 2170 |
2166 MakeFunctionInstancePrototypeWritable(); | 2171 MakeFunctionInstancePrototypeWritable(); |
2167 | 2172 |
2168 if (!ConfigureGlobalObjects(global_template)) return; | 2173 if (!ConfigureGlobalObjects(global_template)) return; |
2169 isolate->counters()->contexts_created_from_scratch()->Increment(); | 2174 isolate->counters()->contexts_created_from_scratch()->Increment(); |
2170 } | 2175 } |
2171 | 2176 |
| 2177 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no |
| 2178 // longer need to live behind a flag, so WeakMap gets added to the snapshot. |
| 2179 Handle<JSObject> global = Handle<JSObject>(global_context()->global()); |
| 2180 if (FLAG_harmony_weakmaps) { // -- W e a k M a p |
| 2181 Handle<JSFunction> weakmap_fun = |
| 2182 InstallFunction(global, "WeakMap", JS_WEAKMAP_TYPE, JSWeakMap::kSize, |
| 2183 isolate->initial_object_prototype(), |
| 2184 Builtins::kIllegal, true); |
| 2185 //global_context()->set_weakmap_function(*weakmap_fun); |
| 2186 } |
| 2187 |
2172 // Install experimental natives. | 2188 // Install experimental natives. |
2173 if (!InstallExperimentalNatives()) return; | 2189 if (!InstallExperimentalNatives()) return; |
2174 | 2190 |
2175 result_ = global_context_; | 2191 result_ = global_context_; |
2176 } | 2192 } |
2177 | 2193 |
2178 | 2194 |
2179 // Support for thread preemption. | 2195 // Support for thread preemption. |
2180 | 2196 |
2181 // Reserve space for statics needing saving and restoring. | 2197 // Reserve space for statics needing saving and restoring. |
(...skipping 16 matching lines...) Expand all Loading... |
2198 return from + sizeof(NestingCounterType); | 2214 return from + sizeof(NestingCounterType); |
2199 } | 2215 } |
2200 | 2216 |
2201 | 2217 |
2202 // Called when the top-level V8 mutex is destroyed. | 2218 // Called when the top-level V8 mutex is destroyed. |
2203 void Bootstrapper::FreeThreadResources() { | 2219 void Bootstrapper::FreeThreadResources() { |
2204 ASSERT(!IsActive()); | 2220 ASSERT(!IsActive()); |
2205 } | 2221 } |
2206 | 2222 |
2207 } } // namespace v8::internal | 2223 } } // namespace v8::internal |
OLD | NEW |