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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 new_to_map->set_prototype(*proto); | 323 new_to_map->set_prototype(*proto); |
324 object->set_map(*new_to_map); | 324 object->set_map(*new_to_map); |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 void Bootstrapper::DetachGlobal(Handle<Context> env) { | 328 void Bootstrapper::DetachGlobal(Handle<Context> env) { |
329 Factory* factory = env->GetIsolate()->factory(); | 329 Factory* factory = env->GetIsolate()->factory(); |
330 JSGlobalProxy::cast(env->global_proxy())->set_context(*factory->null_value()); | 330 JSGlobalProxy::cast(env->global_proxy())->set_context(*factory->null_value()); |
331 SetObjectPrototype(Handle<JSObject>(env->global_proxy()), | 331 SetObjectPrototype(Handle<JSObject>(env->global_proxy()), |
332 factory->null_value()); | 332 factory->null_value()); |
333 env->set_global_proxy(env->global()); | 333 env->set_global_proxy(env->global_object()); |
334 env->global()->set_global_receiver(env->global()); | 334 env->global_object()->set_global_receiver(env->global_object()); |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 void Bootstrapper::ReattachGlobal(Handle<Context> env, | 338 void Bootstrapper::ReattachGlobal(Handle<Context> env, |
339 Handle<Object> global_object) { | 339 Handle<Object> global_object) { |
340 ASSERT(global_object->IsJSGlobalProxy()); | 340 ASSERT(global_object->IsJSGlobalProxy()); |
341 Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object); | 341 Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object); |
342 env->global()->set_global_receiver(*global); | 342 env->global_object()->set_global_receiver(*global); |
343 env->set_global_proxy(*global); | 343 env->set_global_proxy(*global); |
344 SetObjectPrototype(global, Handle<JSObject>(env->global())); | 344 SetObjectPrototype(global, Handle<JSObject>(env->global_object())); |
345 global->set_context(*env); | 345 global->set_context(*env); |
346 } | 346 } |
347 | 347 |
348 | 348 |
349 static Handle<JSFunction> InstallFunction(Handle<JSObject> target, | 349 static Handle<JSFunction> InstallFunction(Handle<JSObject> target, |
350 const char* name, | 350 const char* name, |
351 InstanceType type, | 351 InstanceType type, |
352 int instance_size, | 352 int instance_size, |
353 Handle<JSObject> prototype, | 353 Handle<JSObject> prototype, |
354 Builtins::Name call, | 354 Builtins::Name call, |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 global_proxy->set_context(*native_context()); | 800 global_proxy->set_context(*native_context()); |
801 native_context()->set_global_proxy(*global_proxy); | 801 native_context()->set_global_proxy(*global_proxy); |
802 } | 802 } |
803 | 803 |
804 | 804 |
805 void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) { | 805 void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) { |
806 Handle<GlobalObject> inner_global_from_snapshot( | 806 Handle<GlobalObject> inner_global_from_snapshot( |
807 GlobalObject::cast(native_context_->extension())); | 807 GlobalObject::cast(native_context_->extension())); |
808 Handle<JSBuiltinsObject> builtins_global(native_context_->builtins()); | 808 Handle<JSBuiltinsObject> builtins_global(native_context_->builtins()); |
809 native_context_->set_extension(*inner_global); | 809 native_context_->set_extension(*inner_global); |
810 native_context_->set_global(*inner_global); | 810 native_context_->set_global_object(*inner_global); |
811 native_context_->set_security_token(*inner_global); | 811 native_context_->set_security_token(*inner_global); |
812 static const PropertyAttributes attributes = | 812 static const PropertyAttributes attributes = |
813 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 813 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
814 ForceSetProperty(builtins_global, | 814 ForceSetProperty(builtins_global, |
815 factory()->LookupAsciiSymbol("global"), | 815 factory()->LookupAsciiSymbol("global"), |
816 inner_global, | 816 inner_global, |
817 attributes); | 817 attributes); |
818 // Set up the reference from the global object to the builtins object. | 818 // Set up the reference from the global object to the builtins object. |
819 JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global); | 819 JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global); |
820 TransferNamedProperties(inner_global_from_snapshot, inner_global); | 820 TransferNamedProperties(inner_global_from_snapshot, inner_global); |
821 TransferIndexedProperties(inner_global_from_snapshot, inner_global); | 821 TransferIndexedProperties(inner_global_from_snapshot, inner_global); |
822 } | 822 } |
823 | 823 |
824 | 824 |
825 // This is only called if we are not using snapshots. The equivalent | 825 // This is only called if we are not using snapshots. The equivalent |
826 // work in the snapshot case is done in HookUpInnerGlobal. | 826 // work in the snapshot case is done in HookUpInnerGlobal. |
827 bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, | 827 bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
828 Handle<JSFunction> empty_function) { | 828 Handle<JSFunction> empty_function) { |
829 // --- G l o b a l C o n t e x t --- | 829 // --- G l o b a l C o n t e x t --- |
830 // Use the empty function as closure (no scope info). | 830 // Use the empty function as closure (no scope info). |
831 native_context()->set_closure(*empty_function); | 831 native_context()->set_closure(*empty_function); |
832 native_context()->set_previous(NULL); | 832 native_context()->set_previous(NULL); |
833 // Set extension and global object. | 833 // Set extension and global object. |
834 native_context()->set_extension(*inner_global); | 834 native_context()->set_extension(*inner_global); |
835 native_context()->set_global(*inner_global); | 835 native_context()->set_global_object(*inner_global); |
836 // Security setup: Set the security token of the global object to | 836 // Security setup: Set the security token of the global object to |
837 // its the inner global. This makes the security check between two | 837 // its the inner global. This makes the security check between two |
838 // different contexts fail by default even in case of global | 838 // different contexts fail by default even in case of global |
839 // object reinitialization. | 839 // object reinitialization. |
840 native_context()->set_security_token(*inner_global); | 840 native_context()->set_security_token(*inner_global); |
841 | 841 |
842 Isolate* isolate = inner_global->GetIsolate(); | 842 Isolate* isolate = inner_global->GetIsolate(); |
843 Factory* factory = isolate->factory(); | 843 Factory* factory = isolate->factory(); |
844 Heap* heap = isolate->heap(); | 844 Heap* heap = isolate->heap(); |
845 | 845 |
846 Handle<String> object_name = Handle<String>(heap->Object_symbol()); | 846 Handle<String> object_name = Handle<String>(heap->Object_symbol()); |
847 CHECK_NOT_EMPTY_HANDLE(isolate, | 847 CHECK_NOT_EMPTY_HANDLE(isolate, |
848 JSObject::SetLocalPropertyIgnoreAttributes( | 848 JSObject::SetLocalPropertyIgnoreAttributes( |
849 inner_global, object_name, | 849 inner_global, object_name, |
850 isolate->object_function(), DONT_ENUM)); | 850 isolate->object_function(), DONT_ENUM)); |
851 | 851 |
852 Handle<JSObject> global = Handle<JSObject>(native_context()->global()); | 852 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); |
853 | 853 |
854 // Install global Function object | 854 // Install global Function object |
855 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, | 855 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, |
856 empty_function, Builtins::kIllegal, true); // ECMA native. | 856 empty_function, Builtins::kIllegal, true); // ECMA native. |
857 | 857 |
858 { // --- A r r a y --- | 858 { // --- A r r a y --- |
859 Handle<JSFunction> array_function = | 859 Handle<JSFunction> array_function = |
860 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, | 860 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, |
861 isolate->initial_object_prototype(), | 861 isolate->initial_object_prototype(), |
862 Builtins::kArrayCode, true); | 862 Builtins::kArrayCode, true); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 Handle<ByteArray> zeroed_byte_array( | 1247 Handle<ByteArray> zeroed_byte_array( |
1248 factory->NewByteArray(kRandomStateSize)); | 1248 factory->NewByteArray(kRandomStateSize)); |
1249 native_context()->set_random_seed(*zeroed_byte_array); | 1249 native_context()->set_random_seed(*zeroed_byte_array); |
1250 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); | 1250 memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); |
1251 } | 1251 } |
1252 return true; | 1252 return true; |
1253 } | 1253 } |
1254 | 1254 |
1255 | 1255 |
1256 void Genesis::InitializeExperimentalGlobal() { | 1256 void Genesis::InitializeExperimentalGlobal() { |
1257 Handle<JSObject> global = Handle<JSObject>(native_context()->global()); | 1257 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); |
1258 | 1258 |
1259 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no | 1259 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no |
1260 // longer need to live behind a flag, so functions get added to the snapshot. | 1260 // longer need to live behind a flag, so functions get added to the snapshot. |
1261 if (FLAG_harmony_collections) { | 1261 if (FLAG_harmony_collections) { |
1262 { // -- S e t | 1262 { // -- S e t |
1263 Handle<JSObject> prototype = | 1263 Handle<JSObject> prototype = |
1264 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1264 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1265 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, | 1265 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, |
1266 prototype, Builtins::kIllegal, true); | 1266 prototype, Builtins::kIllegal, true); |
1267 } | 1267 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 ? Handle<Context>(top_context->runtime_context()) | 1363 ? Handle<Context>(top_context->runtime_context()) |
1364 : top_context); | 1364 : top_context); |
1365 Handle<JSFunction> fun = | 1365 Handle<JSFunction> fun = |
1366 factory->NewFunctionFromSharedFunctionInfo(function_info, context); | 1366 factory->NewFunctionFromSharedFunctionInfo(function_info, context); |
1367 | 1367 |
1368 // Call function using either the runtime object or the global | 1368 // Call function using either the runtime object or the global |
1369 // object as the receiver. Provide no parameters. | 1369 // object as the receiver. Provide no parameters. |
1370 Handle<Object> receiver = | 1370 Handle<Object> receiver = |
1371 Handle<Object>(use_runtime_context | 1371 Handle<Object>(use_runtime_context |
1372 ? top_context->builtins() | 1372 ? top_context->builtins() |
1373 : top_context->global()); | 1373 : top_context->global_object()); |
1374 bool has_pending_exception; | 1374 bool has_pending_exception; |
1375 Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); | 1375 Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); |
1376 if (has_pending_exception) return false; | 1376 if (has_pending_exception) return false; |
1377 return true; | 1377 return true; |
1378 } | 1378 } |
1379 | 1379 |
1380 | 1380 |
1381 #define INSTALL_NATIVE(Type, name, var) \ | 1381 #define INSTALL_NATIVE(Type, name, var) \ |
1382 Handle<String> var##_name = factory()->LookupAsciiSymbol(name); \ | 1382 Handle<String> var##_name = factory()->LookupAsciiSymbol(name); \ |
1383 Object* var##_native = \ | 1383 Object* var##_native = \ |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 builtins->set_native_context(*native_context()); | 1443 builtins->set_native_context(*native_context()); |
1444 builtins->set_global_receiver(*builtins); | 1444 builtins->set_global_receiver(*builtins); |
1445 | 1445 |
1446 // Set up the 'global' properties of the builtins object. The | 1446 // Set up the 'global' properties of the builtins object. The |
1447 // 'global' property that refers to the global object is the only | 1447 // 'global' property that refers to the global object is the only |
1448 // way to get from code running in the builtins context to the | 1448 // way to get from code running in the builtins context to the |
1449 // global object. | 1449 // global object. |
1450 static const PropertyAttributes attributes = | 1450 static const PropertyAttributes attributes = |
1451 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 1451 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
1452 Handle<String> global_symbol = factory()->LookupAsciiSymbol("global"); | 1452 Handle<String> global_symbol = factory()->LookupAsciiSymbol("global"); |
1453 Handle<Object> global_obj(native_context()->global()); | 1453 Handle<Object> global_obj(native_context()->global_object()); |
1454 CHECK_NOT_EMPTY_HANDLE(isolate(), | 1454 CHECK_NOT_EMPTY_HANDLE(isolate(), |
1455 JSObject::SetLocalPropertyIgnoreAttributes( | 1455 JSObject::SetLocalPropertyIgnoreAttributes( |
1456 builtins, global_symbol, global_obj, attributes)); | 1456 builtins, global_symbol, global_obj, attributes)); |
1457 | 1457 |
1458 // Set up the reference from the global object to the builtins object. | 1458 // Set up the reference from the global object to the builtins object. |
1459 JSGlobalObject::cast(native_context()->global())->set_builtins(*builtins); | 1459 JSGlobalObject::cast(native_context()->global_object())-> |
| 1460 set_builtins(*builtins); |
1460 | 1461 |
1461 // Create a bridge function that has context in the native context. | 1462 // Create a bridge function that has context in the native context. |
1462 Handle<JSFunction> bridge = | 1463 Handle<JSFunction> bridge = |
1463 factory()->NewFunction(factory()->empty_symbol(), | 1464 factory()->NewFunction(factory()->empty_symbol(), |
1464 factory()->undefined_value()); | 1465 factory()->undefined_value()); |
1465 ASSERT(bridge->context() == *isolate()->native_context()); | 1466 ASSERT(bridge->context() == *isolate()->native_context()); |
1466 | 1467 |
1467 // Allocate the builtins context. | 1468 // Allocate the builtins context. |
1468 Handle<Context> context = | 1469 Handle<Context> context = |
1469 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge); | 1470 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge); |
1470 context->set_global(*builtins); // override builtins global object | 1471 context->set_global_object(*builtins); // override builtins global object |
1471 | 1472 |
1472 native_context()->set_runtime_context(*context); | 1473 native_context()->set_runtime_context(*context); |
1473 | 1474 |
1474 { // -- S c r i p t | 1475 { // -- S c r i p t |
1475 // Builtin functions for Script. | 1476 // Builtin functions for Script. |
1476 Handle<JSFunction> script_fun = | 1477 Handle<JSFunction> script_fun = |
1477 InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, | 1478 InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, |
1478 isolate()->initial_object_prototype(), | 1479 isolate()->initial_object_prototype(), |
1479 Builtins::kIllegal, false); | 1480 Builtins::kIllegal, false); |
1480 Handle<JSObject> prototype = | 1481 Handle<JSObject> prototype = |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 // and the String function has been set up. | 1704 // and the String function has been set up. |
1704 Handle<JSFunction> string_function(native_context()->string_function()); | 1705 Handle<JSFunction> string_function(native_context()->string_function()); |
1705 ASSERT(JSObject::cast( | 1706 ASSERT(JSObject::cast( |
1706 string_function->initial_map()->prototype())->HasFastProperties()); | 1707 string_function->initial_map()->prototype())->HasFastProperties()); |
1707 native_context()->set_string_function_prototype_map( | 1708 native_context()->set_string_function_prototype_map( |
1708 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 1709 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
1709 | 1710 |
1710 // Install Function.prototype.call and apply. | 1711 // Install Function.prototype.call and apply. |
1711 { Handle<String> key = factory()->function_class_symbol(); | 1712 { Handle<String> key = factory()->function_class_symbol(); |
1712 Handle<JSFunction> function = | 1713 Handle<JSFunction> function = |
1713 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); | 1714 Handle<JSFunction>::cast(GetProperty(isolate()->global_object(), key)); |
1714 Handle<JSObject> proto = | 1715 Handle<JSObject> proto = |
1715 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1716 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
1716 | 1717 |
1717 // Install the call and the apply functions. | 1718 // Install the call and the apply functions. |
1718 Handle<JSFunction> call = | 1719 Handle<JSFunction> call = |
1719 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1720 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
1720 Handle<JSObject>::null(), | 1721 Handle<JSObject>::null(), |
1721 Builtins::kFunctionCall, | 1722 Builtins::kFunctionCall, |
1722 false); | 1723 false); |
1723 Handle<JSFunction> apply = | 1724 Handle<JSFunction> apply = |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 InstallExperimentalNativeFunctions(); | 1828 InstallExperimentalNativeFunctions(); |
1828 | 1829 |
1829 return true; | 1830 return true; |
1830 } | 1831 } |
1831 | 1832 |
1832 | 1833 |
1833 static Handle<JSObject> ResolveBuiltinIdHolder( | 1834 static Handle<JSObject> ResolveBuiltinIdHolder( |
1834 Handle<Context> native_context, | 1835 Handle<Context> native_context, |
1835 const char* holder_expr) { | 1836 const char* holder_expr) { |
1836 Factory* factory = native_context->GetIsolate()->factory(); | 1837 Factory* factory = native_context->GetIsolate()->factory(); |
1837 Handle<GlobalObject> global(native_context->global()); | 1838 Handle<GlobalObject> global(native_context->global_object()); |
1838 const char* period_pos = strchr(holder_expr, '.'); | 1839 const char* period_pos = strchr(holder_expr, '.'); |
1839 if (period_pos == NULL) { | 1840 if (period_pos == NULL) { |
1840 return Handle<JSObject>::cast( | 1841 return Handle<JSObject>::cast( |
1841 GetProperty(global, factory->LookupAsciiSymbol(holder_expr))); | 1842 GetProperty(global, factory->LookupAsciiSymbol(holder_expr))); |
1842 } | 1843 } |
1843 ASSERT_EQ(".prototype", period_pos); | 1844 ASSERT_EQ(".prototype", period_pos); |
1844 Vector<const char> property(holder_expr, | 1845 Vector<const char> property(holder_expr, |
1845 static_cast<int>(period_pos - holder_expr)); | 1846 static_cast<int>(period_pos - holder_expr)); |
1846 Handle<JSFunction> function = Handle<JSFunction>::cast( | 1847 Handle<JSFunction> function = Handle<JSFunction>::cast( |
1847 GetProperty(global, factory->LookupSymbol(property))); | 1848 GetProperty(global, factory->LookupSymbol(property))); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 if (!Genesis::InstallExtensions(native_context, extensions)) return false; | 1934 if (!Genesis::InstallExtensions(native_context, extensions)) return false; |
1934 Genesis::InstallSpecialObjects(native_context); | 1935 Genesis::InstallSpecialObjects(native_context); |
1935 return true; | 1936 return true; |
1936 } | 1937 } |
1937 | 1938 |
1938 | 1939 |
1939 void Genesis::InstallSpecialObjects(Handle<Context> native_context) { | 1940 void Genesis::InstallSpecialObjects(Handle<Context> native_context) { |
1940 Isolate* isolate = native_context->GetIsolate(); | 1941 Isolate* isolate = native_context->GetIsolate(); |
1941 Factory* factory = isolate->factory(); | 1942 Factory* factory = isolate->factory(); |
1942 HandleScope scope; | 1943 HandleScope scope; |
1943 Handle<JSGlobalObject> global(JSGlobalObject::cast(native_context->global())); | 1944 Handle<JSGlobalObject> global(JSGlobalObject::cast( |
| 1945 native_context->global_object())); |
1944 // Expose the natives in global if a name for it is specified. | 1946 // Expose the natives in global if a name for it is specified. |
1945 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { | 1947 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { |
1946 Handle<String> natives = factory->LookupAsciiSymbol(FLAG_expose_natives_as); | 1948 Handle<String> natives = factory->LookupAsciiSymbol(FLAG_expose_natives_as); |
1947 CHECK_NOT_EMPTY_HANDLE(isolate, | 1949 CHECK_NOT_EMPTY_HANDLE(isolate, |
1948 JSObject::SetLocalPropertyIgnoreAttributes( | 1950 JSObject::SetLocalPropertyIgnoreAttributes( |
1949 global, natives, | 1951 global, natives, |
1950 Handle<JSObject>(global->builtins()), | 1952 Handle<JSObject>(global->builtins()), |
1951 DONT_ENUM)); | 1953 DONT_ENUM)); |
1952 } | 1954 } |
1953 | 1955 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 builtins->set_javascript_builtin_code(id, function->shared()->code()); | 2132 builtins->set_javascript_builtin_code(id, function->shared()->code()); |
2131 } | 2133 } |
2132 return true; | 2134 return true; |
2133 } | 2135 } |
2134 | 2136 |
2135 | 2137 |
2136 bool Genesis::ConfigureGlobalObjects( | 2138 bool Genesis::ConfigureGlobalObjects( |
2137 v8::Handle<v8::ObjectTemplate> global_proxy_template) { | 2139 v8::Handle<v8::ObjectTemplate> global_proxy_template) { |
2138 Handle<JSObject> global_proxy( | 2140 Handle<JSObject> global_proxy( |
2139 JSObject::cast(native_context()->global_proxy())); | 2141 JSObject::cast(native_context()->global_proxy())); |
2140 Handle<JSObject> inner_global(JSObject::cast(native_context()->global())); | 2142 Handle<JSObject> inner_global( |
| 2143 JSObject::cast(native_context()->global_object())); |
2141 | 2144 |
2142 if (!global_proxy_template.IsEmpty()) { | 2145 if (!global_proxy_template.IsEmpty()) { |
2143 // Configure the global proxy object. | 2146 // Configure the global proxy object. |
2144 Handle<ObjectTemplateInfo> proxy_data = | 2147 Handle<ObjectTemplateInfo> proxy_data = |
2145 v8::Utils::OpenHandle(*global_proxy_template); | 2148 v8::Utils::OpenHandle(*global_proxy_template); |
2146 if (!ConfigureApiObject(global_proxy, proxy_data)) return false; | 2149 if (!ConfigureApiObject(global_proxy, proxy_data)) return false; |
2147 | 2150 |
2148 // Configure the inner global object. | 2151 // Configure the inner global object. |
2149 Handle<FunctionTemplateInfo> proxy_constructor( | 2152 Handle<FunctionTemplateInfo> proxy_constructor( |
2150 FunctionTemplateInfo::cast(proxy_data->constructor())); | 2153 FunctionTemplateInfo::cast(proxy_data->constructor())); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 return from + sizeof(NestingCounterType); | 2393 return from + sizeof(NestingCounterType); |
2391 } | 2394 } |
2392 | 2395 |
2393 | 2396 |
2394 // Called when the top-level V8 mutex is destroyed. | 2397 // Called when the top-level V8 mutex is destroyed. |
2395 void Bootstrapper::FreeThreadResources() { | 2398 void Bootstrapper::FreeThreadResources() { |
2396 ASSERT(!IsActive()); | 2399 ASSERT(!IsActive()); |
2397 } | 2400 } |
2398 | 2401 |
2399 } } // namespace v8::internal | 2402 } } // namespace v8::internal |
OLD | NEW |