Commit 2405ab11 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[runtime] Ensure {JSGeneratorObject} is created for bytecode.

This removes some outdated code that allocates a {JSGeneratorObject} for
baseline code. We no longer support such a representation of generators
and can rely on bytecode being available for all generators.

R=neis@chromium.org

Review-Url: https://codereview.chromium.org/2515253003
Cr-Commit-Position: refs/heads/master@{#41137}
parent 8ca50a88
...@@ -19,17 +19,11 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) { ...@@ -19,17 +19,11 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) {
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1); CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1);
CHECK(IsResumableFunction(function->shared()->kind())); CHECK(IsResumableFunction(function->shared()->kind()));
Handle<FixedArray> operand_stack; // Underlying function needs to have bytecode available.
if (function->shared()->HasBytecodeArray()) { DCHECK(function->shared()->HasBytecodeArray());
// New-style generators.
DCHECK(!function->shared()->HasBaselineCode()); DCHECK(!function->shared()->HasBaselineCode());
int size = function->shared()->bytecode_array()->register_count(); int size = function->shared()->bytecode_array()->register_count();
operand_stack = isolate->factory()->NewFixedArray(size); Handle<FixedArray> operand_stack = isolate->factory()->NewFixedArray(size);
} else {
// Old-style generators.
DCHECK(function->shared()->HasBaselineCode());
operand_stack = isolate->factory()->empty_fixed_array();
}
Handle<JSGeneratorObject> generator = Handle<JSGeneratorObject> generator =
isolate->factory()->NewJSGeneratorObject(function); isolate->factory()->NewJSGeneratorObject(function);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment