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

Side by Side Diff: src/runtime/runtime-generator.cc

Issue 1618343002: [interpreter, debugger] abstraction for source position calculation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove bogus assertion Created 4 years, 10 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/runtime/runtime-function.cc ('k') | src/runtime/runtime-internal.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 189
190 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) { 190 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) {
191 HandleScope scope(isolate); 191 HandleScope scope(isolate);
192 DCHECK(args.length() == 1); 192 DCHECK(args.length() == 1);
193 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); 193 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
194 194
195 if (generator->is_suspended()) { 195 if (generator->is_suspended()) {
196 Handle<Code> code(generator->function()->code(), isolate); 196 Handle<Code> code(generator->function()->code(), isolate);
197 int offset = generator->continuation(); 197 int offset = generator->continuation();
198 198 RUNTIME_ASSERT(0 <= offset && offset < code->instruction_size());
199 RUNTIME_ASSERT(0 <= offset && offset < code->Size()); 199 return Smi::FromInt(code->SourcePosition(offset));
200 Address pc = code->address() + offset;
201
202 return Smi::FromInt(code->SourcePosition(pc));
203 } 200 }
204 201
205 return isolate->heap()->undefined_value(); 202 return isolate->heap()->undefined_value();
206 } 203 }
207 204
208 205
209 RUNTIME_FUNCTION(Runtime_GeneratorNext) { 206 RUNTIME_FUNCTION(Runtime_GeneratorNext) {
210 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). 207 UNREACHABLE(); // Optimization disabled in SetUpGenerators().
211 return NULL; 208 return NULL;
212 } 209 }
213 210
214 211
215 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { 212 RUNTIME_FUNCTION(Runtime_GeneratorThrow) {
216 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). 213 UNREACHABLE(); // Optimization disabled in SetUpGenerators().
217 return NULL; 214 return NULL;
218 } 215 }
219 } // namespace internal 216 } // namespace internal
220 } // namespace v8 217 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698