Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/bootstrapper.cc

Issue 110203002: Refactor the compiling pipeline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: move some code Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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, 0, 0,
titzer 2013/12/09 14:49:28 formatting changes on this line.
1516 0,
1517 0,
1518 false, 1516 false,
1519 top_context, 1517 top_context,
1520 extension, 1518 extension,
1521 NULL, 1519 NULL,
1522 Handle<String>::null(), 1520 Handle<String>::null(),
1523 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); 1521 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE);
1524 if (function_info.is_null()) return false; 1522 if (function_info.is_null()) return false;
1525 if (cache != NULL) cache->Add(name, function_info); 1523 if (cache != NULL) cache->Add(name, function_info);
1526 } 1524 }
1527 1525
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { 2356 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
2359 HandleScope scope(isolate()); 2357 HandleScope scope(isolate());
2360 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { 2358 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
2361 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); 2359 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
2362 Handle<String> name = 2360 Handle<String> name =
2363 factory()->InternalizeUtf8String(Builtins::GetName(id)); 2361 factory()->InternalizeUtf8String(Builtins::GetName(id));
2364 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name); 2362 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name);
2365 Handle<JSFunction> function 2363 Handle<JSFunction> function
2366 = Handle<JSFunction>(JSFunction::cast(function_object)); 2364 = Handle<JSFunction>(JSFunction::cast(function_object));
2367 builtins->set_javascript_builtin(id, *function); 2365 builtins->set_javascript_builtin(id, *function);
2368 if (!JSFunction::CompileLazy(function, CLEAR_EXCEPTION)) { 2366 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) {
2369 return false; 2367 return false;
2370 } 2368 }
2371 builtins->set_javascript_builtin_code(id, function->shared()->code()); 2369 builtins->set_javascript_builtin_code(id, function->shared()->code());
2372 } 2370 }
2373 return true; 2371 return true;
2374 } 2372 }
2375 2373
2376 2374
2377 bool Genesis::ConfigureGlobalObjects( 2375 bool Genesis::ConfigureGlobalObjects(
2378 v8::Handle<v8::ObjectTemplate> global_proxy_template) { 2376 v8::Handle<v8::ObjectTemplate> global_proxy_template) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 return from + sizeof(NestingCounterType); 2704 return from + sizeof(NestingCounterType);
2707 } 2705 }
2708 2706
2709 2707
2710 // Called when the top-level V8 mutex is destroyed. 2708 // Called when the top-level V8 mutex is destroyed.
2711 void Bootstrapper::FreeThreadResources() { 2709 void Bootstrapper::FreeThreadResources() {
2712 ASSERT(!IsActive()); 2710 ASSERT(!IsActive());
2713 } 2711 }
2714 2712
2715 } } // namespace v8::internal 2713 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698