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

Side by Side Diff: src/runtime/runtime-function.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/objects-printer.cc ('k') | 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 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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 CONVERT_ARG_CHECKED(JSFunction, fun, 0); 79 CONVERT_ARG_CHECKED(JSFunction, fun, 0);
80 int pos = fun->shared()->start_position(); 80 int pos = fun->shared()->start_position();
81 return Smi::FromInt(pos); 81 return Smi::FromInt(pos);
82 } 82 }
83 83
84 84
85 RUNTIME_FUNCTION(Runtime_FunctionGetPositionForOffset) { 85 RUNTIME_FUNCTION(Runtime_FunctionGetPositionForOffset) {
86 SealHandleScope shs(isolate); 86 SealHandleScope shs(isolate);
87 DCHECK(args.length() == 2); 87 DCHECK(args.length() == 2);
88 88
89 CONVERT_ARG_CHECKED(Code, code, 0); 89 CONVERT_ARG_CHECKED(AbstractCode, abstract_code, 0);
90 CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]); 90 CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]);
91 91 return Smi::FromInt(abstract_code->SourcePosition(offset));
92 RUNTIME_ASSERT(0 <= offset && offset < code->Size());
93
94 Address pc = code->address() + offset;
95 return Smi::FromInt(code->SourcePosition(pc));
96 } 92 }
97 93
98 94
99 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) { 95 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) {
100 SealHandleScope shs(isolate); 96 SealHandleScope shs(isolate);
101 DCHECK(args.length() == 2); 97 DCHECK(args.length() == 2);
102 98
103 CONVERT_ARG_CHECKED(JSFunction, fun, 0); 99 CONVERT_ARG_CHECKED(JSFunction, fun, 0);
104 CONVERT_ARG_CHECKED(String, name, 1); 100 CONVERT_ARG_CHECKED(String, name, 1);
105 fun->shared()->set_instance_class_name(name); 101 fun->shared()->set_instance_class_name(name);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 DCHECK_EQ(1, args.length()); 348 DCHECK_EQ(1, args.length());
353 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); 349 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0);
354 return function->IsJSBoundFunction() 350 return function->IsJSBoundFunction()
355 ? *JSBoundFunction::ToString( 351 ? *JSBoundFunction::ToString(
356 Handle<JSBoundFunction>::cast(function)) 352 Handle<JSBoundFunction>::cast(function))
357 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); 353 : *JSFunction::ToString(Handle<JSFunction>::cast(function));
358 } 354 }
359 355
360 } // namespace internal 356 } // namespace internal
361 } // namespace v8 357 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698