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

Unified Diff: src/factory.cc

Issue 6815029: Merge (7180:7265] from bleeding_edge to the experimental/gc branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 8 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/factory.h ('k') | src/global-handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
===================================================================
--- src/factory.cc (revision 7557)
+++ src/factory.cc (working copy)
@@ -351,7 +351,12 @@
Handle<Context> context,
PretenureFlag pretenure) {
Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo(
- function_info, Top::function_map(), pretenure);
+ function_info,
+ function_info->strict_mode()
+ ? Top::strict_mode_function_map()
+ : Top::function_map(),
+ pretenure);
+
result->set_context(*context);
int number_of_literals = function_info->num_literals();
Handle<FixedArray> literals =
@@ -584,7 +589,8 @@
Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name,
Handle<Code> code) {
- Handle<JSFunction> function = NewFunctionWithoutPrototype(name);
+ Handle<JSFunction> function = NewFunctionWithoutPrototype(name,
+ kNonStrictMode);
function->shared()->set_code(*code);
function->set_code(*code);
ASSERT(!function->has_initial_map());
@@ -717,10 +723,10 @@
}
-Handle<JSArray> Factory::NewJSArray(int length,
+Handle<JSArray> Factory::NewJSArray(int capacity,
PretenureFlag pretenure) {
Handle<JSObject> obj = NewJSObject(Top::array_function(), pretenure);
- CALL_HEAP_FUNCTION(Handle<JSArray>::cast(obj)->Initialize(length), JSArray);
+ CALL_HEAP_FUNCTION(Handle<JSArray>::cast(obj)->Initialize(capacity), JSArray);
}
@@ -809,18 +815,24 @@
Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper(
- Handle<String> name) {
+ Handle<String> name,
+ StrictModeFlag strict_mode) {
Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name);
+ Handle<Map> map = strict_mode == kStrictMode
+ ? Top::strict_mode_function_without_prototype_map()
+ : Top::function_without_prototype_map();
CALL_HEAP_FUNCTION(Heap::AllocateFunction(
- *Top::function_without_prototype_map(),
+ *map,
*function_share,
*the_hole_value()),
JSFunction);
}
-Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) {
- Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name);
+Handle<JSFunction> Factory::NewFunctionWithoutPrototype(
+ Handle<String> name,
+ StrictModeFlag strict_mode) {
+ Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name, strict_mode);
fun->set_context(Top::context()->global_context());
return fun;
}
« no previous file with comments | « src/factory.h ('k') | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698