| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 Handle<Map> CreateStrictFunctionMap(FunctionMode function_mode, | 300 Handle<Map> CreateStrictFunctionMap(FunctionMode function_mode, |
| 301 Handle<JSFunction> empty_function); | 301 Handle<JSFunction> empty_function); |
| 302 Handle<Map> CreateStrongFunctionMap(Handle<JSFunction> empty_function, | 302 Handle<Map> CreateStrongFunctionMap(Handle<JSFunction> empty_function, |
| 303 bool is_constructor); | 303 bool is_constructor); |
| 304 | 304 |
| 305 | 305 |
| 306 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, | 306 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
| 307 FunctionMode function_mode); | 307 FunctionMode function_mode); |
| 308 void SetStrongFunctionInstanceDescriptor(Handle<Map> map); | 308 void SetStrongFunctionInstanceDescriptor(Handle<Map> map); |
| 309 | 309 |
| 310 static bool CompileBuiltin(Isolate* isolate, int index); | 310 static bool CompileBuiltin(Isolate* isolate, int index, |
| 311 Handle<JSObject> shared); |
| 311 static bool CompileExperimentalBuiltin(Isolate* isolate, int index); | 312 static bool CompileExperimentalBuiltin(Isolate* isolate, int index); |
| 312 static bool CompileExtraBuiltin(Isolate* isolate, int index); | 313 static bool CompileExtraBuiltin(Isolate* isolate, int index); |
| 313 static bool CompileNative(Isolate* isolate, Vector<const char> name, | 314 static bool CompileNative(Isolate* isolate, Vector<const char> name, |
| 314 Handle<String> source, int argc, | 315 Handle<String> source, int argc, |
| 315 Handle<Object> argv[]); | 316 Handle<Object> argv[]); |
| 316 | 317 |
| 317 static bool CallUtilsFunction(Isolate* isolate, const char* name); | |
| 318 | |
| 319 static bool CompileExtension(Isolate* isolate, v8::Extension* extension); | 318 static bool CompileExtension(Isolate* isolate, v8::Extension* extension); |
| 320 | 319 |
| 321 Isolate* isolate_; | 320 Isolate* isolate_; |
| 322 Handle<Context> result_; | 321 Handle<Context> result_; |
| 323 Handle<Context> native_context_; | 322 Handle<Context> native_context_; |
| 324 | 323 |
| 325 // Function maps. Function maps are created initially with a read only | 324 // Function maps. Function maps are created initially with a read only |
| 326 // prototype for the processing of JS builtins. Later the function maps are | 325 // prototype for the processing of JS builtins. Later the function maps are |
| 327 // replaced in order to make prototype writable. These are the final, writable | 326 // replaced in order to make prototype writable. These are the final, writable |
| 328 // prototype, maps. | 327 // prototype, maps. |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 void Genesis::InitializeExperimentalGlobal() { | 1435 void Genesis::InitializeExperimentalGlobal() { |
| 1437 #define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id(); | 1436 #define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id(); |
| 1438 | 1437 |
| 1439 HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) | 1438 HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) |
| 1440 HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) | 1439 HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) |
| 1441 HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) | 1440 HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) |
| 1442 #undef FEATURE_INITIALIZE_GLOBAL | 1441 #undef FEATURE_INITIALIZE_GLOBAL |
| 1443 } | 1442 } |
| 1444 | 1443 |
| 1445 | 1444 |
| 1446 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { | 1445 bool Genesis::CompileBuiltin(Isolate* isolate, int index, |
| 1446 Handle<JSObject> shared) { |
| 1447 Vector<const char> name = Natives::GetScriptName(index); | 1447 Vector<const char> name = Natives::GetScriptName(index); |
| 1448 Handle<String> source_code = | 1448 Handle<String> source_code = |
| 1449 isolate->bootstrapper()->SourceLookup<Natives>(index); | 1449 isolate->bootstrapper()->SourceLookup<Natives>(index); |
| 1450 Handle<Object> global = isolate->global_object(); | 1450 Handle<Object> global = isolate->global_object(); |
| 1451 Handle<Object> utils = isolate->natives_utils_object(); | 1451 Handle<Object> exports = isolate->builtin_exports_object(); |
| 1452 Handle<Object> args[] = {global, utils}; | 1452 Handle<Object> args[] = {global, shared, exports}; |
| 1453 return CompileNative(isolate, name, source_code, arraysize(args), args); | 1453 return CompileNative(isolate, name, source_code, arraysize(args), args); |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 | 1456 |
| 1457 bool Genesis::CompileExperimentalBuiltin(Isolate* isolate, int index) { | 1457 bool Genesis::CompileExperimentalBuiltin(Isolate* isolate, int index) { |
| 1458 HandleScope scope(isolate); | 1458 HandleScope scope(isolate); |
| 1459 Vector<const char> name = ExperimentalNatives::GetScriptName(index); | 1459 Vector<const char> name = ExperimentalNatives::GetScriptName(index); |
| 1460 Handle<String> source_code = | 1460 Handle<String> source_code = |
| 1461 isolate->bootstrapper()->SourceLookup<ExperimentalNatives>(index); | 1461 isolate->bootstrapper()->SourceLookup<ExperimentalNatives>(index); |
| 1462 Handle<Object> global = isolate->global_object(); | 1462 Handle<Object> global = isolate->global_object(); |
| 1463 Handle<Object> utils = isolate->natives_utils_object(); | 1463 Handle<Object> exports = isolate->builtin_exports_object(); |
| 1464 Handle<Object> args[] = {global, utils}; | 1464 Handle<Object> args[] = {global, exports}; |
| 1465 return CompileNative(isolate, name, source_code, arraysize(args), args); | 1465 return CompileNative(isolate, name, source_code, arraysize(args), args); |
| 1466 } | 1466 } |
| 1467 | 1467 |
| 1468 | 1468 |
| 1469 bool Genesis::CompileExtraBuiltin(Isolate* isolate, int index) { | 1469 bool Genesis::CompileExtraBuiltin(Isolate* isolate, int index) { |
| 1470 HandleScope scope(isolate); | 1470 HandleScope scope(isolate); |
| 1471 Vector<const char> name = ExtraNatives::GetScriptName(index); | 1471 Vector<const char> name = ExtraNatives::GetScriptName(index); |
| 1472 Handle<String> source_code = | 1472 Handle<String> source_code = |
| 1473 isolate->bootstrapper()->SourceLookup<ExtraNatives>(index); | 1473 isolate->bootstrapper()->SourceLookup<ExtraNatives>(index); |
| 1474 Handle<Object> global = isolate->global_object(); | 1474 Handle<Object> global = isolate->global_object(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 Handle<Object> wrapper; | 1510 Handle<Object> wrapper; |
| 1511 if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) { | 1511 if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) { |
| 1512 return false; | 1512 return false; |
| 1513 } | 1513 } |
| 1514 // Then run the function wrapper. | 1514 // Then run the function wrapper. |
| 1515 return !Execution::Call(isolate, Handle<JSFunction>::cast(wrapper), receiver, | 1515 return !Execution::Call(isolate, Handle<JSFunction>::cast(wrapper), receiver, |
| 1516 argc, argv).is_null(); | 1516 argc, argv).is_null(); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 | 1519 |
| 1520 bool Genesis::CallUtilsFunction(Isolate* isolate, const char* name) { | |
| 1521 Handle<JSObject> utils = | |
| 1522 Handle<JSObject>::cast(isolate->natives_utils_object()); | |
| 1523 Handle<String> name_string = | |
| 1524 isolate->factory()->NewStringFromAsciiChecked(name); | |
| 1525 Handle<Object> fun = JSObject::GetDataProperty(utils, name_string); | |
| 1526 Handle<Object> receiver = isolate->factory()->undefined_value(); | |
| 1527 return !Execution::Call(isolate, fun, receiver, 0, NULL).is_null(); | |
| 1528 } | |
| 1529 | |
| 1530 | |
| 1531 bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { | 1520 bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { |
| 1532 Factory* factory = isolate->factory(); | 1521 Factory* factory = isolate->factory(); |
| 1533 HandleScope scope(isolate); | 1522 HandleScope scope(isolate); |
| 1534 Handle<SharedFunctionInfo> function_info; | 1523 Handle<SharedFunctionInfo> function_info; |
| 1535 | 1524 |
| 1536 Handle<String> source = | 1525 Handle<String> source = |
| 1537 isolate->factory() | 1526 isolate->factory() |
| 1538 ->NewExternalStringFromOneByte(extension->source()) | 1527 ->NewExternalStringFromOneByte(extension->source()) |
| 1539 .ToHandleChecked(); | 1528 .ToHandleChecked(); |
| 1540 DCHECK(source->IsOneByteRepresentation()); | 1529 DCHECK(source->IsOneByteRepresentation()); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1922 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string()); | 1911 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string()); |
| 1923 DCHECK(bridge->context() == *isolate()->native_context()); | 1912 DCHECK(bridge->context() == *isolate()->native_context()); |
| 1924 | 1913 |
| 1925 // Allocate the builtins context. | 1914 // Allocate the builtins context. |
| 1926 Handle<Context> context = | 1915 Handle<Context> context = |
| 1927 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge); | 1916 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge); |
| 1928 context->set_global_object(*builtins); // override builtins global object | 1917 context->set_global_object(*builtins); // override builtins global object |
| 1929 | 1918 |
| 1930 native_context()->set_runtime_context(*context); | 1919 native_context()->set_runtime_context(*context); |
| 1931 | 1920 |
| 1932 // Set up the utils object as shared container between native scripts. | 1921 // Set up shared object to set up cross references between native scripts. |
| 1933 Handle<JSObject> utils = factory()->NewJSObject(isolate()->object_function()); | 1922 // "shared" is used for cross references between native scripts that are part |
| 1934 JSObject::NormalizeProperties(utils, CLEAR_INOBJECT_PROPERTIES, 16, | 1923 // of the snapshot. "builtin_exports" is used for experimental natives. |
| 1935 "utils container for native scripts"); | 1924 Handle<JSObject> shared = |
| 1936 native_context()->set_natives_utils_object(*utils); | 1925 factory()->NewJSObject(isolate()->object_function()); |
| 1926 JSObject::NormalizeProperties(shared, CLEAR_INOBJECT_PROPERTIES, 16, |
| 1927 "container to share between native scripts"); |
| 1928 |
| 1929 Handle<JSObject> builtin_exports = |
| 1930 factory()->NewJSObject(isolate()->object_function()); |
| 1931 JSObject::NormalizeProperties(builtin_exports, CLEAR_INOBJECT_PROPERTIES, 16, |
| 1932 "container to export to experimental natives"); |
| 1933 native_context()->set_builtin_exports_object(*builtin_exports); |
| 1937 | 1934 |
| 1938 Handle<JSObject> extras_exports = | 1935 Handle<JSObject> extras_exports = |
| 1939 factory()->NewJSObject(isolate()->object_function()); | 1936 factory()->NewJSObject(isolate()->object_function()); |
| 1940 JSObject::NormalizeProperties(extras_exports, CLEAR_INOBJECT_PROPERTIES, 2, | 1937 JSObject::NormalizeProperties(extras_exports, CLEAR_INOBJECT_PROPERTIES, 2, |
| 1941 "container to export to extra natives"); | 1938 "container to export to extra natives"); |
| 1942 native_context()->set_extras_exports_object(*extras_exports); | 1939 native_context()->set_extras_exports_object(*extras_exports); |
| 1943 | 1940 |
| 1944 if (FLAG_expose_natives_as != NULL) { | 1941 if (FLAG_expose_natives_as != NULL) { |
| 1945 Handle<String> utils_key = factory()->NewStringFromAsciiChecked("utils"); | 1942 Handle<String> shared_key = factory()->NewStringFromAsciiChecked("shared"); |
| 1946 JSObject::AddProperty(builtins, utils_key, utils, NONE); | 1943 JSObject::AddProperty(builtins, shared_key, shared, NONE); |
| 1947 } | 1944 } |
| 1948 | 1945 |
| 1949 { // -- S c r i p t | 1946 { // -- S c r i p t |
| 1950 // Builtin functions for Script. | 1947 // Builtin functions for Script. |
| 1951 Handle<JSFunction> script_fun = InstallFunction( | 1948 Handle<JSFunction> script_fun = InstallFunction( |
| 1952 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, | 1949 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, |
| 1953 isolate()->initial_object_prototype(), Builtins::kIllegal); | 1950 isolate()->initial_object_prototype(), Builtins::kIllegal); |
| 1954 Handle<JSObject> prototype = | 1951 Handle<JSObject> prototype = |
| 1955 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1952 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 1956 Accessors::FunctionSetPrototype(script_fun, prototype).Assert(); | 1953 Accessors::FunctionSetPrototype(script_fun, prototype).Assert(); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 native_context()->set_opaque_reference_function(*opaque_reference_fun); | 2109 native_context()->set_opaque_reference_function(*opaque_reference_fun); |
| 2113 } | 2110 } |
| 2114 | 2111 |
| 2115 // InternalArrays should not use Smi-Only array optimizations. There are too | 2112 // InternalArrays should not use Smi-Only array optimizations. There are too |
| 2116 // many places in the C++ runtime code (e.g. RegEx) that assume that | 2113 // many places in the C++ runtime code (e.g. RegEx) that assume that |
| 2117 // elements in InternalArrays can be set to non-Smi values without going | 2114 // elements in InternalArrays can be set to non-Smi values without going |
| 2118 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT | 2115 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT |
| 2119 // transition easy to trap. Moreover, they rarely are smi-only. | 2116 // transition easy to trap. Moreover, they rarely are smi-only. |
| 2120 { | 2117 { |
| 2121 HandleScope scope(isolate()); | 2118 HandleScope scope(isolate()); |
| 2122 Handle<JSObject> utils = | 2119 Handle<JSObject> builtin_exports = |
| 2123 Handle<JSObject>::cast(isolate()->natives_utils_object()); | 2120 Handle<JSObject>::cast(isolate()->builtin_exports_object()); |
| 2124 Handle<JSFunction> array_function = | 2121 Handle<JSFunction> array_function = InstallInternalArray( |
| 2125 InstallInternalArray(utils, "InternalArray", FAST_HOLEY_ELEMENTS); | 2122 builtin_exports, "InternalArray", FAST_HOLEY_ELEMENTS); |
| 2126 native_context()->set_internal_array_function(*array_function); | 2123 native_context()->set_internal_array_function(*array_function); |
| 2127 InstallInternalArray(utils, "InternalPackedArray", FAST_ELEMENTS); | 2124 InstallInternalArray(builtin_exports, "InternalPackedArray", FAST_ELEMENTS); |
| 2128 } | 2125 } |
| 2129 | 2126 |
| 2130 { // -- S e t I t e r a t o r | 2127 { // -- S e t I t e r a t o r |
| 2131 Handle<JSFunction> set_iterator_function = InstallFunction( | 2128 Handle<JSFunction> set_iterator_function = InstallFunction( |
| 2132 builtins, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, | 2129 builtins, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, |
| 2133 isolate()->initial_object_prototype(), Builtins::kIllegal); | 2130 isolate()->initial_object_prototype(), Builtins::kIllegal); |
| 2134 native_context()->set_set_iterator_map( | 2131 native_context()->set_set_iterator_map( |
| 2135 set_iterator_function->initial_map()); | 2132 set_iterator_function->initial_map()); |
| 2136 } | 2133 } |
| 2137 | 2134 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 { | 2214 { |
| 2218 static const PropertyAttributes attributes = | 2215 static const PropertyAttributes attributes = |
| 2219 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 2216 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| 2220 #define INSTALL_PUBLIC_SYMBOL(name, varname, description) \ | 2217 #define INSTALL_PUBLIC_SYMBOL(name, varname, description) \ |
| 2221 Handle<String> varname = factory()->NewStringFromStaticChars(#varname); \ | 2218 Handle<String> varname = factory()->NewStringFromStaticChars(#varname); \ |
| 2222 JSObject::AddProperty(builtins, varname, factory()->name(), attributes); | 2219 JSObject::AddProperty(builtins, varname, factory()->name(), attributes); |
| 2223 PUBLIC_SYMBOL_LIST(INSTALL_PUBLIC_SYMBOL) | 2220 PUBLIC_SYMBOL_LIST(INSTALL_PUBLIC_SYMBOL) |
| 2224 #undef INSTALL_PUBLIC_SYMBOL | 2221 #undef INSTALL_PUBLIC_SYMBOL |
| 2225 } | 2222 } |
| 2226 | 2223 |
| 2224 // Install natives. Everything exported to experimental natives is also |
| 2225 // shared to regular natives. |
| 2226 TransferNamedProperties(builtin_exports, shared); |
| 2227 int i = Natives::GetDebuggerCount(); | 2227 int i = Natives::GetDebuggerCount(); |
| 2228 if (!CompileBuiltin(isolate(), i)) return false; | 2228 if (!CompileBuiltin(isolate(), i, shared)) return false; |
| 2229 if (!InstallJSBuiltins(builtins)) return false; | 2229 if (!InstallJSBuiltins(builtins)) return false; |
| 2230 | 2230 |
| 2231 for (++i; i < Natives::GetBuiltinsCount(); ++i) { | 2231 for (++i; i < Natives::GetBuiltinsCount(); ++i) { |
| 2232 if (!CompileBuiltin(isolate(), i)) return false; | 2232 if (!CompileBuiltin(isolate(), i, shared)) return false; |
| 2233 } | 2233 } |
| 2234 | 2234 |
| 2235 if (!CallUtilsFunction(isolate(), "PostNatives")) return false; | |
| 2236 | |
| 2237 InstallNativeFunctions(); | 2235 InstallNativeFunctions(); |
| 2238 | 2236 |
| 2239 auto function_cache = | 2237 auto function_cache = |
| 2240 ObjectHashTable::New(isolate(), ApiNatives::kInitialFunctionCacheSize); | 2238 ObjectHashTable::New(isolate(), ApiNatives::kInitialFunctionCacheSize); |
| 2241 native_context()->set_function_cache(*function_cache); | 2239 native_context()->set_function_cache(*function_cache); |
| 2242 | 2240 |
| 2243 // Store the map for the string prototype after the natives has been compiled | 2241 // Store the map for the string prototype after the natives has been compiled |
| 2244 // and the String function has been set up. | 2242 // and the String function has been set up. |
| 2245 Handle<JSFunction> string_function(native_context()->string_function()); | 2243 Handle<JSFunction> string_function(native_context()->string_function()); |
| 2246 DCHECK(JSObject::cast( | 2244 DCHECK(JSObject::cast( |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2539 Handle<JSGlobalObject> global(JSGlobalObject::cast( | 2537 Handle<JSGlobalObject> global(JSGlobalObject::cast( |
| 2540 native_context->global_object())); | 2538 native_context->global_object())); |
| 2541 | 2539 |
| 2542 Handle<JSObject> Error = Handle<JSObject>::cast( | 2540 Handle<JSObject> Error = Handle<JSObject>::cast( |
| 2543 Object::GetProperty(isolate, global, "Error").ToHandleChecked()); | 2541 Object::GetProperty(isolate, global, "Error").ToHandleChecked()); |
| 2544 Handle<String> name = | 2542 Handle<String> name = |
| 2545 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); | 2543 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); |
| 2546 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); | 2544 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); |
| 2547 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); | 2545 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); |
| 2548 | 2546 |
| 2549 // By now the utils object is useless and can be removed. | 2547 Handle<Object> builtin_exports(native_context->builtin_exports_object(), |
| 2550 native_context->set_natives_utils_object(*factory->undefined_value()); | 2548 isolate); |
| 2549 native_context->set_builtin_exports_object(Smi::FromInt(0)); |
| 2551 | 2550 |
| 2552 // Expose the natives in global if a name for it is specified. | 2551 // Expose the natives in global if a name for it is specified. |
| 2553 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { | 2552 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { |
| 2554 Handle<String> natives_key = | 2553 Handle<String> natives_key = |
| 2555 factory->InternalizeUtf8String(FLAG_expose_natives_as); | 2554 factory->InternalizeUtf8String(FLAG_expose_natives_as); |
| 2556 uint32_t dummy_index; | 2555 uint32_t dummy_index; |
| 2557 if (natives_key->AsArrayIndex(&dummy_index)) return true; | 2556 if (natives_key->AsArrayIndex(&dummy_index)) return true; |
| 2558 Handle<JSBuiltinsObject> natives(global->builtins()); | 2557 Handle<JSBuiltinsObject> natives(global->builtins()); |
| 2559 JSObject::AddProperty(global, natives_key, natives, DONT_ENUM); | 2558 JSObject::AddProperty(global, natives_key, natives, DONT_ENUM); |
| 2559 Handle<String> builtin_exports_key = |
| 2560 factory->NewStringFromAsciiChecked("builtin_exports"); |
| 2561 JSObject::AddProperty(natives, builtin_exports_key, builtin_exports, NONE); |
| 2560 } | 2562 } |
| 2561 | 2563 |
| 2562 // Expose the stack trace symbol to native JS. | 2564 // Expose the stack trace symbol to native JS. |
| 2563 RETURN_ON_EXCEPTION_VALUE(isolate, | 2565 RETURN_ON_EXCEPTION_VALUE(isolate, |
| 2564 JSObject::SetOwnPropertyIgnoreAttributes( | 2566 JSObject::SetOwnPropertyIgnoreAttributes( |
| 2565 handle(native_context->builtins(), isolate), | 2567 handle(native_context->builtins(), isolate), |
| 2566 factory->InternalizeOneByteString( | 2568 factory->InternalizeOneByteString( |
| 2567 STATIC_CHAR_VECTOR("$stackTraceSymbol")), | 2569 STATIC_CHAR_VECTOR("$stackTraceSymbol")), |
| 2568 factory->stack_trace_symbol(), NONE), | 2570 factory->stack_trace_symbol(), NONE), |
| 2569 false); | 2571 false); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3042 return from + sizeof(NestingCounterType); | 3044 return from + sizeof(NestingCounterType); |
| 3043 } | 3045 } |
| 3044 | 3046 |
| 3045 | 3047 |
| 3046 // Called when the top-level V8 mutex is destroyed. | 3048 // Called when the top-level V8 mutex is destroyed. |
| 3047 void Bootstrapper::FreeThreadResources() { | 3049 void Bootstrapper::FreeThreadResources() { |
| 3048 DCHECK(!IsActive()); | 3050 DCHECK(!IsActive()); |
| 3049 } | 3051 } |
| 3050 | 3052 |
| 3051 } } // namespace v8::internal | 3053 } } // namespace v8::internal |
| OLD | NEW |