Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index f0b9b04cdb0673abbc9ef48b93a0813ffd28ea63..8d6303d37d43d5d990693d2962127d209323e172 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -19748,24 +19748,15 @@ void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
int JSGeneratorObject::source_position() const { |
CHECK(is_suspended()); |
+ DCHECK(function()->shared()->HasBytecodeArray()); |
+ DCHECK(!function()->shared()->HasBaselineCode()); |
AbstractCode* code; |
int code_offset; |
- if (function()->shared()->HasBytecodeArray()) { |
- // New-style generators. |
- DCHECK(!function()->shared()->HasBaselineCode()); |
- code_offset = Smi::cast(input_or_debug_pos())->value(); |
- // The stored bytecode offset is relative to a different base than what |
- // is used in the source position table, hence the subtraction. |
- code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag; |
- code = AbstractCode::cast(function()->shared()->bytecode_array()); |
- } else { |
- // Old-style generators. |
- DCHECK(function()->shared()->HasBaselineCode()); |
- code_offset = continuation(); |
- CHECK(0 <= code_offset); |
- CHECK(code_offset < function()->code()->instruction_size()); |
- code = AbstractCode::cast(function()->shared()->code()); |
- } |
+ code_offset = Smi::cast(input_or_debug_pos())->value(); |
Michael Starzinger
2016/11/21 15:56:16
nit: Declaration and definition of {code_offset} c
neis
2016/11/22 13:18:53
Done.
|
+ // The stored bytecode offset is relative to a different base than what |
+ // is used in the source position table, hence the subtraction. |
+ code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag; |
+ code = AbstractCode::cast(function()->shared()->bytecode_array()); |
Michael Starzinger
2016/11/21 15:56:16
nit: Declaration and definition of {code} can go i
neis
2016/11/22 13:18:53
Done.
|
return code->SourcePosition(code_offset); |
} |