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

Unified Diff: src/bootstrapper.cc

Issue 39322: Mark special internal scripts as native scripts (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « no previous file | src/d8.cc » ('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 1441)
+++ src/bootstrapper.cc (working copy)
@@ -518,10 +518,11 @@
{ // --- E m p t y ---
Handle<Code> code =
Handle<Code>(Builtins::builtin(Builtins::EmptyFunction));
+ empty_function->set_code(*code);
Handle<String> source = Factory::NewStringFromAscii(CStrVector("() {}"));
-
- empty_function->set_code(*code);
- empty_function->shared()->set_script(*Factory::NewScript(source));
+ Handle<Script> script = Factory::NewScript(source);
+ script->set_type(Smi::FromInt(SCRIPT_TYPE_NATIVE));
+ empty_function->shared()->set_script(*script);
empty_function->shared()->set_start_position(0);
empty_function->shared()->set_end_position(source->length());
empty_function->shared()->DontAdaptArguments();
@@ -1028,6 +1029,7 @@
// Allocate the empty script.
Handle<Script> script = Factory::NewScript(Factory::empty_string());
+ script->set_type(Smi::FromInt(SCRIPT_TYPE_NATIVE));
global_context()->set_empty_script(*script);
}
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698