Version 3.13.4

Print reason for disabling optimization. Kill --trace-bailout flag.

Provided option to disable full DEBUG build on Android.

Introduced global contexts to represent lexical global scope(s).

Fixed rounding in Uint8ClampedArray setter. (issue 2294)

Performance and stability improvements on all platforms.

git-svn-id: http://v8.googlecode.com/svn/trunk@12394 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/factory.cc b/src/factory.cc
index 913b756..462af59 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -284,10 +284,19 @@
 }
 
 
-Handle<Context> Factory::NewGlobalContext() {
+Handle<Context> Factory::NewNativeContext() {
   CALL_HEAP_FUNCTION(
       isolate(),
-      isolate()->heap()->AllocateGlobalContext(),
+      isolate()->heap()->AllocateNativeContext(),
+      Context);
+}
+
+
+Handle<Context> Factory::NewGlobalContext(Handle<JSFunction> function,
+                                          Handle<ScopeInfo> scope_info) {
+  CALL_HEAP_FUNCTION(
+      isolate(),
+      isolate()->heap()->AllocateGlobalContext(*function, *scope_info),
       Context);
 }
 
@@ -552,16 +561,16 @@
 
   result->set_context(*context);
 
-  int index = function_info->SearchOptimizedCodeMap(context->global_context());
+  int index = function_info->SearchOptimizedCodeMap(context->native_context());
   if (!function_info->bound() && index < 0) {
     int number_of_literals = function_info->num_literals();
     Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
     if (number_of_literals > 0) {
-      // Store the global context in the literals array prefix. This
+      // Store the native context in the literals array prefix. This
       // context will be used when creating object, regexp and array
       // literals in this function.
-      literals->set(JSFunction::kLiteralGlobalContextIndex,
-                    context->global_context());
+      literals->set(JSFunction::kLiteralNativeContextIndex,
+                    context->native_context());
     }
     result->set_literals(*literals);
   }
@@ -1110,7 +1119,7 @@
 Handle<JSFunction> Factory::NewFunction(Handle<String> name,
                                         Handle<Object> prototype) {
   Handle<JSFunction> fun = NewFunctionHelper(name, prototype);
-  fun->set_context(isolate()->context()->global_context());
+  fun->set_context(isolate()->context()->native_context());
   return fun;
 }
 
@@ -1136,7 +1145,7 @@
     LanguageMode language_mode) {
   Handle<JSFunction> fun =
       NewFunctionWithoutPrototypeHelper(name, language_mode);
-  fun->set_context(isolate()->context()->global_context());
+  fun->set_context(isolate()->context()->native_context());
   return fun;
 }
 
@@ -1147,8 +1156,8 @@
 
 
 Handle<Object> Factory::ToObject(Handle<Object> object,
-                                 Handle<Context> global_context) {
-  CALL_HEAP_FUNCTION(isolate(), object->ToObject(*global_context), Object);
+                                 Handle<Context> native_context) {
+  CALL_HEAP_FUNCTION(isolate(), object->ToObject(*native_context), Object);
 }
 
 
@@ -1320,7 +1329,7 @@
 Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> context,
                                                Handle<FixedArray> keys) {
   if (context->map_cache()->IsUndefined()) {
-    // Allocate the new map cache for the global context.
+    // Allocate the new map cache for the native context.
     Handle<MapCache> new_cache = NewMapCache(24);
     context->set_map_cache(*new_cache);
   }