Run more tests with --ignition-generators.

Also, make %GeneratorGetSourcePosition fail if called on a suspended Ignition generator
(rather than return nonsense).  This functionality is currently not implemented.

BUG=v8:4907

Review-Url: https://codereview.chromium.org/2049663002
Cr-Commit-Position: refs/heads/master@{#36822}
This commit is contained in:
neis 2016-06-08 04:58:03 -07:00 committed by Commit bot
parent c8e286c918
commit ea139c5b4a
13 changed files with 24 additions and 14 deletions

View File

@ -1333,6 +1333,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"prepare for break points");
DCHECK(shared->is_compiled());
bool is_interpreted = shared->HasBytecodeArray();
{

View File

@ -146,14 +146,15 @@ RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) {
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
if (generator->is_suspended()) {
Handle<Code> code(generator->function()->code(), isolate);
int offset = generator->continuation();
RUNTIME_ASSERT(0 <= offset && offset < code->instruction_size());
return Smi::FromInt(code->SourcePosition(offset));
}
if (!generator->is_suspended()) return isolate->heap()->undefined_value();
return isolate->heap()->undefined_value();
if (FLAG_ignition && FLAG_ignition_generators) UNIMPLEMENTED();
DCHECK(!generator->function()->shared()->HasBytecodeArray());
Handle<Code> code(generator->function()->code(), isolate);
int offset = generator->continuation();
RUNTIME_ASSERT(0 <= offset && offset < code->instruction_size());
return Smi::FromInt(code->SourcePosition(offset));
}
} // namespace internal

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug
// Flags: --expose-debug-as debug --ignition-generators
var Debug = debug.Debug;

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug
// Flags: --expose-debug-as debug --ignition-generators
var Debug = debug.Debug;

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug --allow-natives-syntax
// Flags: --expose-debug-as debug --allow-natives-syntax --ignition-generators
var Debug = debug.Debug;
var LiveEdit = Debug.LiveEdit;

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug
// Flags: --expose-debug-as debug --ignition-generators
var Debug = debug.Debug;

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-gc
// Flags: --expose-gc --ignition-generators
// Test generator iteration.

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
// Flags: --allow-natives-syntax --ignition-generators
// Test instantations of generators.

View File

@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --ignition-generators
// Test basic generator syntax.
// Yield statements.

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --ignition-generators
(function testRestrictedPropertiesStrict() {
function* generator() { "use strict"; }
assertFalse(generator.hasOwnProperty("arguments"));

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug
// Flags: --expose-debug-as debug --ignition-generators
var Debug = debug.Debug;

View File

@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --ignition-generators
// Test aspects of the generator runtime.
// See:

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --ignition-generators
// Test generator states.
function Foo() {}