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

Side by Side Diff: src/objects.cc

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rename again, and move subtraction to runtime Created 4 years, 6 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 | « src/objects.h ('k') | src/objects-inl.h » ('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 <sstream> 9 #include <sstream>
10 10
(...skipping 18845 matching lines...) Expand 10 before | Expand all | Expand 10 after
18856 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 18856 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
18857 Handle<Object> new_value) { 18857 Handle<Object> new_value) {
18858 if (cell->value() != *new_value) { 18858 if (cell->value() != *new_value) {
18859 cell->set_value(*new_value); 18859 cell->set_value(*new_value);
18860 Isolate* isolate = cell->GetIsolate(); 18860 Isolate* isolate = cell->GetIsolate();
18861 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18861 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18862 isolate, DependentCode::kPropertyCellChangedGroup); 18862 isolate, DependentCode::kPropertyCellChangedGroup);
18863 } 18863 }
18864 } 18864 }
18865 18865
18866 int JSGeneratorObject::source_position() const {
18867 CHECK(is_suspended());
18868 if (function()->shared()->HasBytecodeArray()) {
18869 // New-style generators.
18870 int offset = Smi::cast(input_or_debug_pos())->value();
18871 // The stored bytecode offset is relative to a different base than what
18872 // is used in the source position table, hence the subtraction.
18873 offset -= BytecodeArray::kHeaderSize - kHeapObjectTag;
18874 return function()->shared()->bytecode_array()->SourcePosition(offset);
18875 } else {
18876 // Old-style generators.
18877 int offset = continuation();
18878 CHECK(0 <= offset && offset < function()->code()->instruction_size());
18879 return function()->code()->SourcePosition(offset);
18880 }
18881 }
18882
18866 } // namespace internal 18883 } // namespace internal
18867 } // namespace v8 18884 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698