OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 19730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19741 if (cell->value() != *new_value) { | 19741 if (cell->value() != *new_value) { |
19742 cell->set_value(*new_value); | 19742 cell->set_value(*new_value); |
19743 Isolate* isolate = cell->GetIsolate(); | 19743 Isolate* isolate = cell->GetIsolate(); |
19744 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19744 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19745 isolate, DependentCode::kPropertyCellChangedGroup); | 19745 isolate, DependentCode::kPropertyCellChangedGroup); |
19746 } | 19746 } |
19747 } | 19747 } |
19748 | 19748 |
19749 int JSGeneratorObject::source_position() const { | 19749 int JSGeneratorObject::source_position() const { |
19750 CHECK(is_suspended()); | 19750 CHECK(is_suspended()); |
19751 DCHECK(function()->shared()->HasBytecodeArray()); | |
19752 DCHECK(!function()->shared()->HasBaselineCode()); | |
19751 AbstractCode* code; | 19753 AbstractCode* code; |
19752 int code_offset; | 19754 int code_offset; |
19753 if (function()->shared()->HasBytecodeArray()) { | 19755 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.
| |
19754 // New-style generators. | 19756 // The stored bytecode offset is relative to a different base than what |
19755 DCHECK(!function()->shared()->HasBaselineCode()); | 19757 // is used in the source position table, hence the subtraction. |
19756 code_offset = Smi::cast(input_or_debug_pos())->value(); | 19758 code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag; |
19757 // The stored bytecode offset is relative to a different base than what | 19759 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.
| |
19758 // is used in the source position table, hence the subtraction. | |
19759 code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag; | |
19760 code = AbstractCode::cast(function()->shared()->bytecode_array()); | |
19761 } else { | |
19762 // Old-style generators. | |
19763 DCHECK(function()->shared()->HasBaselineCode()); | |
19764 code_offset = continuation(); | |
19765 CHECK(0 <= code_offset); | |
19766 CHECK(code_offset < function()->code()->instruction_size()); | |
19767 code = AbstractCode::cast(function()->shared()->code()); | |
19768 } | |
19769 return code->SourcePosition(code_offset); | 19760 return code->SourcePosition(code_offset); |
19770 } | 19761 } |
19771 | 19762 |
19772 // static | 19763 // static |
19773 AccessCheckInfo* AccessCheckInfo::Get(Isolate* isolate, | 19764 AccessCheckInfo* AccessCheckInfo::Get(Isolate* isolate, |
19774 Handle<JSObject> receiver) { | 19765 Handle<JSObject> receiver) { |
19775 DisallowHeapAllocation no_gc; | 19766 DisallowHeapAllocation no_gc; |
19776 DCHECK(receiver->map()->is_access_check_needed()); | 19767 DCHECK(receiver->map()->is_access_check_needed()); |
19777 Object* maybe_constructor = receiver->map()->GetConstructor(); | 19768 Object* maybe_constructor = receiver->map()->GetConstructor(); |
19778 // Might happen for a detached context. | 19769 // Might happen for a detached context. |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20427 // depend on this. | 20418 // depend on this. |
20428 return DICTIONARY_ELEMENTS; | 20419 return DICTIONARY_ELEMENTS; |
20429 } | 20420 } |
20430 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20421 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20431 return kind; | 20422 return kind; |
20432 } | 20423 } |
20433 } | 20424 } |
20434 | 20425 |
20435 } // namespace internal | 20426 } // namespace internal |
20436 } // namespace v8 | 20427 } // namespace v8 |
OLD | NEW |