OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 RUNTIME_FUNCTION(Runtime_FunctionGetScriptSourcePosition) { | 86 RUNTIME_FUNCTION(Runtime_FunctionGetScriptSourcePosition) { |
87 SealHandleScope shs(isolate); | 87 SealHandleScope shs(isolate); |
88 DCHECK(args.length() == 1); | 88 DCHECK(args.length() == 1); |
89 | 89 |
90 CONVERT_ARG_CHECKED(JSFunction, fun, 0); | 90 CONVERT_ARG_CHECKED(JSFunction, fun, 0); |
91 int pos = fun->shared()->start_position(); | 91 int pos = fun->shared()->start_position(); |
92 return Smi::FromInt(pos); | 92 return Smi::FromInt(pos); |
93 } | 93 } |
94 | 94 |
95 | |
96 RUNTIME_FUNCTION(Runtime_FunctionGetPositionForOffset) { | |
97 SealHandleScope shs(isolate); | |
98 DCHECK(args.length() == 2); | |
99 | |
100 CONVERT_ARG_CHECKED(AbstractCode, abstract_code, 0); | |
101 CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]); | |
102 return Smi::FromInt(abstract_code->SourcePosition(offset)); | |
103 } | |
104 | |
105 RUNTIME_FUNCTION(Runtime_FunctionGetContextData) { | 95 RUNTIME_FUNCTION(Runtime_FunctionGetContextData) { |
106 SealHandleScope shs(isolate); | 96 SealHandleScope shs(isolate); |
107 DCHECK(args.length() == 1); | 97 DCHECK(args.length() == 1); |
108 | 98 |
109 CONVERT_ARG_CHECKED(JSFunction, fun, 0); | 99 CONVERT_ARG_CHECKED(JSFunction, fun, 0); |
110 FixedArray* array = fun->native_context()->embedder_data(); | 100 FixedArray* array = fun->native_context()->embedder_data(); |
111 return array->get(v8::Context::kDebugIdIndex); | 101 return array->get(v8::Context::kDebugIdIndex); |
112 } | 102 } |
113 | 103 |
114 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) { | 104 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 DCHECK_EQ(1, args.length()); | 286 DCHECK_EQ(1, args.length()); |
297 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); | 287 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
298 return function->IsJSBoundFunction() | 288 return function->IsJSBoundFunction() |
299 ? *JSBoundFunction::ToString( | 289 ? *JSBoundFunction::ToString( |
300 Handle<JSBoundFunction>::cast(function)) | 290 Handle<JSBoundFunction>::cast(function)) |
301 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); | 291 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); |
302 } | 292 } |
303 | 293 |
304 } // namespace internal | 294 } // namespace internal |
305 } // namespace v8 | 295 } // namespace v8 |
OLD | NEW |