Revision: 25068
Author:   [email protected]
Date:     Mon Nov  3 12:05:50 2014 UTC
Log:      Version 3.29.88.12 (merged r24927, r24987, r25060, r24950, r24993)

Use shared function info for eval cache key.

EmitCreateIteratorResult loads map from function's context

Fix constant in Math.tan implementation.

MIPS: Use shared function info for eval cache key.

MIPS: EmitCreateIteratorResult loads map from function's context.

BUG=chromium:427468,v8:3656,v8:3656
LOG=N
[email protected]

Review URL: https://codereview.chromium.org/700513002
https://code.google.com/p/v8/source/detail?r=25068

Modified:
 /branches/3.29/src/arm/full-codegen-arm.cc
 /branches/3.29/src/arm64/full-codegen-arm64.cc
 /branches/3.29/src/compilation-cache.cc
 /branches/3.29/src/compilation-cache.h
 /branches/3.29/src/compiler/ast-graph-builder.cc
 /branches/3.29/src/compiler.cc
 /branches/3.29/src/compiler.h
 /branches/3.29/src/ia32/full-codegen-ia32.cc
 /branches/3.29/src/mips/full-codegen-mips.cc
 /branches/3.29/src/mips64/full-codegen-mips64.cc
 /branches/3.29/src/objects.cc
 /branches/3.29/src/objects.h
 /branches/3.29/src/runtime.cc
 /branches/3.29/src/runtime.h
 /branches/3.29/src/version.cc
 /branches/3.29/src/x64/full-codegen-x64.cc
 /branches/3.29/test/mjsunit/sin-cos.js
 /branches/3.29/third_party/fdlibm/fdlibm.js

=======================================
--- /branches/3.29/src/arm/full-codegen-arm.cc  Tue Sep 23 08:38:19 2014 UTC
+++ /branches/3.29/src/arm/full-codegen-arm.cc  Mon Nov  3 12:05:50 2014 UTC
@@ -2787,12 +2787,15 @@


 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
-  // r4: copy of the first argument or undefined if it doesn't exist.
+  // r5: copy of the first argument or undefined if it doesn't exist.
   if (arg_count > 0) {
-    __ ldr(r4, MemOperand(sp, arg_count * kPointerSize));
+    __ ldr(r5, MemOperand(sp, arg_count * kPointerSize));
   } else {
-    __ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
+    __ LoadRoot(r5, Heap::kUndefinedValueRootIndex);
   }
+
+  // r4: the receiver of the enclosing function.
+  __ ldr(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));

   // r3: the receiver of the enclosing function.
   int receiver_offset = 2 + info_->scope()->num_parameters();
@@ -2805,8 +2808,9 @@
   __ mov(r1, Operand(Smi::FromInt(scope()->start_position())));

   // Do the runtime call.
+  __ Push(r5);
   __ Push(r4, r3, r2, r1);
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/src/arm64/full-codegen-arm64.cc Thu Sep 25 00:05:09 2014 UTC +++ /branches/3.29/src/arm64/full-codegen-arm64.cc Mon Nov 3 12:05:50 2014 UTC
@@ -2455,11 +2455,12 @@
// Prepare to push a copy of the first argument or undefined if it doesn't
   // exist.
   if (arg_count > 0) {
-    __ Peek(x10, arg_count * kXRegSize);
+    __ Peek(x9, arg_count * kXRegSize);
   } else {
-    __ LoadRoot(x10, Heap::kUndefinedValueRootIndex);
+    __ LoadRoot(x9, Heap::kUndefinedValueRootIndex);
   }

+  __ Ldr(x10, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
   // Prepare to push the receiver of the enclosing function.
   int receiver_offset = 2 + info_->scope()->num_parameters();
   __ Ldr(x11, MemOperand(fp, receiver_offset * kPointerSize));
@@ -2470,10 +2471,10 @@
   __ Mov(x13, Smi::FromInt(scope()->start_position()));

   // Push.
-  __ Push(x10, x11, x12, x13);
+  __ Push(x9, x10, x11, x12, x13);

   // Do the runtime call.
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/src/compilation-cache.cc     Tue Sep 23 08:38:19 2014 UTC
+++ /branches/3.29/src/compilation-cache.cc     Mon Nov  3 12:05:50 2014 UTC
@@ -221,10 +221,8 @@


 MaybeHandle<SharedFunctionInfo> CompilationCacheEval::Lookup(
-    Handle<String> source,
-    Handle<Context> context,
-    StrictMode strict_mode,
-    int scope_position) {
+    Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+    StrictMode strict_mode, int scope_position) {
   HandleScope scope(isolate());
   // Make sure not to leak the table into the surrounding handle
   // scope. Otherwise, we risk keeping old tables around even after
@@ -233,14 +231,14 @@
   int generation;
   for (generation = 0; generation < generations(); generation++) {
     Handle<CompilationCacheTable> table = GetTable(generation);
- result = table->LookupEval(source, context, strict_mode, scope_position); + result = table->LookupEval(source, outer_info, strict_mode, scope_position);
     if (result->IsSharedFunctionInfo()) break;
   }
   if (result->IsSharedFunctionInfo()) {
     Handle<SharedFunctionInfo> function_info =
         Handle<SharedFunctionInfo>::cast(result);
     if (generation != 0) {
-      Put(source, context, function_info, scope_position);
+      Put(source, outer_info, function_info, scope_position);
     }
     isolate()->counters()->compilation_cache_hits()->Increment();
     return scope.CloseAndEscape(function_info);
@@ -252,12 +250,12 @@


 void CompilationCacheEval::Put(Handle<String> source,
-                               Handle<Context> context,
+                               Handle<SharedFunctionInfo> outer_info,
                                Handle<SharedFunctionInfo> function_info,
                                int scope_position) {
   HandleScope scope(isolate());
   Handle<CompilationCacheTable> table = GetFirstTable();
-  table = CompilationCacheTable::PutEval(table, source, context,
+  table = CompilationCacheTable::PutEval(table, source, outer_info,
                                          function_info, scope_position);
   SetFirstTable(table);
 }
@@ -324,20 +322,18 @@


 MaybeHandle<SharedFunctionInfo> CompilationCache::LookupEval(
-    Handle<String> source,
-    Handle<Context> context,
-    StrictMode strict_mode,
-    int scope_position) {
+    Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+    Handle<Context> context, StrictMode strict_mode, int scope_position) {
   if (!IsEnabled()) return MaybeHandle<SharedFunctionInfo>();

   MaybeHandle<SharedFunctionInfo> result;
   if (context->IsNativeContext()) {
-    result = eval_global_.Lookup(
-        source, context, strict_mode, scope_position);
+    result =
+ eval_global_.Lookup(source, outer_info, strict_mode, scope_position);
   } else {
     DCHECK(scope_position != RelocInfo::kNoPosition);
-    result = eval_contextual_.Lookup(
-        source, context, strict_mode, scope_position);
+    result = eval_contextual_.Lookup(source, outer_info, strict_mode,
+                                     scope_position);
   }
   return result;
 }
@@ -361,6 +357,7 @@


 void CompilationCache::PutEval(Handle<String> source,
+                               Handle<SharedFunctionInfo> outer_info,
                                Handle<Context> context,
                                Handle<SharedFunctionInfo> function_info,
                                int scope_position) {
@@ -368,10 +365,10 @@

   HandleScope scope(isolate());
   if (context->IsNativeContext()) {
-    eval_global_.Put(source, context, function_info, scope_position);
+    eval_global_.Put(source, outer_info, function_info, scope_position);
   } else {
     DCHECK(scope_position != RelocInfo::kNoPosition);
-    eval_contextual_.Put(source, context, function_info, scope_position);
+ eval_contextual_.Put(source, outer_info, function_info, scope_position);
   }
 }

=======================================
--- /branches/3.29/src/compilation-cache.h      Tue Aug  5 00:05:55 2014 UTC
+++ /branches/3.29/src/compilation-cache.h      Mon Nov  3 12:05:50 2014 UTC
@@ -114,14 +114,12 @@
       : CompilationSubCache(isolate, generations) { }

   MaybeHandle<SharedFunctionInfo> Lookup(Handle<String> source,
-                                         Handle<Context> context,
+ Handle<SharedFunctionInfo> outer_info,
                                          StrictMode strict_mode,
                                          int scope_position);

-  void Put(Handle<String> source,
-           Handle<Context> context,
-           Handle<SharedFunctionInfo> function_info,
-           int scope_position);
+  void Put(Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+           Handle<SharedFunctionInfo> function_info, int scope_position);

  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheEval);
@@ -161,8 +159,8 @@
   // given context.  Returns an empty handle if the cache doesn't
   // contain a script for the given source string.
   MaybeHandle<SharedFunctionInfo> LookupEval(
- Handle<String> source, Handle<Context> context, StrictMode strict_mode,
-      int scope_position);
+      Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+      Handle<Context> context, StrictMode strict_mode, int scope_position);

   // Returns the regexp data associated with the given regexp if it
   // is in cache, otherwise an empty handle.
@@ -177,10 +175,9 @@

   // Associate the (source, context->closure()->shared(), kind) triple
   // with the shared function info. This may overwrite an existing mapping.
-  void PutEval(Handle<String> source,
+ void PutEval(Handle<String> source, Handle<SharedFunctionInfo> outer_info,
                Handle<Context> context,
-               Handle<SharedFunctionInfo> function_info,
-               int scope_position);
+ Handle<SharedFunctionInfo> function_info, int scope_position);

   // Associate the (source, flags) pair to the given regexp data.
   // This may overwrite an existing mapping.
=======================================
--- /branches/3.29/src/compiler/ast-graph-builder.cc Tue Sep 23 08:38:19 2014 UTC +++ /branches/3.29/src/compiler/ast-graph-builder.cc Mon Nov 3 12:05:50 2014 UTC
@@ -1265,12 +1265,14 @@

     // Create node to ask for help resolving potential eval call. This will
     // provide a fully resolved callee and the corresponding receiver.
+    Node* function = GetFunctionClosure();
     Node* receiver = environment()->Lookup(info()->scope()->receiver());
     Node* strict = jsgraph()->Constant(strict_mode());
Node* position = jsgraph()->Constant(info()->scope()->start_position());
     const Operator* op =
-        javascript()->Runtime(Runtime::kResolvePossiblyDirectEval, 5);
-    Node* pair = NewNode(op, callee, source, receiver, strict, position);
+        javascript()->Runtime(Runtime::kResolvePossiblyDirectEval, 6);
+    Node* pair =
+        NewNode(op, callee, source, function, receiver, strict, position);
     Node* new_callee = NewNode(common()->Projection(0), pair);
     Node* new_receiver = NewNode(common()->Projection(1), pair);

=======================================
--- /branches/3.29/src/compiler.cc      Fri Oct 17 15:50:51 2014 UTC
+++ /branches/3.29/src/compiler.cc      Mon Nov  3 12:05:50 2014 UTC
@@ -1084,11 +1084,9 @@


 MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
-    Handle<String> source,
-    Handle<Context> context,
-    StrictMode strict_mode,
-    ParseRestriction restriction,
-    int scope_position) {
+    Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+    Handle<Context> context, StrictMode strict_mode,
+    ParseRestriction restriction, int scope_position) {
   Isolate* isolate = source->GetIsolate();
   int source_length = source->length();
   isolate->counters()->total_eval_size()->Increment(source_length);
@@ -1096,7 +1094,7 @@

   CompilationCache* compilation_cache = isolate->compilation_cache();
   MaybeHandle<SharedFunctionInfo> maybe_shared_info =
-      compilation_cache->LookupEval(source, context, strict_mode,
+ compilation_cache->LookupEval(source, outer_info, context, strict_mode,
                                     scope_position);
   Handle<SharedFunctionInfo> shared_info;

@@ -1123,8 +1121,8 @@
// If caller is strict mode, the result must be in strict mode as well. DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT);
       if (!shared_info->dont_cache()) {
-        compilation_cache->PutEval(
-            source, context, shared_info, scope_position);
+ compilation_cache->PutEval(source, outer_info, context, shared_info,
+                                   scope_position);
       }
     }
   } else if (shared_info->ic_age() != isolate->heap()->global_ic_age()) {
=======================================
--- /branches/3.29/src/compiler.h       Fri Oct 17 15:50:51 2014 UTC
+++ /branches/3.29/src/compiler.h       Mon Nov  3 12:05:50 2014 UTC
@@ -682,11 +682,9 @@

   // Compile a String source within a context for eval.
   MUST_USE_RESULT static MaybeHandle<JSFunction> GetFunctionFromEval(
-      Handle<String> source,
-      Handle<Context> context,
-      StrictMode strict_mode,
-      ParseRestriction restriction,
-      int scope_position);
+      Handle<String> source, Handle<SharedFunctionInfo> outer_info,
+      Handle<Context> context, StrictMode strict_mode,
+      ParseRestriction restriction, int scope_position);

   // Compile a String source within a context.
   static Handle<SharedFunctionInfo> CompileScript(
=======================================
--- /branches/3.29/src/ia32/full-codegen-ia32.cc Tue Sep 23 08:38:19 2014 UTC +++ /branches/3.29/src/ia32/full-codegen-ia32.cc Mon Nov 3 12:05:50 2014 UTC
@@ -2708,6 +2708,8 @@
     __ push(Immediate(isolate()->factory()->undefined_value()));
   }

+  // Push the enclosing function.
+  __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
   // Push the receiver of the enclosing function.
__ push(Operand(ebp, (2 + info_->scope()->num_parameters()) * kPointerSize));
   // Push the language mode.
@@ -2717,7 +2719,7 @@
   __ push(Immediate(Smi::FromInt(scope()->start_position())));

   // Do the runtime call.
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/src/mips/full-codegen-mips.cc Wed Sep 24 00:05:07 2014 UTC +++ /branches/3.29/src/mips/full-codegen-mips.cc Mon Nov 3 12:05:50 2014 UTC
@@ -2264,23 +2264,26 @@
   Label gc_required;
   Label allocated;

-  Handle<Map> map(isolate()->native_context()->iterator_result_map());
+  const int instance_size = 5 * kPointerSize;
+ DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(),
+            instance_size);

-  __ Allocate(map->instance_size(), v0, a2, a3, &gc_required, TAG_OBJECT);
+  __ Allocate(instance_size, v0, a2, a3, &gc_required, TAG_OBJECT);
   __ jmp(&allocated);

   __ bind(&gc_required);
-  __ Push(Smi::FromInt(map->instance_size()));
+  __ Push(Smi::FromInt(instance_size));
   __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
   __ lw(context_register(),
         MemOperand(fp, StandardFrameConstants::kContextOffset));

   __ bind(&allocated);
-  __ li(a1, Operand(map));
+  __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
+  __ lw(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset));
+  __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
   __ pop(a2);
   __ li(a3, Operand(isolate()->factory()->ToBoolean(done)));
   __ li(t0, Operand(isolate()->factory()->empty_fixed_array()));
-  DCHECK_EQ(map->instance_size(), 5 * kPointerSize);
   __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
   __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset));
   __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
@@ -2769,12 +2772,15 @@


 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
-  // t2: copy of the first argument or undefined if it doesn't exist.
+  // t3: copy of the first argument or undefined if it doesn't exist.
   if (arg_count > 0) {
-    __ lw(t2, MemOperand(sp, arg_count * kPointerSize));
+    __ lw(t3, MemOperand(sp, arg_count * kPointerSize));
   } else {
-    __ LoadRoot(t2, Heap::kUndefinedValueRootIndex);
+    __ LoadRoot(t3, Heap::kUndefinedValueRootIndex);
   }
+
+  // t2: the receiver of the enclosing function.
+  __ lw(t2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));

   // t1: the receiver of the enclosing function.
   int receiver_offset = 2 + info_->scope()->num_parameters();
@@ -2787,8 +2793,9 @@
   __ li(a1, Operand(Smi::FromInt(scope()->start_position())));

   // Do the runtime call.
+  __ Push(t3);
   __ Push(t2, t1, t0, a1);
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/src/mips64/full-codegen-mips64.cc Wed Sep 24 00:05:07 2014 UTC +++ /branches/3.29/src/mips64/full-codegen-mips64.cc Mon Nov 3 12:05:50 2014 UTC
@@ -2261,23 +2261,26 @@
   Label gc_required;
   Label allocated;

-  Handle<Map> map(isolate()->native_context()->iterator_result_map());
+  const int instance_size = 5 * kPointerSize;
+ DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(),
+            instance_size);

-  __ Allocate(map->instance_size(), v0, a2, a3, &gc_required, TAG_OBJECT);
+  __ Allocate(instance_size, v0, a2, a3, &gc_required, TAG_OBJECT);
   __ jmp(&allocated);

   __ bind(&gc_required);
-  __ Push(Smi::FromInt(map->instance_size()));
+  __ Push(Smi::FromInt(instance_size));
   __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
   __ ld(context_register(),
         MemOperand(fp, StandardFrameConstants::kContextOffset));

   __ bind(&allocated);
-  __ li(a1, Operand(map));
+  __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
+  __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset));
+  __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
   __ pop(a2);
   __ li(a3, Operand(isolate()->factory()->ToBoolean(done)));
   __ li(a4, Operand(isolate()->factory()->empty_fixed_array()));
-  DCHECK_EQ(map->instance_size(), 5 * kPointerSize);
   __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
   __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset));
   __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset));
@@ -2769,12 +2772,15 @@


 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
-  // a6: copy of the first argument or undefined if it doesn't exist.
+  // a7: copy of the first argument or undefined if it doesn't exist.
   if (arg_count > 0) {
-    __ ld(a6, MemOperand(sp, arg_count * kPointerSize));
+    __ ld(a7, MemOperand(sp, arg_count * kPointerSize));
   } else {
-    __ LoadRoot(a6, Heap::kUndefinedValueRootIndex);
+    __ LoadRoot(a7, Heap::kUndefinedValueRootIndex);
   }
+
+  // a6: the receiver of the enclosing function.
+  __ ld(a6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));

   // a5: the receiver of the enclosing function.
   int receiver_offset = 2 + info_->scope()->num_parameters();
@@ -2787,8 +2793,9 @@
   __ li(a1, Operand(Smi::FromInt(scope()->start_position())));

   // Do the runtime call.
+  __ Push(a7);
   __ Push(a6, a5, a4, a1);
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/src/objects.cc       Thu Sep 25 00:05:09 2014 UTC
+++ /branches/3.29/src/objects.cc       Mon Nov  3 12:05:50 2014 UTC
@@ -14724,13 +14724,13 @@
 }


-Handle<Object> CompilationCacheTable::LookupEval(Handle<String> src,
-                                                 Handle<Context> context,
-                                                 StrictMode strict_mode,
-                                                 int scope_position) {
+Handle<Object> CompilationCacheTable::LookupEval(
+    Handle<String> src, Handle<SharedFunctionInfo> outer_info,
+    StrictMode strict_mode, int scope_position) {
   Isolate* isolate = GetIsolate();
-  Handle<SharedFunctionInfo> shared(context->closure()->shared());
-  StringSharedKey key(src, shared, strict_mode, scope_position);
+ // Cache key is the tuple (source, outer shared function info, scope position) + // to unambiguously identify the context chain the cached eval code assumes.
+  StringSharedKey key(src, outer_info, strict_mode, scope_position);
   int entry = FindEntry(&key);
   if (entry == kNotFound) return isolate->factory()->undefined_value();
   return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
@@ -14767,11 +14767,10 @@

 Handle<CompilationCacheTable> CompilationCacheTable::PutEval(
     Handle<CompilationCacheTable> cache, Handle<String> src,
-    Handle<Context> context, Handle<SharedFunctionInfo> value,
+ Handle<SharedFunctionInfo> outer_info, Handle<SharedFunctionInfo> value,
     int scope_position) {
   Isolate* isolate = cache->GetIsolate();
-  Handle<SharedFunctionInfo> shared(context->closure()->shared());
-  StringSharedKey key(src, shared, value->strict_mode(), scope_position);
+ StringSharedKey key(src, outer_info, value->strict_mode(), scope_position);
   cache = EnsureCapacity(cache, 1, &key);
   Handle<Object> k = key.AsHandle(isolate);
   int entry = cache->FindInsertionEntry(key.Hash());
=======================================
--- /branches/3.29/src/objects.h        Thu Sep 25 00:05:09 2014 UTC
+++ /branches/3.29/src/objects.h        Mon Nov  3 12:05:50 2014 UTC
@@ -7863,15 +7863,16 @@
  public:
   // Find cached value for a string key, otherwise return null.
   Handle<Object> Lookup(Handle<String> src, Handle<Context> context);
-  Handle<Object> LookupEval(Handle<String> src, Handle<Context> context,
-                     StrictMode strict_mode, int scope_position);
+  Handle<Object> LookupEval(Handle<String> src,
+                            Handle<SharedFunctionInfo> shared,
+                            StrictMode strict_mode, int scope_position);
Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags);
   static Handle<CompilationCacheTable> Put(
       Handle<CompilationCacheTable> cache, Handle<String> src,
       Handle<Context> context, Handle<Object> value);
   static Handle<CompilationCacheTable> PutEval(
       Handle<CompilationCacheTable> cache, Handle<String> src,
-      Handle<Context> context, Handle<SharedFunctionInfo> value,
+      Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value,
       int scope_position);
   static Handle<CompilationCacheTable> PutRegExp(
       Handle<CompilationCacheTable> cache, Handle<String> src,
=======================================
--- /branches/3.29/src/runtime.cc       Thu Sep 25 00:05:09 2014 UTC
+++ /branches/3.29/src/runtime.cc       Mon Nov  3 12:05:50 2014 UTC
@@ -9894,17 +9894,20 @@
   // Compile source string in the native context.
   ParseRestriction restriction = function_literal_only
       ? ONLY_SINGLE_FUNCTION_LITERAL : NO_PARSE_RESTRICTION;
+ Handle<SharedFunctionInfo> outer_info(context->closure()->shared(), isolate);
   Handle<JSFunction> fun;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
       isolate, fun,
       Compiler::GetFunctionFromEval(
-          source, context, SLOPPY, restriction, RelocInfo::kNoPosition));
+          source, outer_info,
+          context, SLOPPY, restriction, RelocInfo::kNoPosition));
   return *fun;
 }


 static ObjectPair CompileGlobalEval(Isolate* isolate,
                                     Handle<String> source,
+                                    Handle<SharedFunctionInfo> outer_info,
                                     Handle<Object> receiver,
                                     StrictMode strict_mode,
                                     int scope_position) {
@@ -9931,7 +9934,8 @@
   ASSIGN_RETURN_ON_EXCEPTION_VALUE(
       isolate, compiled,
       Compiler::GetFunctionFromEval(
-          source, context, strict_mode, restriction, scope_position),
+          source, outer_info,
+          context, strict_mode, restriction, scope_position),
       MakePair(isolate->heap()->exception(), NULL));
   return MakePair(*compiled, *receiver);
 }
@@ -9939,7 +9943,7 @@

 RUNTIME_FUNCTION_RETURN_PAIR(Runtime_ResolvePossiblyDirectEval) {
   HandleScope scope(isolate);
-  DCHECK(args.length() == 5);
+  DCHECK(args.length() == 6);

   Handle<Object> callee = args.at<Object>(0);

@@ -9953,15 +9957,18 @@
     return MakePair(*callee, isolate->heap()->undefined_value());
   }

-  DCHECK(args[3]->IsSmi());
-  DCHECK(args.smi_at(3) == SLOPPY || args.smi_at(3) == STRICT);
-  StrictMode strict_mode = static_cast<StrictMode>(args.smi_at(3));
   DCHECK(args[4]->IsSmi());
+  DCHECK(args.smi_at(4) == SLOPPY || args.smi_at(4) == STRICT);
+  StrictMode strict_mode = static_cast<StrictMode>(args.smi_at(4));
+  DCHECK(args[5]->IsSmi());
+  Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(),
+                                        isolate);
   return CompileGlobalEval(isolate,
                            args.at<String>(1),
-                           args.at<Object>(2),
+                           outer_info,
+                           args.at<Object>(3),
                            strict_mode,
-                           args.smi_at(4));
+                           args.smi_at(5));
 }


@@ -12968,6 +12975,7 @@

 // Compile and evaluate source for the given context.
 static MaybeHandle<Object> DebugEvaluate(Isolate* isolate,
+ Handle<SharedFunctionInfo> outer_info,
                                          Handle<Context> context,
                                          Handle<Object> context_extension,
                                          Handle<Object> receiver,
@@ -12982,6 +12990,7 @@
   ASSIGN_RETURN_ON_EXCEPTION(
       isolate, eval_fun,
       Compiler::GetFunctionFromEval(source,
+                                    outer_info,
                                     context,
                                     SLOPPY,
                                     NO_PARSE_RESTRICTION,
@@ -13047,6 +13056,7 @@
   JavaScriptFrame* frame = it.frame();
   FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
+  Handle<SharedFunctionInfo> outer_info(function->shared());

   // Traverse the saved contexts chain to find the active context for the
   // selected frame.
@@ -13078,7 +13088,8 @@
   Handle<Object> result;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
       isolate, result,
- DebugEvaluate(isolate, context, context_extension, receiver, source));
+      DebugEvaluate(isolate, outer_info,
+                    context, context_extension, receiver, source));

// Write back potential changes to materialized stack locals to the stack.
   UpdateStackLocalsFromMaterializedObject(
@@ -13118,10 +13129,12 @@
   // debugger was invoked.
   Handle<Context> context = isolate->native_context();
   Handle<JSObject> receiver(context->global_proxy());
+ Handle<SharedFunctionInfo> outer_info(context->closure()->shared(), isolate);
   Handle<Object> result;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
       isolate, result,
- DebugEvaluate(isolate, context, context_extension, receiver, source));
+      DebugEvaluate(isolate, outer_info,
+                    context, context_extension, receiver, source));
   return *result;
 }

=======================================
--- /branches/3.29/src/runtime.h        Tue Sep 23 08:38:19 2014 UTC
+++ /branches/3.29/src/runtime.h        Mon Nov  3 12:05:50 2014 UTC
@@ -507,7 +507,7 @@
   F(InitializeLegacyConstLookupSlot, 3, 1)                   \
                                                              \
   /* Eval */                                                 \
-  F(ResolvePossiblyDirectEval, 5, 2)                         \
+  F(ResolvePossiblyDirectEval, 6, 2)                         \
                                                              \
   /* Maths */                                                \
   F(MathPowSlow, 2, 1)                                       \
=======================================
--- /branches/3.29/src/version.cc       Fri Oct 31 14:26:47 2014 UTC
+++ /branches/3.29/src/version.cc       Mon Nov  3 12:05:50 2014 UTC
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     29
 #define BUILD_NUMBER      88
-#define PATCH_LEVEL       11
+#define PATCH_LEVEL       12
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.29/src/x64/full-codegen-x64.cc  Tue Sep 23 08:38:19 2014 UTC
+++ /branches/3.29/src/x64/full-codegen-x64.cc  Mon Nov  3 12:05:50 2014 UTC
@@ -2702,6 +2702,9 @@
   } else {
     __ PushRoot(Heap::kUndefinedValueRootIndex);
   }
+
+  // Push the enclosing function.
+  __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));

   // Push the receiver of the enclosing function and do runtime call.
   StackArgumentsAccessor args(rbp, info_->scope()->num_parameters());
@@ -2714,7 +2717,7 @@
   __ Push(Smi::FromInt(scope()->start_position()));

   // Do the runtime call.
-  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
+  __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
 }


=======================================
--- /branches/3.29/test/mjsunit/sin-cos.js      Thu Aug  7 08:39:21 2014 UTC
+++ /branches/3.29/test/mjsunit/sin-cos.js      Mon Nov  3 12:05:50 2014 UTC
@@ -227,6 +227,8 @@
 assertEquals(0.8211418015898941, Math.tan(11/16));
 assertEquals(-0.8211418015898941, Math.tan(-11/16));
 assertEquals(0.41421356237309503, Math.tan(Math.PI / 8));
+// crbug/427468
+assertEquals(0.7993357819992383, Math.tan(0.6743358));

 // Tests for Math.sin.
 assertEquals(0.479425538604203, Math.sin(0.5));
=======================================
--- /branches/3.29/third_party/fdlibm/fdlibm.js Tue Sep  2 12:59:15 2014 UTC
+++ /branches/3.29/third_party/fdlibm/fdlibm.js Mon Nov  3 12:05:50 2014 UTC
@@ -267,7 +267,7 @@
       }
     }
   }
-  if (ix >= 0x3fe59429) {  // |x| > .6744
+  if (ix >= 0x3fe59428) {  // |x| > .6744
     if (x < 0) {
       x = -x;
       y = -y;
@@ -362,9 +362,9 @@
 // ES6 draft 09-27-13, section 20.2.2.20.
 // Math.log1p
 //
-// Method :
-//   1. Argument Reduction: find k and f such that
-//                      1+x = 2^k * (1+f),
+// Method :
+//   1. Argument Reduction: find k and f such that
+//                      1+x = 2^k * (1+f),
 //         where  sqrt(2)/2 < 1+f < sqrt(2) .
 //
 //      Note. If k=0, then f=x is exact. However, if k!=0, then f
@@ -378,8 +378,8 @@
 //      Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
 //            = 2s + 2/3 s**3 + 2/5 s**5 + .....,
 //            = 2s + s*R
-//      We use a special Reme algorithm on [0,0.1716] to generate
-//      a polynomial of degree 14 to approximate R The maximum error
+//      We use a special Reme algorithm on [0,0.1716] to generate
+//      a polynomial of degree 14 to approximate R The maximum error
 //      of this polynomial approximation is bounded by 2**-58.45. In
 //      other words,
 //                      2      4      6      8      10      12      14
@@ -387,21 +387,21 @@
 //      (the values of Lp1 to Lp7 are listed in the program)
 //      and
 //          |      2          14          |     -58.45
-//          | Lp1*s +...+Lp7*s    -  R(z) | <= 2
+//          | Lp1*s +...+Lp7*s    -  R(z) | <= 2
 //          |                             |
 //      Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
 //      In order to guarantee error in log below 1ulp, we compute log
 //      by
 //              log1p(f) = f - (hfsq - s*(hfsq+R)).
 //
-//      3. Finally, log1p(x) = k*ln2 + log1p(f).
+//      3. Finally, log1p(x) = k*ln2 + log1p(f).
 //                           = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
-//         Here ln2 is split into two floating point number:
+//         Here ln2 is split into two floating point number:
 //                      ln2_hi + ln2_lo,
 //         where n*ln2_hi is always exact for |n| < 2000.
 //
 // Special cases:
-//      log1p(x) is NaN with signal if x < -1 (including -INF) ;
+//      log1p(x) is NaN with signal if x < -1 (including -INF) ;
 //      log1p(+INF) is +INF; log1p(-1) is -INF with signal;
 //      log1p(NaN) is that NaN with no signal.
 //
@@ -506,7 +506,7 @@
     }
   }

-  var s = f / (2 + f);
+  var s = f / (2 + f);
   var z = s * s;
   var R = z * (KLOG1P(0) + z * (KLOG1P(1) + z *
               (KLOG1P(2) + z * (KLOG1P(3) + z *
@@ -526,9 +526,9 @@
 //   1. Argument reduction:
 //      Given x, find r and integer k such that
 //
-//               x = k*ln2 + r,  |r| <= 0.5*ln2 ~ 0.34658
+//               x = k*ln2 + r,  |r| <= 0.5*ln2 ~ 0.34658
 //
-//      Here a correction term c will be computed to compensate
+//      Here a correction term c will be computed to compensate
 //      the error in r when rounded to a floating-point number.
 //
 //   2. Approximating expm1(r) by a special rational function on
@@ -541,9 +541,9 @@
 //          R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r)
 //                   = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r))
 //                   = 1 - r^2/60 + r^4/2520 - r^6/100800 + ...
-//      We use a special Remes algorithm on [0,0.347] to generate
-//      a polynomial of degree 5 in r*r to approximate R1. The
-//      maximum error of this polynomial approximation is bounded
+//      We use a special Remes algorithm on [0,0.347] to generate
+//      a polynomial of degree 5 in r*r to approximate R1. The
+//      maximum error of this polynomial approximation is bounded
 //      by 2**-61. In other words,
 //          R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5
 //      where   Q1  =  -1.6666666666666567384E-2,
@@ -554,21 +554,21 @@
 //      (where z=r*r, and the values of Q1 to Q5 are listed below)
 //      with error bounded by
 //          |                  5           |     -61
-//          | 1.0+Q1*z+...+Q5*z   -  R1(z) | <= 2
+//          | 1.0+Q1*z+...+Q5*z   -  R1(z) | <= 2
 //          |                              |
 //
-//      expm1(r) = exp(r)-1 is then computed by the following
-//      specific way which minimize the accumulation rounding error:
+//      expm1(r) = exp(r)-1 is then computed by the following
+//      specific way which minimize the accumulation rounding error:
 //                             2     3
 //                            r     r    [ 3 - (R1 + R1*r/2)  ]
 //            expm1(r) = r + --- + --- * [--------------------]
 //                            2     2    [ 6 - r*(3 - R1*r/2) ]
 //
 //      To compensate the error in the argument reduction, we use
-//              expm1(r+c) = expm1(r) + c + expm1(r)*c
-//                         ~ expm1(r) + c + r*c
+//              expm1(r+c) = expm1(r) + c + expm1(r)*c
+//                         ~ expm1(r) + c + r*c
 //      Thus c+r*c will be added in as the correction terms for
-//      expm1(r+c). Now rearrange the term to avoid optimization
+//      expm1(r+c). Now rearrange the term to avoid optimization
 //      screw up:
 //                      (      2                                    2 )
 //                      ({  ( r    [ R1 -  (3 - R1*r/2) ]  )  }    r  )
@@ -592,7 +592,7 @@
 //                     else          return  1.0+2.0*(r-E);
 //        (v)   if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1)
 //        (vi)  if k <= 20, return 2^k((1-2^-k)-(E-r)), else
-//        (vii) return 2^k(1-((E+2^-k)-r))
+//        (vii) return 2^k(1-((E+2^-k)-r))
 //
 // Special cases:
 //      expm1(INF) is INF, expm1(NaN) is NaN;
@@ -604,7 +604,7 @@
 //      1 ulp (unit in the last place).
 //
 // Misc. info.
-//      For IEEE double
+//      For IEEE double
 //          if x > 7.09782712893383973096e+02 then expm1(x) overflow
 //
 const KEXPM1_OVERFLOW = kMath[45];
@@ -621,7 +621,7 @@
   var k;
   var t;
   var c;
-
+
   var hx = %_DoubleHi(x);
   var xsb = hx & 0x80000000;     // Sign bit of x
   var y = (xsb === 0) ? x : -x;  // y = |x|
@@ -722,7 +722,7 @@
// 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
 //                                                      2
 //
-//          22       <= x <= lnovft :  sinh(x) := exp(x)/2
+//          22       <= x <= lnovft :  sinh(x) := exp(x)/2
 //          lnovft   <= x <= ln2ovft:  sinh(x) := exp(x/2)/2 * exp(x/2)
 //          ln2ovft  <  x           :  sinh(x) := x*shuge (overflow)
 //
@@ -763,18 +763,18 @@

 // ES6 draft 09-27-13, section 20.2.2.12.
 // Math.cosh
-// Method :
+// Method :
 // mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
-//      1. Replace x by |x| (cosh(x) = cosh(-x)).
+//      1. Replace x by |x| (cosh(x) = cosh(-x)).
 //      2.
-//                                                      [ exp(x) - 1 ]^2
+//                                                      [ exp(x) - 1 ]^2
 //          0        <= x <= ln2/2  :  cosh(x) := 1 + -------------------
 //                                                         2*exp(x)
 //
 //                                                 exp(x) + 1/exp(x)
 //          ln2/2    <= x <= 22     :  cosh(x) := -------------------
 //                                                        2
-//          22       <= x <= lnovft :  cosh(x) := exp(x)/2
+//          22       <= x <= lnovft :  cosh(x) := exp(x)/2
 //          lnovft   <= x <= ln2ovft:  cosh(x) := exp(x/2)/2 * exp(x/2)
 //          ln2ovft  <  x           :  cosh(x) := huge*huge (overflow)
 //

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to