Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: src/objects.cc

Issue 2233863002: [generators] Add asserts preventing mixed functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-preserve-bytecode-1
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19150 matching lines...) Expand 10 before | Expand all | Expand 10 after
19161 isolate, DependentCode::kPropertyCellChangedGroup); 19161 isolate, DependentCode::kPropertyCellChangedGroup);
19162 } 19162 }
19163 } 19163 }
19164 19164
19165 int JSGeneratorObject::source_position() const { 19165 int JSGeneratorObject::source_position() const {
19166 CHECK(is_suspended()); 19166 CHECK(is_suspended());
19167 AbstractCode* code; 19167 AbstractCode* code;
19168 int code_offset; 19168 int code_offset;
19169 if (function()->shared()->HasBytecodeArray()) { 19169 if (function()->shared()->HasBytecodeArray()) {
19170 // New-style generators. 19170 // New-style generators.
19171 DCHECK(!function()->shared()->HasBaselineCode());
19171 code_offset = Smi::cast(input_or_debug_pos())->value(); 19172 code_offset = Smi::cast(input_or_debug_pos())->value();
19172 // The stored bytecode offset is relative to a different base than what 19173 // The stored bytecode offset is relative to a different base than what
19173 // is used in the source position table, hence the subtraction. 19174 // is used in the source position table, hence the subtraction.
19174 code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag; 19175 code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag;
19175 code = AbstractCode::cast(function()->shared()->bytecode_array()); 19176 code = AbstractCode::cast(function()->shared()->bytecode_array());
19176 } else { 19177 } else {
19177 // Old-style generators. 19178 // Old-style generators.
19179 DCHECK(function()->shared()->HasBaselineCode());
19178 code_offset = continuation(); 19180 code_offset = continuation();
19179 CHECK(0 <= code_offset); 19181 CHECK(0 <= code_offset);
19180 CHECK(code_offset < function()->code()->instruction_size()); 19182 CHECK(code_offset < function()->code()->instruction_size());
19181 code = AbstractCode::cast(function()->shared()->code()); 19183 code = AbstractCode::cast(function()->shared()->code());
19182 } 19184 }
19183 return code->SourcePosition(code_offset); 19185 return code->SourcePosition(code_offset);
19184 } 19186 }
19185 19187
19186 // static 19188 // static
19187 AccessCheckInfo* AccessCheckInfo::Get(Isolate* isolate, 19189 AccessCheckInfo* AccessCheckInfo::Get(Isolate* isolate,
(...skipping 18 matching lines...) Expand all
19206 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, 19208 for (PrototypeIterator iter(isolate, this, kStartAtReceiver,
19207 PrototypeIterator::END_AT_NULL); 19209 PrototypeIterator::END_AT_NULL);
19208 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { 19210 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) {
19209 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; 19211 if (iter.GetCurrent<Object>()->IsJSProxy()) return true;
19210 } 19212 }
19211 return false; 19213 return false;
19212 } 19214 }
19213 19215
19214 } // namespace internal 19216 } // namespace internal
19215 } // namespace v8 19217 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698