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

Side by Side Diff: src/bootstrapper.cc

Issue 10542002: Replace SharedFunctionInfo::EnsureCompiled with JSFunction::CompileLazy where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 8 years, 6 months 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
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { 2085 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
2086 HandleScope scope; 2086 HandleScope scope;
2087 Factory* factory = builtins->GetIsolate()->factory(); 2087 Factory* factory = builtins->GetIsolate()->factory();
2088 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { 2088 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
2089 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); 2089 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
2090 Handle<String> name = factory->LookupAsciiSymbol(Builtins::GetName(id)); 2090 Handle<String> name = factory->LookupAsciiSymbol(Builtins::GetName(id));
2091 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name); 2091 Object* function_object = builtins->GetPropertyNoExceptionThrown(*name);
2092 Handle<JSFunction> function 2092 Handle<JSFunction> function
2093 = Handle<JSFunction>(JSFunction::cast(function_object)); 2093 = Handle<JSFunction>(JSFunction::cast(function_object));
2094 builtins->set_javascript_builtin(id, *function); 2094 builtins->set_javascript_builtin(id, *function);
2095 Handle<SharedFunctionInfo> shared 2095 if (!JSFunction::CompileLazy(function, CLEAR_EXCEPTION)) {
2096 = Handle<SharedFunctionInfo>(function->shared());
2097 if (!SharedFunctionInfo::EnsureCompiled(shared, CLEAR_EXCEPTION)) {
2098 return false; 2096 return false;
2099 } 2097 }
2100 // Set the code object on the function object. 2098 builtins->set_javascript_builtin_code(id, function->shared()->code());
2101 function->ReplaceCode(function->shared()->code());
2102 builtins->set_javascript_builtin_code(id, shared->code());
2103 } 2099 }
2104 return true; 2100 return true;
2105 } 2101 }
2106 2102
2107 2103
2108 bool Genesis::ConfigureGlobalObjects( 2104 bool Genesis::ConfigureGlobalObjects(
2109 v8::Handle<v8::ObjectTemplate> global_proxy_template) { 2105 v8::Handle<v8::ObjectTemplate> global_proxy_template) {
2110 Handle<JSObject> global_proxy( 2106 Handle<JSObject> global_proxy(
2111 JSObject::cast(global_context()->global_proxy())); 2107 JSObject::cast(global_context()->global_proxy()));
2112 Handle<JSObject> inner_global(JSObject::cast(global_context()->global())); 2108 Handle<JSObject> inner_global(JSObject::cast(global_context()->global()));
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 return from + sizeof(NestingCounterType); 2362 return from + sizeof(NestingCounterType);
2367 } 2363 }
2368 2364
2369 2365
2370 // Called when the top-level V8 mutex is destroyed. 2366 // Called when the top-level V8 mutex is destroyed.
2371 void Bootstrapper::FreeThreadResources() { 2367 void Bootstrapper::FreeThreadResources() {
2372 ASSERT(!IsActive()); 2368 ASSERT(!IsActive());
2373 } 2369 }
2374 2370
2375 } } // namespace v8::internal 2371 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698