OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void InitializeExperimentalGlobal(); | 194 void InitializeExperimentalGlobal(); |
195 // Installs the contents of the native .js files on the global objects. | 195 // Installs the contents of the native .js files on the global objects. |
196 // Used for creating a context from scratch. | 196 // Used for creating a context from scratch. |
197 void InstallNativeFunctions(); | 197 void InstallNativeFunctions(); |
198 void InstallExperimentalNativeFunctions(); | 198 void InstallExperimentalNativeFunctions(); |
199 Handle<JSFunction> InstallInternalArray(Handle<JSBuiltinsObject> builtins, | 199 Handle<JSFunction> InstallInternalArray(Handle<JSBuiltinsObject> builtins, |
200 const char* name, | 200 const char* name, |
201 ElementsKind elements_kind); | 201 ElementsKind elements_kind); |
202 bool InstallNatives(); | 202 bool InstallNatives(); |
203 | 203 |
204 void InstallTypedArray(const char* name); | 204 Handle<JSFunction> InstallTypedArray(const char* name); |
205 bool InstallExperimentalNatives(); | 205 bool InstallExperimentalNatives(); |
206 void InstallBuiltinFunctionIds(); | 206 void InstallBuiltinFunctionIds(); |
207 void InstallJSFunctionResultCaches(); | 207 void InstallJSFunctionResultCaches(); |
208 void InitializeNormalizedMapCaches(); | 208 void InitializeNormalizedMapCaches(); |
209 | 209 |
210 enum ExtensionTraversalState { | 210 enum ExtensionTraversalState { |
211 UNVISITED, VISITED, INSTALLED | 211 UNVISITED, VISITED, INSTALLED |
212 }; | 212 }; |
213 | 213 |
214 class ExtensionStates { | 214 class ExtensionStates { |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 // Initialize the random seed slot. | 1263 // Initialize the random seed slot. |
1264 Handle<ByteArray> zeroed_byte_array( | 1264 Handle<ByteArray> zeroed_byte_array( |
1265 factory->NewByteArray(kRandomStateSize)); | 1265 factory->NewByteArray(kRandomStateSize)); |
1266 native_context()->set_random_seed(*zeroed_byte_array); | 1266 native_context()->set_random_seed(*zeroed_byte_array); |
1267 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); | 1267 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); |
1268 } | 1268 } |
1269 return true; | 1269 return true; |
1270 } | 1270 } |
1271 | 1271 |
1272 | 1272 |
1273 void Genesis::InstallTypedArray(const char* name) { | 1273 Handle<JSFunction> Genesis::InstallTypedArray(const char* name) { |
1274 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); | 1274 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); |
1275 InstallFunction(global, name, JS_TYPED_ARRAY_TYPE, | 1275 return InstallFunction(global, name, JS_TYPED_ARRAY_TYPE, |
1276 JSTypedArray::kSize, isolate()->initial_object_prototype(), | 1276 JSTypedArray::kSize, isolate()->initial_object_prototype(), |
1277 Builtins::kIllegal, true); | 1277 Builtins::kIllegal, true); |
1278 } | 1278 } |
1279 | 1279 |
1280 | 1280 |
1281 void Genesis::InitializeExperimentalGlobal() { | 1281 void Genesis::InitializeExperimentalGlobal() { |
1282 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); | 1282 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); |
1283 | 1283 |
1284 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no | 1284 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no |
1285 // longer need to live behind flags, so functions get added to the snapshot. | 1285 // longer need to live behind flags, so functions get added to the snapshot. |
1286 | 1286 |
1287 if (FLAG_harmony_symbols) { | 1287 if (FLAG_harmony_symbols) { |
(...skipping 27 matching lines...) Expand all Loading... |
1315 { // -- A r r a y B u f f e r | 1315 { // -- A r r a y B u f f e r |
1316 Handle<JSFunction> array_buffer_fun = | 1316 Handle<JSFunction> array_buffer_fun = |
1317 InstallFunction(global, "__ArrayBuffer", JS_ARRAY_BUFFER_TYPE, | 1317 InstallFunction(global, "__ArrayBuffer", JS_ARRAY_BUFFER_TYPE, |
1318 JSArrayBuffer::kSize, | 1318 JSArrayBuffer::kSize, |
1319 isolate()->initial_object_prototype(), | 1319 isolate()->initial_object_prototype(), |
1320 Builtins::kIllegal, true); | 1320 Builtins::kIllegal, true); |
1321 native_context()->set_array_buffer_fun(*array_buffer_fun); | 1321 native_context()->set_array_buffer_fun(*array_buffer_fun); |
1322 } | 1322 } |
1323 { | 1323 { |
1324 // -- T y p e d A r r a y s | 1324 // -- T y p e d A r r a y s |
1325 InstallTypedArray("__Int8Array"); | 1325 native_context()->set_int8_array_fun( |
1326 InstallTypedArray("__Uint8Array"); | 1326 *InstallTypedArray("__Int8Array")); |
1327 InstallTypedArray("__Int16Array"); | 1327 native_context()->set_uint8_array_fun( |
1328 InstallTypedArray("__Uint16Array"); | 1328 *InstallTypedArray("__Uint8Array")); |
1329 InstallTypedArray("__Int32Array"); | 1329 native_context()->set_int16_array_fun( |
1330 InstallTypedArray("__Uint32Array"); | 1330 *InstallTypedArray("__Int16Array")); |
1331 InstallTypedArray("__Float32Array"); | 1331 native_context()->set_uint16_array_fun( |
1332 InstallTypedArray("__Float64Array"); | 1332 *InstallTypedArray("__Uint16Array")); |
| 1333 native_context()->set_int32_array_fun( |
| 1334 *InstallTypedArray("__Int32Array")); |
| 1335 native_context()->set_uint32_array_fun( |
| 1336 *InstallTypedArray("__Uint32Array")); |
| 1337 native_context()->set_float_array_fun( |
| 1338 *InstallTypedArray("__Float32Array")); |
| 1339 native_context()->set_double_array_fun( |
| 1340 *InstallTypedArray("__Float64Array")); |
1333 } | 1341 } |
1334 } | 1342 } |
1335 | 1343 |
1336 if (FLAG_harmony_generators) { | 1344 if (FLAG_harmony_generators) { |
1337 // Create generator meta-objects and install them on the builtins object. | 1345 // Create generator meta-objects and install them on the builtins object. |
1338 Handle<JSObject> builtins(native_context()->builtins()); | 1346 Handle<JSObject> builtins(native_context()->builtins()); |
1339 Handle<JSObject> generator_object_prototype = | 1347 Handle<JSObject> generator_object_prototype = |
1340 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1348 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1341 Handle<JSFunction> generator_function_prototype = | 1349 Handle<JSFunction> generator_function_prototype = |
1342 InstallFunction(builtins, "GeneratorFunctionPrototype", | 1350 InstallFunction(builtins, "GeneratorFunctionPrototype", |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2561 return from + sizeof(NestingCounterType); | 2569 return from + sizeof(NestingCounterType); |
2562 } | 2570 } |
2563 | 2571 |
2564 | 2572 |
2565 // Called when the top-level V8 mutex is destroyed. | 2573 // Called when the top-level V8 mutex is destroyed. |
2566 void Bootstrapper::FreeThreadResources() { | 2574 void Bootstrapper::FreeThreadResources() { |
2567 ASSERT(!IsActive()); | 2575 ASSERT(!IsActive()); |
2568 } | 2576 } |
2569 | 2577 |
2570 } } // namespace v8::internal | 2578 } } // namespace v8::internal |
OLD | NEW |