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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1273 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); | 1273 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); |
1274 } | 1274 } |
1275 return true; | 1275 return true; |
1276 } | 1276 } |
1277 | 1277 |
1278 | 1278 |
1279 void Genesis::InitializeExperimentalGlobal() { | 1279 void Genesis::InitializeExperimentalGlobal() { |
1280 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); | 1280 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); |
1281 | 1281 |
1282 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no | 1282 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no |
1283 // longer need to live behind a flag, so functions get added to the snapshot. | 1283 // longer need to live behind flags, so functions get added to the snapshot. |
1284 | |
1285 if (FLAG_harmony_symbols) { | |
1286 // --- S y m b o l --- | |
1287 Handle<JSObject> prototype = | |
1288 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
Michael Starzinger
2013/03/22 11:39:04
This creates a new object for the prototype of the
rossberg
2013/03/22 12:37:44
Done.
| |
1289 Handle<JSFunction> symbol_fun = | |
1290 InstallFunction(global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, | |
1291 prototype, Builtins::kIllegal, true); | |
1292 native_context()->set_symbol_function(*symbol_fun); | |
1293 } | |
1294 | |
1284 if (FLAG_harmony_collections) { | 1295 if (FLAG_harmony_collections) { |
1285 { // -- S e t | 1296 { // -- S e t |
1286 Handle<JSObject> prototype = | 1297 Handle<JSObject> prototype = |
1287 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1298 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1288 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, | 1299 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, |
1289 prototype, Builtins::kIllegal, true); | 1300 prototype, Builtins::kIllegal, true); |
1290 } | 1301 } |
1291 { // -- M a p | 1302 { // -- M a p |
1292 Handle<JSObject> prototype = | 1303 Handle<JSObject> prototype = |
1293 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1304 factory()->NewJSObject(isolate()->object_function(), TENURED); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1429 INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun); | 1440 INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun); |
1430 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", | 1441 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", |
1431 configure_instance_fun); | 1442 configure_instance_fun); |
1432 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); | 1443 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); |
1433 INSTALL_NATIVE(JSObject, "functionCache", function_cache); | 1444 INSTALL_NATIVE(JSObject, "functionCache", function_cache); |
1434 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", | 1445 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", |
1435 to_complete_property_descriptor); | 1446 to_complete_property_descriptor); |
1436 } | 1447 } |
1437 | 1448 |
1438 void Genesis::InstallExperimentalNativeFunctions() { | 1449 void Genesis::InstallExperimentalNativeFunctions() { |
1439 if (FLAG_harmony_symbols) { | |
1440 INSTALL_NATIVE(JSObject, "SymbolDelegate", symbol_delegate); | |
1441 } | |
1442 if (FLAG_harmony_proxies) { | 1450 if (FLAG_harmony_proxies) { |
1443 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); | 1451 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); |
1444 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); | 1452 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); |
1445 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); | 1453 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); |
1446 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); | 1454 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); |
1447 } | 1455 } |
1448 if (FLAG_harmony_observation) { | 1456 if (FLAG_harmony_observation) { |
1449 INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change); | 1457 INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change); |
1450 INSTALL_NATIVE(JSFunction, "DeliverChangeRecords", | 1458 INSTALL_NATIVE(JSFunction, "DeliverChangeRecords", |
1451 observers_deliver_changes); | 1459 observers_deliver_changes); |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2488 return from + sizeof(NestingCounterType); | 2496 return from + sizeof(NestingCounterType); |
2489 } | 2497 } |
2490 | 2498 |
2491 | 2499 |
2492 // Called when the top-level V8 mutex is destroyed. | 2500 // Called when the top-level V8 mutex is destroyed. |
2493 void Bootstrapper::FreeThreadResources() { | 2501 void Bootstrapper::FreeThreadResources() { |
2494 ASSERT(!IsActive()); | 2502 ASSERT(!IsActive()); |
2495 } | 2503 } |
2496 | 2504 |
2497 } } // namespace v8::internal | 2505 } } // namespace v8::internal |
OLD | NEW |