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

Unified Diff: src/bootstrapper.cc

Issue 1113009: Merge 4205:4215 from bleeding_edge to partial_snapshots branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.h ('k') | src/circular-queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 4215)
+++ src/bootstrapper.cc (working copy)
@@ -59,11 +59,12 @@
}
- bool Lookup(Vector<const char> name, Handle<JSFunction>* handle) {
+ bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
for (int i = 0; i < cache_->length(); i+=2) {
SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i));
if (str->IsEqualTo(name)) {
- *handle = Handle<JSFunction>(JSFunction::cast(cache_->get(i + 1)));
+ *handle = Handle<SharedFunctionInfo>(
+ SharedFunctionInfo::cast(cache_->get(i + 1)));
return true;
}
}
@@ -71,8 +72,7 @@
}
- void Add(Vector<const char> name, Handle<JSFunction> fun) {
- ASSERT(fun->IsBoilerplate());
+ void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
HandleScope scope;
int length = cache_->length();
Handle<FixedArray> new_array =
@@ -81,8 +81,8 @@
cache_ = *new_array;
Handle<String> str = Factory::NewStringFromAscii(name, TENURED);
cache_->set(length, *str);
- cache_->set(length + 1, *fun);
- Script::cast(fun->shared()->script())->set_type(Smi::FromInt(type_));
+ cache_->set(length + 1, *shared);
+ Script::cast(shared->script())->set_type(Smi::FromInt(type_));
}
private:
@@ -860,14 +860,14 @@
Handle<Context> top_context,
bool use_runtime_context) {
HandleScope scope;
- Handle<JSFunction> boilerplate;
+ Handle<SharedFunctionInfo> function_info;
// If we can't find the function in the cache, we compile a new
// function and insert it into the cache.
- if (cache == NULL || !cache->Lookup(name, &boilerplate)) {
+ if (cache == NULL || !cache->Lookup(name, &function_info)) {
ASSERT(source->IsAsciiRepresentation());
Handle<String> script_name = Factory::NewStringFromUtf8(name);
- boilerplate = Compiler::Compile(
+ function_info = Compiler::Compile(
source,
script_name,
0,
@@ -876,8 +876,8 @@
NULL,
Handle<String>::null(),
use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE);
- if (boilerplate.is_null()) return false;
- if (cache != NULL) cache->Add(name, boilerplate);
+ if (function_info.is_null()) return false;
+ if (cache != NULL) cache->Add(name, function_info);
}
// Setup the function context. Conceptually, we should clone the
@@ -889,7 +889,7 @@
? Handle<Context>(top_context->runtime_context())
: top_context);
Handle<JSFunction> fun =
- Factory::NewFunctionFromBoilerplate(boilerplate, context);
+ Factory::NewFunctionFromSharedFunctionInfo(function_info, context);
// Call function using either the runtime object or the global
// object as the receiver. Provide no parameters.
« no previous file with comments | « src/bootstrapper.h ('k') | src/circular-queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698