Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / v8 / src / generator.js
index 1c7c4ec..72e64dc 100644 (file)
@@ -20,6 +20,7 @@ function GeneratorObjectNext(value) {
                         ['[Generator].prototype.next', this]);
   }
 
+  if (DEBUG_IS_ACTIVE) %DebugPrepareStepInIfStepping(this);
   return %_GeneratorNext(this, value);
 }
 
@@ -55,11 +56,19 @@ function GeneratorFunctionConstructor(arg1) {  // length == 1
 
 function SetUpGenerators() {
   %CheckIsBootstrapping();
+
+  // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by
+  // neither Crankshaft nor TurboFan, disable optimization of wrappers here.
+  %NeverOptimizeFunction(GeneratorObjectNext);
+  %NeverOptimizeFunction(GeneratorObjectThrow);
+
+  // Set up non-enumerable functions on the generator prototype object.
   var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype;
   InstallFunctions(GeneratorObjectPrototype,
                    DONT_ENUM | DONT_DELETE | READ_ONLY,
                    ["next", GeneratorObjectNext,
                     "throw", GeneratorObjectThrow]);
+
   %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]');
   %AddNamedProperty(GeneratorObjectPrototype, symbolIterator,
       GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY);