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

Side by Side Diff: src/bootstrapper.cc

Issue 606053: Enable passing of script data via script creation methods (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 10 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 | « src/api.cc ('k') | src/compiler.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 bool use_runtime_context) { 935 bool use_runtime_context) {
936 HandleScope scope; 936 HandleScope scope;
937 Handle<JSFunction> boilerplate; 937 Handle<JSFunction> boilerplate;
938 938
939 // If we can't find the function in the cache, we compile a new 939 // If we can't find the function in the cache, we compile a new
940 // function and insert it into the cache. 940 // function and insert it into the cache.
941 if (!cache->Lookup(name, &boilerplate)) { 941 if (!cache->Lookup(name, &boilerplate)) {
942 ASSERT(source->IsAsciiRepresentation()); 942 ASSERT(source->IsAsciiRepresentation());
943 Handle<String> script_name = Factory::NewStringFromUtf8(name); 943 Handle<String> script_name = Factory::NewStringFromUtf8(name);
944 boilerplate = 944 boilerplate =
945 Compiler::Compile(source, script_name, 0, 0, extension, NULL); 945 Compiler::Compile(source, script_name, 0, 0, extension, NULL,
946 Handle<String>::null());
946 if (boilerplate.is_null()) return false; 947 if (boilerplate.is_null()) return false;
947 cache->Add(name, boilerplate); 948 cache->Add(name, boilerplate);
948 } 949 }
949 950
950 // Setup the function context. Conceptually, we should clone the 951 // Setup the function context. Conceptually, we should clone the
951 // function before overwriting the context but since we're in a 952 // function before overwriting the context but since we're in a
952 // single-threaded environment it is not strictly necessary. 953 // single-threaded environment it is not strictly necessary.
953 ASSERT(Top::context()->IsGlobalContext()); 954 ASSERT(Top::context()->IsGlobalContext());
954 Handle<Context> context = 955 Handle<Context> context =
955 Handle<Context>(use_runtime_context 956 Handle<Context>(use_runtime_context
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 } 1670 }
1670 1671
1671 1672
1672 // Restore statics that are thread local. 1673 // Restore statics that are thread local.
1673 char* Genesis::RestoreState(char* from) { 1674 char* Genesis::RestoreState(char* from) {
1674 current_ = *reinterpret_cast<Genesis**>(from); 1675 current_ = *reinterpret_cast<Genesis**>(from);
1675 return from + sizeof(current_); 1676 return from + sizeof(current_);
1676 } 1677 }
1677 1678
1678 } } // namespace v8::internal 1679 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698