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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 bool use_runtime_context) { | 1503 bool use_runtime_context) { |
1504 Factory* factory = isolate->factory(); | 1504 Factory* factory = isolate->factory(); |
1505 HandleScope scope(isolate); | 1505 HandleScope scope(isolate); |
1506 Handle<SharedFunctionInfo> function_info; | 1506 Handle<SharedFunctionInfo> function_info; |
1507 | 1507 |
1508 // If we can't find the function in the cache, we compile a new | 1508 // If we can't find the function in the cache, we compile a new |
1509 // function and insert it into the cache. | 1509 // function and insert it into the cache. |
1510 if (cache == NULL || !cache->Lookup(name, &function_info)) { | 1510 if (cache == NULL || !cache->Lookup(name, &function_info)) { |
1511 ASSERT(source->IsOneByteRepresentation()); | 1511 ASSERT(source->IsOneByteRepresentation()); |
1512 Handle<String> script_name = factory->NewStringFromUtf8(name); | 1512 Handle<String> script_name = factory->NewStringFromUtf8(name); |
1513 function_info = Compiler::Compile( | 1513 function_info = Compiler::CompileScript( |
1514 source, | 1514 source, |
1515 script_name, | 1515 script_name, |
1516 0, | 1516 0, |
1517 0, | 1517 0, |
1518 false, | 1518 false, |
1519 top_context, | 1519 top_context, |
1520 extension, | 1520 extension, |
1521 NULL, | 1521 NULL, |
1522 Handle<String>::null(), | 1522 Handle<String>::null(), |
1523 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); | 1523 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { | 2358 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
2359 HandleScope scope(isolate()); | 2359 HandleScope scope(isolate()); |
2360 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { | 2360 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
2361 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); | 2361 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
2362 Handle<String> name = | 2362 Handle<String> name = |
2363 factory()->InternalizeUtf8String(Builtins::GetName(id)); | 2363 factory()->InternalizeUtf8String(Builtins::GetName(id)); |
2364 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name); | 2364 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name); |
2365 Handle<JSFunction> function | 2365 Handle<JSFunction> function |
2366 = Handle<JSFunction>(JSFunction::cast(function_object)); | 2366 = Handle<JSFunction>(JSFunction::cast(function_object)); |
2367 builtins->set_javascript_builtin(id, *function); | 2367 builtins->set_javascript_builtin(id, *function); |
2368 if (!JSFunction::CompileLazy(function, CLEAR_EXCEPTION)) { | 2368 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { |
2369 return false; | 2369 return false; |
2370 } | 2370 } |
2371 builtins->set_javascript_builtin_code(id, function->shared()->code()); | 2371 builtins->set_javascript_builtin_code(id, function->shared()->code()); |
2372 } | 2372 } |
2373 return true; | 2373 return true; |
2374 } | 2374 } |
2375 | 2375 |
2376 | 2376 |
2377 bool Genesis::ConfigureGlobalObjects( | 2377 bool Genesis::ConfigureGlobalObjects( |
2378 v8::Handle<v8::ObjectTemplate> global_proxy_template) { | 2378 v8::Handle<v8::ObjectTemplate> global_proxy_template) { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 return from + sizeof(NestingCounterType); | 2706 return from + sizeof(NestingCounterType); |
2707 } | 2707 } |
2708 | 2708 |
2709 | 2709 |
2710 // Called when the top-level V8 mutex is destroyed. | 2710 // Called when the top-level V8 mutex is destroyed. |
2711 void Bootstrapper::FreeThreadResources() { | 2711 void Bootstrapper::FreeThreadResources() { |
2712 ASSERT(!IsActive()); | 2712 ASSERT(!IsActive()); |
2713 } | 2713 } |
2714 | 2714 |
2715 } } // namespace v8::internal | 2715 } } // namespace v8::internal |
OLD | NEW |