| 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.
|
|
|