Revision: 23274
Author:   [email protected]
Date:     Thu Aug 21 12:39:33 2014 UTC
Log:      Implement Function.prototype.toMethod.

[email protected], [email protected]
BUG=v8:3330
LOG=N

Review URL: https://codereview.chromium.org/475423003
http://code.google.com/p/v8/source/detail?r=23274

Added:
 /branches/bleeding_edge/src/harmony-classes.js
 /branches/bleeding_edge/test/mjsunit/harmony/toMethod.js
 /branches/bleeding_edge/test/mjsunit/runtime-gen/homeobjectsymbol.js
 /branches/bleeding_edge/test/mjsunit/runtime-gen/tomethod.js
Modified:
 /branches/bleeding_edge/BUILD.gn
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/heap/heap.cc
 /branches/bleeding_edge/src/heap/heap.h
 /branches/bleeding_edge/src/messages.js
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/runtime.h
 /branches/bleeding_edge/tools/generate-runtime-tests.py
 /branches/bleeding_edge/tools/gyp/v8.gyp

=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/harmony-classes.js Thu Aug 21 12:39:33 2014 UTC
@@ -0,0 +1,32 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// This file relies on the fact that the following declarations have been made
+// in runtime.js:
+// var $Function = global.Function;
+// var $Array = global.Array;
+
+
+(function() {
+  function FunctionToMethod(homeObject) {
+    if (!IS_SPEC_FUNCTION(this)) {
+      throw MakeTypeError('toMethod_non_function',
+                          [%ToString(this), typeof this]);
+
+    }
+
+    if (!IS_SPEC_OBJECT(homeObject)) {
+      throw MakeTypeError('toMethod_non_object',
+                          [%ToString(homeObject)]);
+    }
+
+    return %ToMethod(this, homeObject);
+  }
+
+  %CheckIsBootstrapping();
+
+  InstallFunctions($Function.prototype, DONT_ENUM, $Array(
+      "toMethod", FunctionToMethod
+  ));
+}());
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/harmony/toMethod.js Thu Aug 21 12:39:33 2014 UTC
@@ -0,0 +1,115 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Flags: --harmony-classes --allow-natives-syntax
+
+
+(function TestSingleClass() {
+  function f(x) {
+    var a = [0, 1, 2]
+    return a[x];
+  }
+
+  function ClassD() { }
+
+  assertEquals(1, f(1));
+  var g = f.toMethod(ClassD.prototype);
+  assertEquals(1, g(1));
+  assertEquals(undefined, f[%HomeObjectSymbol()]);
+  assertEquals(ClassD.prototype, g[%HomeObjectSymbol()]);
+}());
+
+
+(function TestClassHierarchy() {
+  function f(x) {
+    return function g(y)  { x++; return x + y; };
+  }
+
+  function Base() {}
+  function Derived() { }
+  Derived.prototype = Object.create(Base.prototype);
+
+  var q = f(0);
+  assertEquals(2, q(1));
+  assertEquals(3, q(1));
+  var g = q.toMethod(Derived.prototype);
+  assertFalse(g === q);
+  assertEquals(4, g(1));
+  assertEquals(5, q(1));
+}());
+
+
+(function TestErrorCases() {
+  var sFun = Function.prototype.toMethod;
+  assertThrows(function() { sFun.call({}); }, TypeError);
+  assertThrows(function() { sFun.call({}, {}); }, TypeError);
+  function f(){};
+  assertThrows(function() { f.toMethod(1); }, TypeError);
+}());
+
+
+(function TestPrototypeChain() {
+  var o = {};
+  var o1 = {};
+  function f() { }
+
+  function g() { }
+
+  var fMeth = f.toMethod(o);
+  assertEquals(o, fMeth[%HomeObjectSymbol()]);
+  g.__proto__ = fMeth;
+  assertEquals(undefined, g[%HomeObjectSymbol()]);
+  var gMeth = g.toMethod(o1);
+  assertEquals(fMeth, gMeth.__proto__);
+  assertEquals(o, fMeth[%HomeObjectSymbol()]);
+  assertEquals(o1, gMeth[%HomeObjectSymbol()]);
+}());
+
+
+(function TestBoundFunction() {
+  var o = {};
+  var p = {};
+
+
+  function f(x, y, z, w) {
+    assertEquals(o, this);
+    assertEquals(1, x);
+    assertEquals(2, y);
+    assertEquals(3, z);
+    assertEquals(4, w);
+    return x+y+z+w;
+  }
+
+  var fBound = f.bind(o, 1, 2, 3);
+  var fMeth = fBound.toMethod(p);
+  assertEquals(10, fMeth(4));
+  assertEquals(10, fMeth.call(p, 4));
+  var fBound1 = fBound.bind(o, 4);
+  assertEquals(10, fBound1());
+  var fMethBound = fMeth.bind(o, 4);
+  assertEquals(10, fMethBound());
+}());
+
+(function TestOptimized() {
+  function f(o) {
+    return o.x;
+  }
+  var o = {x : 15};
+  assertEquals(15, f(o));
+  assertEquals(15, f(o));
+  %OptimizeFunctionOnNextCall(f);
+  assertEquals(15, f(o));
+  var g = f.toMethod({});
+  var o1 = {y : 1024, x : "abc"};
+  assertEquals("abc", f(o1));
+  assertEquals("abc", g(o1));
+} ());
+
+(function TestExtensibility() {
+  function f() {}
+  Object.preventExtensions(f);
+  assertFalse(Object.isExtensible(f));
+  var m = f.toMethod({});
+  assertTrue(Object.isExtensible(m));
+}());
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/runtime-gen/homeobjectsymbol.js Thu Aug 21 12:39:33 2014 UTC
@@ -0,0 +1,4 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
+// Flags: --allow-natives-syntax --harmony --harmony-proxies
+%HomeObjectSymbol();
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/runtime-gen/tomethod.js Thu Aug 21 12:39:33 2014 UTC
@@ -0,0 +1,6 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
+// Flags: --allow-natives-syntax --harmony --harmony-proxies
+var _fun = function() {};
+var _home_object = new Object();
+%ToMethod(_fun, _home_object);
=======================================
--- /branches/bleeding_edge/BUILD.gn    Wed Aug 20 13:17:59 2014 UTC
+++ /branches/bleeding_edge/BUILD.gn    Thu Aug 21 12:39:33 2014 UTC
@@ -242,6 +242,7 @@
     "src/generator.js",
     "src/harmony-string.js",
     "src/harmony-array.js",
+    "src/harmony-classes.js",
   ]

   outputs = [
=======================================
--- /branches/bleeding_edge/include/v8.h        Wed Aug 20 15:25:13 2014 UTC
+++ /branches/bleeding_edge/include/v8.h        Thu Aug 21 12:39:33 2014 UTC
@@ -5669,7 +5669,7 @@
   static const int kNullValueRootIndex = 7;
   static const int kTrueValueRootIndex = 8;
   static const int kFalseValueRootIndex = 9;
-  static const int kEmptyStringRootIndex = 161;
+  static const int kEmptyStringRootIndex = 162;

// The external allocation limit should be below 256 MB on all architectures
   // to avoid that resource-constrained embedders run low on memory.
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Thu Aug 21 08:16:06 2014 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Thu Aug 21 12:39:33 2014 UTC
@@ -2063,6 +2063,7 @@
     INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js")
     INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js")
     INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js")
+    INSTALL_EXPERIMENTAL_NATIVE(i, classes, "harmony-classes.js")
   }

   InstallExperimentalNativeFunctions();
=======================================
--- /branches/bleeding_edge/src/heap/heap.cc    Wed Aug 20 15:37:43 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.cc    Thu Aug 21 12:39:33 2014 UTC
@@ -2878,6 +2878,7 @@
   set_observed_symbol(*factory->NewPrivateSymbol());
   set_stack_trace_symbol(*factory->NewPrivateSymbol());
   set_uninitialized_symbol(*factory->NewPrivateSymbol());
+  set_home_object_symbol(*factory->NewPrivateOwnSymbol());

   Handle<SeededNumberDictionary> slow_element_dictionary =
       SeededNumberDictionary::New(isolate(), 0, TENURED);
=======================================
--- /branches/bleeding_edge/src/heap/heap.h     Wed Aug 20 10:33:03 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.h     Thu Aug 21 12:39:33 2014 UTC
@@ -185,6 +185,7 @@
V(Symbol, stack_trace_symbol, StackTraceSymbol) \ V(Symbol, detailed_stack_trace_symbol, DetailedStackTraceSymbol) \ V(Symbol, normal_ic_symbol, NormalICSymbol) \ + V(Symbol, home_object_symbol, HomeObjectSymbol) \ V(FixedArray, materialized_objects, MaterializedObjects) \ V(FixedArray, allocation_sites_scratchpad, AllocationSitesScratchpad) \
   V(FixedArray, microtask_queue, MicrotaskQueue)
=======================================
--- /branches/bleeding_edge/src/messages.js     Mon Aug 18 12:35:34 2014 UTC
+++ /branches/bleeding_edge/src/messages.js     Thu Aug 21 12:39:33 2014 UTC
@@ -44,6 +44,8 @@
no_setter_in_callback: ["Cannot set property ", "%0", " of ", "%1", " which has only a getter"], apply_non_function: ["Function.prototype.apply was called on ", "%0", ", which is a ", "%1", " and not a function"], apply_wrong_args: ["Function.prototype.apply: Arguments list has wrong type"], + toMethod_non_function: ["Function.prototype.toMethod was called on ", "%0", ", which is a ", "%1", " and not a function"], + toMethod_non_object: ["Function.prototype.toMethod: home object ", "%0", " is not an object"], invalid_in_operator_use: ["Cannot use 'in' operator to search for '", "%0", "' in ", "%1"], instanceof_function_expected: ["Expecting a function in instanceof check, but got ", "%0"], instanceof_nonobject_proto: ["Function has non-object prototype '", "%0", "' in instanceof check"],
=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Aug 21 09:34:47 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Thu Aug 21 12:39:33 2014 UTC
@@ -9282,6 +9282,30 @@
       GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue));
   // No write barrier required, since the builtin is part of the root set.
 }
+
+
+Handle<JSFunction> JSFunction::CloneClosure(Handle<JSFunction> function) {
+  Isolate* isolate = function->GetIsolate();
+  Handle<Map> map(function->map());
+  Handle<SharedFunctionInfo> shared(function->shared());
+  Handle<Context> context(function->context());
+  Handle<JSFunction> clone =
+ isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context);
+
+  if (shared->bound()) {
+    clone->set_function_bindings(function->function_bindings());
+  }
+
+  // In typical case, __proto__ of ``function`` is the default Function
+  // prototype, which means that SetPrototype below is a no-op.
+  // In rare cases when that is not true, we mutate the clone's __proto__.
+  Handle<Object> original_prototype(map->prototype(), isolate);
+  if (*original_prototype != clone->map()->prototype()) {
+    JSObject::SetPrototype(clone, original_prototype, false).Assert();
+  }
+
+  return clone;
+}


 void SharedFunctionInfo::AddToOptimizedCodeMap(
=======================================
--- /branches/bleeding_edge/src/objects.h       Wed Aug 20 16:25:40 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Thu Aug 21 12:39:33 2014 UTC
@@ -7711,6 +7711,11 @@
   static void SetInstancePrototype(Handle<JSFunction> function,
                                    Handle<Object> value);

+  // Creates a new closure for the fucntion with the same bindings,
+  // bound values, and prototype. An equivalent of spec operations
+  // ``CloneMethod`` and ``CloneBoundFunction``.
+  static Handle<JSFunction> CloneClosure(Handle<JSFunction> function);
+
   // After prototype is removed, it will not be created when accessed, and
   // [[Construct]] from this function will not be allowed.
   bool RemovePrototype();
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Thu Aug 21 08:19:05 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Thu Aug 21 12:39:33 2014 UTC
@@ -2049,6 +2049,25 @@
       isolate, result, JSObject::PreventExtensions(obj));
   return *result;
 }
+
+
+RUNTIME_FUNCTION(Runtime_ToMethod) {
+  HandleScope scope(isolate);
+  DCHECK(args.length() == 2);
+  CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
+  CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
+  Handle<JSFunction> clone = JSFunction::CloneClosure(fun);
+  Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol());
+  JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol,
+ home_object, DONT_ENUM).Assert();
+  return *clone;
+}
+
+
+RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) {
+  DCHECK(args.length() == 0);
+  return isolate->heap()->home_object_symbol();
+}


 RUNTIME_FUNCTION(Runtime_IsExtensible) {
=======================================
--- /branches/bleeding_edge/src/runtime.h       Wed Aug 20 19:21:56 2014 UTC
+++ /branches/bleeding_edge/src/runtime.h       Thu Aug 21 12:39:33 2014 UTC
@@ -21,165 +21,169 @@
// WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused // MSVC Intellisense to crash. It was broken into two macros to work around
 // this problem. Please avoid large recursive macros whenever possible.
-#define RUNTIME_FUNCTION_LIST_ALWAYS_1(F)                   \
-  /* Property access */                                     \
-  F(GetProperty, 2, 1)                                      \
-  F(KeyedGetProperty, 2, 1)                                 \
-  F(DeleteProperty, 3, 1)                                   \
-  F(HasOwnProperty, 2, 1)                                   \
-  F(HasProperty, 2, 1)                                      \
-  F(HasElement, 2, 1)                                       \
-  F(IsPropertyEnumerable, 2, 1)                             \
-  F(GetPropertyNames, 1, 1)                                 \
-  F(GetPropertyNamesFast, 1, 1)                             \
-  F(GetOwnPropertyNames, 2, 1)                              \
-  F(GetOwnElementNames, 1, 1)                               \
-  F(GetInterceptorInfo, 1, 1)                               \
-  F(GetNamedInterceptorPropertyNames, 1, 1)                 \
-  F(GetIndexedInterceptorElementNames, 1, 1)                \
-  F(GetArgumentsProperty, 1, 1)                             \
-  F(ToFastProperties, 1, 1)                                 \
-  F(FinishArrayPrototypeSetup, 1, 1)                        \
-  F(SpecialArrayFunctions, 0, 1)                            \
-  F(IsSloppyModeFunction, 1, 1)                             \
-  F(GetDefaultReceiver, 1, 1)                               \
-                                                            \
-  F(GetPrototype, 1, 1)                                     \
-  F(SetPrototype, 2, 1)                                     \
-  F(InternalSetPrototype, 2, 1)                             \
-  F(IsInPrototypeChain, 2, 1)                               \
-                                                            \
-  F(GetOwnProperty, 2, 1)                                   \
-                                                            \
-  F(IsExtensible, 1, 1)                                     \
-  F(PreventExtensions, 1, 1)                                \
-                                                            \
-  /* Utilities */                                           \
-  F(CheckIsBootstrapping, 0, 1)                             \
-  F(GetRootNaN, 0, 1)                                       \
-  F(Call, -1 /* >= 2 */, 1)                                 \
-  F(Apply, 5, 1)                                            \
-  F(GetFunctionDelegate, 1, 1)                              \
-  F(GetConstructorDelegate, 1, 1)                           \
-  F(DeoptimizeFunction, 1, 1)                               \
-  F(ClearFunctionTypeFeedback, 1, 1)                        \
-  F(RunningInSimulator, 0, 1)                               \
-  F(IsConcurrentRecompilationSupported, 0, 1)               \
-  F(OptimizeFunctionOnNextCall, -1, 1)                      \
-  F(NeverOptimizeFunction, 1, 1)                            \
-  F(GetOptimizationStatus, -1, 1)                           \
-  F(GetOptimizationCount, 1, 1)                             \
-  F(UnblockConcurrentRecompilation, 0, 1)                   \
-  F(CompileForOnStackReplacement, 1, 1)                     \
-  F(SetAllocationTimeout, -1 /* 2 || 3 */, 1)               \
-  F(SetNativeFlag, 1, 1)                                    \
-  F(SetInlineBuiltinFlag, 1, 1)                             \
-  F(StoreArrayLiteralElement, 5, 1)                         \
-  F(DebugPrepareStepInIfStepping, 1, 1)                     \
-  F(DebugPushPromise, 1, 1)                                 \
-  F(DebugPopPromise, 0, 1)                                  \
-  F(DebugPromiseEvent, 1, 1)                                \
-  F(DebugPromiseRejectEvent, 2, 1)                          \
-  F(DebugAsyncTaskEvent, 1, 1)                              \
-  F(FlattenString, 1, 1)                                    \
-  F(LoadMutableDouble, 2, 1)                                \
-  F(TryMigrateInstance, 1, 1)                               \
-  F(NotifyContextDisposed, 0, 1)                            \
-                                                            \
-  /* Array join support */                                  \
-  F(PushIfAbsent, 2, 1)                                     \
-  F(ArrayConcat, 1, 1)                                      \
-                                                            \
-  /* Conversions */                                         \
-  F(ToBool, 1, 1)                                           \
-  F(Typeof, 1, 1)                                           \
-                                                            \
-  F(Booleanize, 2, 1) /* TODO(turbofan): Only temporary */  \
-                                                            \
-  F(StringToNumber, 1, 1)                                   \
-  F(StringParseInt, 2, 1)                                   \
-  F(StringParseFloat, 1, 1)                                 \
-  F(StringToLowerCase, 1, 1)                                \
-  F(StringToUpperCase, 1, 1)                                \
-  F(StringSplit, 3, 1)                                      \
-  F(CharFromCode, 1, 1)                                     \
-  F(URIEscape, 1, 1)                                        \
-  F(URIUnescape, 1, 1)                                      \
-                                                            \
-  F(NumberToInteger, 1, 1)                                  \
-  F(NumberToIntegerMapMinusZero, 1, 1)                      \
-  F(NumberToJSUint32, 1, 1)                                 \
-  F(NumberToJSInt32, 1, 1)                                  \
-                                                            \
-  /* Arithmetic operations */                               \
-  F(NumberAdd, 2, 1)                                        \
-  F(NumberSub, 2, 1)                                        \
-  F(NumberMul, 2, 1)                                        \
-  F(NumberDiv, 2, 1)                                        \
-  F(NumberMod, 2, 1)                                        \
-  F(NumberUnaryMinus, 1, 1)                                 \
-  F(NumberImul, 2, 1)                                       \
-                                                            \
-  F(StringBuilderConcat, 3, 1)                              \
-  F(StringBuilderJoin, 3, 1)                                \
-  F(SparseJoinWithSeparator, 3, 1)                          \
-                                                            \
-  /* Bit operations */                                      \
-  F(NumberOr, 2, 1)                                         \
-  F(NumberAnd, 2, 1)                                        \
-  F(NumberXor, 2, 1)                                        \
-                                                            \
-  F(NumberShl, 2, 1)                                        \
-  F(NumberShr, 2, 1)                                        \
-  F(NumberSar, 2, 1)                                        \
-                                                            \
-  /* Comparisons */                                         \
-  F(NumberEquals, 2, 1)                                     \
-  F(StringEquals, 2, 1)                                     \
-                                                            \
-  F(NumberCompare, 3, 1)                                    \
-  F(SmiLexicographicCompare, 2, 1)                          \
-                                                            \
-  /* Math */                                                \
-  F(MathAcos, 1, 1)                                         \
-  F(MathAsin, 1, 1)                                         \
-  F(MathAtan, 1, 1)                                         \
-  F(MathFloorRT, 1, 1)                                      \
-  F(MathAtan2, 2, 1)                                        \
-  F(MathExpRT, 1, 1)                                        \
-  F(RoundNumber, 1, 1)                                      \
-  F(MathFround, 1, 1)                                       \
-  F(RemPiO2, 1, 1)                                          \
-                                                            \
-  /* Regular expressions */                                 \
-  F(RegExpCompile, 3, 1)                                    \
-  F(RegExpExecMultiple, 4, 1)                               \
-  F(RegExpInitializeObject, 5, 1)                           \
-                                                            \
-  /* JSON */                                                \
-  F(ParseJson, 1, 1)                                        \
-  F(BasicJSONStringify, 1, 1)                               \
-  F(QuoteJSONString, 1, 1)                                  \
-                                                            \
-  /* Strings */                                             \
-  F(StringIndexOf, 3, 1)                                    \
-  F(StringLastIndexOf, 3, 1)                                \
-  F(StringLocaleCompare, 2, 1)                              \
-  F(StringReplaceGlobalRegExpWithString, 4, 1)              \
-  F(StringReplaceOneCharWithString, 3, 1)                   \
-  F(StringMatch, 3, 1)                                      \
-  F(StringTrim, 3, 1)                                       \
-  F(StringToArray, 2, 1)                                    \
-  F(NewStringWrapper, 1, 1)                                 \
-  F(NewString, 2, 1)                                        \
-  F(TruncateString, 2, 1)                                   \
-                                                            \
-  /* Numbers */                                             \
-  F(NumberToRadixString, 2, 1)                              \
-  F(NumberToFixed, 2, 1)                                    \
-  F(NumberToExponential, 2, 1)                              \
-  F(NumberToPrecision, 2, 1)                                \
-  F(IsValidSmi, 1, 1)
+#define RUNTIME_FUNCTION_LIST_ALWAYS_1(F)                  \
+  /* Property access */                                    \
+  F(GetProperty, 2, 1)                                     \
+  F(KeyedGetProperty, 2, 1)                                \
+  F(DeleteProperty, 3, 1)                                  \
+  F(HasOwnProperty, 2, 1)                                  \
+  F(HasProperty, 2, 1)                                     \
+  F(HasElement, 2, 1)                                      \
+  F(IsPropertyEnumerable, 2, 1)                            \
+  F(GetPropertyNames, 1, 1)                                \
+  F(GetPropertyNamesFast, 1, 1)                            \
+  F(GetOwnPropertyNames, 2, 1)                             \
+  F(GetOwnElementNames, 1, 1)                              \
+  F(GetInterceptorInfo, 1, 1)                              \
+  F(GetNamedInterceptorPropertyNames, 1, 1)                \
+  F(GetIndexedInterceptorElementNames, 1, 1)               \
+  F(GetArgumentsProperty, 1, 1)                            \
+  F(ToFastProperties, 1, 1)                                \
+  F(FinishArrayPrototypeSetup, 1, 1)                       \
+  F(SpecialArrayFunctions, 0, 1)                           \
+  F(IsSloppyModeFunction, 1, 1)                            \
+  F(GetDefaultReceiver, 1, 1)                              \
+                                                           \
+  F(GetPrototype, 1, 1)                                    \
+  F(SetPrototype, 2, 1)                                    \
+  F(InternalSetPrototype, 2, 1)                            \
+  F(IsInPrototypeChain, 2, 1)                              \
+                                                           \
+  F(GetOwnProperty, 2, 1)                                  \
+                                                           \
+  F(IsExtensible, 1, 1)                                    \
+  F(PreventExtensions, 1, 1)                               \
+                                                           \
+  /* Utilities */                                          \
+  F(CheckIsBootstrapping, 0, 1)                            \
+  F(GetRootNaN, 0, 1)                                      \
+  F(Call, -1 /* >= 2 */, 1)                                \
+  F(Apply, 5, 1)                                           \
+  F(GetFunctionDelegate, 1, 1)                             \
+  F(GetConstructorDelegate, 1, 1)                          \
+  F(DeoptimizeFunction, 1, 1)                              \
+  F(ClearFunctionTypeFeedback, 1, 1)                       \
+  F(RunningInSimulator, 0, 1)                              \
+  F(IsConcurrentRecompilationSupported, 0, 1)              \
+  F(OptimizeFunctionOnNextCall, -1, 1)                     \
+  F(NeverOptimizeFunction, 1, 1)                           \
+  F(GetOptimizationStatus, -1, 1)                          \
+  F(GetOptimizationCount, 1, 1)                            \
+  F(UnblockConcurrentRecompilation, 0, 1)                  \
+  F(CompileForOnStackReplacement, 1, 1)                    \
+  F(SetAllocationTimeout, -1 /* 2 || 3 */, 1)              \
+  F(SetNativeFlag, 1, 1)                                   \
+  F(SetInlineBuiltinFlag, 1, 1)                            \
+  F(StoreArrayLiteralElement, 5, 1)                        \
+  F(DebugPrepareStepInIfStepping, 1, 1)                    \
+  F(DebugPushPromise, 1, 1)                                \
+  F(DebugPopPromise, 0, 1)                                 \
+  F(DebugPromiseEvent, 1, 1)                               \
+  F(DebugPromiseRejectEvent, 2, 1)                         \
+  F(DebugAsyncTaskEvent, 1, 1)                             \
+  F(FlattenString, 1, 1)                                   \
+  F(LoadMutableDouble, 2, 1)                               \
+  F(TryMigrateInstance, 1, 1)                              \
+  F(NotifyContextDisposed, 0, 1)                           \
+                                                           \
+  /* Array join support */                                 \
+  F(PushIfAbsent, 2, 1)                                    \
+  F(ArrayConcat, 1, 1)                                     \
+                                                           \
+  /* Conversions */                                        \
+  F(ToBool, 1, 1)                                          \
+  F(Typeof, 1, 1)                                          \
+                                                           \
+  F(Booleanize, 2, 1) /* TODO(turbofan): Only temporary */ \
+                                                           \
+  F(StringToNumber, 1, 1)                                  \
+  F(StringParseInt, 2, 1)                                  \
+  F(StringParseFloat, 1, 1)                                \
+  F(StringToLowerCase, 1, 1)                               \
+  F(StringToUpperCase, 1, 1)                               \
+  F(StringSplit, 3, 1)                                     \
+  F(CharFromCode, 1, 1)                                    \
+  F(URIEscape, 1, 1)                                       \
+  F(URIUnescape, 1, 1)                                     \
+                                                           \
+  F(NumberToInteger, 1, 1)                                 \
+  F(NumberToIntegerMapMinusZero, 1, 1)                     \
+  F(NumberToJSUint32, 1, 1)                                \
+  F(NumberToJSInt32, 1, 1)                                 \
+                                                           \
+  /* Arithmetic operations */                              \
+  F(NumberAdd, 2, 1)                                       \
+  F(NumberSub, 2, 1)                                       \
+  F(NumberMul, 2, 1)                                       \
+  F(NumberDiv, 2, 1)                                       \
+  F(NumberMod, 2, 1)                                       \
+  F(NumberUnaryMinus, 1, 1)                                \
+  F(NumberImul, 2, 1)                                      \
+                                                           \
+  F(StringBuilderConcat, 3, 1)                             \
+  F(StringBuilderJoin, 3, 1)                               \
+  F(SparseJoinWithSeparator, 3, 1)                         \
+                                                           \
+  /* Bit operations */                                     \
+  F(NumberOr, 2, 1)                                        \
+  F(NumberAnd, 2, 1)                                       \
+  F(NumberXor, 2, 1)                                       \
+                                                           \
+  F(NumberShl, 2, 1)                                       \
+  F(NumberShr, 2, 1)                                       \
+  F(NumberSar, 2, 1)                                       \
+                                                           \
+  /* Comparisons */                                        \
+  F(NumberEquals, 2, 1)                                    \
+  F(StringEquals, 2, 1)                                    \
+                                                           \
+  F(NumberCompare, 3, 1)                                   \
+  F(SmiLexicographicCompare, 2, 1)                         \
+                                                           \
+  /* Math */                                               \
+  F(MathAcos, 1, 1)                                        \
+  F(MathAsin, 1, 1)                                        \
+  F(MathAtan, 1, 1)                                        \
+  F(MathFloorRT, 1, 1)                                     \
+  F(MathAtan2, 2, 1)                                       \
+  F(MathExpRT, 1, 1)                                       \
+  F(RoundNumber, 1, 1)                                     \
+  F(MathFround, 1, 1)                                      \
+  F(RemPiO2, 1, 1)                                         \
+                                                           \
+  /* Regular expressions */                                \
+  F(RegExpCompile, 3, 1)                                   \
+  F(RegExpExecMultiple, 4, 1)                              \
+  F(RegExpInitializeObject, 5, 1)                          \
+                                                           \
+  /* JSON */                                               \
+  F(ParseJson, 1, 1)                                       \
+  F(BasicJSONStringify, 1, 1)                              \
+  F(QuoteJSONString, 1, 1)                                 \
+                                                           \
+  /* Strings */                                            \
+  F(StringIndexOf, 3, 1)                                   \
+  F(StringLastIndexOf, 3, 1)                               \
+  F(StringLocaleCompare, 2, 1)                             \
+  F(StringReplaceGlobalRegExpWithString, 4, 1)             \
+  F(StringReplaceOneCharWithString, 3, 1)                  \
+  F(StringMatch, 3, 1)                                     \
+  F(StringTrim, 3, 1)                                      \
+  F(StringToArray, 2, 1)                                   \
+  F(NewStringWrapper, 1, 1)                                \
+  F(NewString, 2, 1)                                       \
+  F(TruncateString, 2, 1)                                  \
+                                                           \
+  /* Numbers */                                            \
+  F(NumberToRadixString, 2, 1)                             \
+  F(NumberToFixed, 2, 1)                                   \
+  F(NumberToExponential, 2, 1)                             \
+  F(NumberToPrecision, 2, 1)                               \
+  F(IsValidSmi, 1, 1)                                      \
+                                                           \
+  /* Classes support */                                    \
+  F(ToMethod, 2, 1)                                        \
+  F(HomeObjectSymbol, 0, 1)


 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F)                             \
=======================================
--- /branches/bleeding_edge/tools/generate-runtime-tests.py Wed Aug 20 14:24:07 2014 UTC +++ /branches/bleeding_edge/tools/generate-runtime-tests.py Thu Aug 21 12:39:33 2014 UTC
@@ -47,8 +47,8 @@
# that the parser doesn't bit-rot. Change the values as needed when you add, # remove or change runtime functions, but make sure we don't lose our ability
 # to parse them!
-EXPECTED_FUNCTION_COUNT = 429
-EXPECTED_FUZZABLE_COUNT = 330
+EXPECTED_FUNCTION_COUNT = 431
+EXPECTED_FUZZABLE_COUNT = 332
 EXPECTED_CCTEST_COUNT = 7
 EXPECTED_UNKNOWN_COUNT = 17
 EXPECTED_BUILTINS_COUNT = 808
=======================================
--- /branches/bleeding_edge/tools/gyp/v8.gyp    Wed Aug 20 13:05:03 2014 UTC
+++ /branches/bleeding_edge/tools/gyp/v8.gyp    Thu Aug 21 12:39:33 2014 UTC
@@ -1425,6 +1425,7 @@
           '../../src/generator.js',
           '../../src/harmony-string.js',
           '../../src/harmony-array.js',
+          '../../src/harmony-classes.js',
         ],
         'libraries_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries.bin',
         'libraries_experimental_bin_file': 
'<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin',

--
--
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