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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, | 1304 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, |
1305 prototype, Builtins::kIllegal, true); | 1305 prototype, Builtins::kIllegal, true); |
1306 } | 1306 } |
1307 { // -- W e a k M a p | 1307 { // -- W e a k M a p |
1308 Handle<JSObject> prototype = | 1308 Handle<JSObject> prototype = |
1309 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1309 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1310 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, | 1310 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
1311 prototype, Builtins::kIllegal, true); | 1311 prototype, Builtins::kIllegal, true); |
1312 } | 1312 } |
1313 } | 1313 } |
| 1314 |
| 1315 if (FLAG_harmony_typed_arrays) { |
| 1316 { // -- A r r a y B u f f e r |
| 1317 Handle<JSObject> prototype = |
| 1318 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 1319 InstallFunction(global, "__ArrayBuffer", JS_ARRAY_BUFFER_TYPE, |
| 1320 JSArrayBuffer::kSize, prototype, |
| 1321 Builtins::kIllegal, true); |
| 1322 } |
| 1323 } |
1314 } | 1324 } |
1315 | 1325 |
1316 | 1326 |
1317 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { | 1327 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { |
1318 Vector<const char> name = Natives::GetScriptName(index); | 1328 Vector<const char> name = Natives::GetScriptName(index); |
1319 Handle<String> source_code = | 1329 Handle<String> source_code = |
1320 isolate->bootstrapper()->NativesSourceLookup(index); | 1330 isolate->bootstrapper()->NativesSourceLookup(index); |
1321 return CompileNative(isolate, name, source_code); | 1331 return CompileNative(isolate, name, source_code); |
1322 } | 1332 } |
1323 | 1333 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 if (FLAG_harmony_collections && | 1921 if (FLAG_harmony_collections && |
1912 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 1922 strcmp(ExperimentalNatives::GetScriptName(i).start(), |
1913 "native collection.js") == 0) { | 1923 "native collection.js") == 0) { |
1914 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 1924 if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
1915 } | 1925 } |
1916 if (FLAG_harmony_observation && | 1926 if (FLAG_harmony_observation && |
1917 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 1927 strcmp(ExperimentalNatives::GetScriptName(i).start(), |
1918 "native object-observe.js") == 0) { | 1928 "native object-observe.js") == 0) { |
1919 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 1929 if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
1920 } | 1930 } |
| 1931 if (FLAG_harmony_typed_arrays && |
| 1932 strcmp(ExperimentalNatives::GetScriptName(i).start(), |
| 1933 "native typedarray.js") == 0) { |
| 1934 if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
| 1935 } |
1921 } | 1936 } |
1922 | 1937 |
1923 InstallExperimentalNativeFunctions(); | 1938 InstallExperimentalNativeFunctions(); |
1924 | 1939 |
1925 return true; | 1940 return true; |
1926 } | 1941 } |
1927 | 1942 |
1928 | 1943 |
1929 static Handle<JSObject> ResolveBuiltinIdHolder( | 1944 static Handle<JSObject> ResolveBuiltinIdHolder( |
1930 Handle<Context> native_context, | 1945 Handle<Context> native_context, |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 return from + sizeof(NestingCounterType); | 2510 return from + sizeof(NestingCounterType); |
2496 } | 2511 } |
2497 | 2512 |
2498 | 2513 |
2499 // Called when the top-level V8 mutex is destroyed. | 2514 // Called when the top-level V8 mutex is destroyed. |
2500 void Bootstrapper::FreeThreadResources() { | 2515 void Bootstrapper::FreeThreadResources() { |
2501 ASSERT(!IsActive()); | 2516 ASSERT(!IsActive()); |
2502 } | 2517 } |
2503 | 2518 |
2504 } } // namespace v8::internal | 2519 } } // namespace v8::internal |
OLD | NEW |