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

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

Issue 1840713002: [V8] Add FunctionMirror.prototype.contextDebugId method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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.h ('k') | no next file » | 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 RUNTIME_FUNCTION(Runtime_FunctionGetPositionForOffset) { 90 RUNTIME_FUNCTION(Runtime_FunctionGetPositionForOffset) {
91 SealHandleScope shs(isolate); 91 SealHandleScope shs(isolate);
92 DCHECK(args.length() == 2); 92 DCHECK(args.length() == 2);
93 93
94 CONVERT_ARG_CHECKED(AbstractCode, abstract_code, 0); 94 CONVERT_ARG_CHECKED(AbstractCode, abstract_code, 0);
95 CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]); 95 CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]);
96 return Smi::FromInt(abstract_code->SourcePosition(offset)); 96 return Smi::FromInt(abstract_code->SourcePosition(offset));
97 } 97 }
98 98
99 RUNTIME_FUNCTION(Runtime_FunctionGetContextData) {
100 SealHandleScope shs(isolate);
101 DCHECK(args.length() == 1);
102
103 CONVERT_ARG_CHECKED(JSFunction, fun, 0);
104 FixedArray* array = fun->native_context()->embedder_data();
105 return array->get(v8::Context::kDebugIdIndex);
106 }
99 107
100 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) { 108 RUNTIME_FUNCTION(Runtime_FunctionSetInstanceClassName) {
101 SealHandleScope shs(isolate); 109 SealHandleScope shs(isolate);
102 DCHECK(args.length() == 2); 110 DCHECK(args.length() == 2);
103 111
104 CONVERT_ARG_CHECKED(JSFunction, fun, 0); 112 CONVERT_ARG_CHECKED(JSFunction, fun, 0);
105 CONVERT_ARG_CHECKED(String, name, 1); 113 CONVERT_ARG_CHECKED(String, name, 1);
106 fun->shared()->set_instance_class_name(name); 114 fun->shared()->set_instance_class_name(name);
107 return isolate->heap()->undefined_value(); 115 return isolate->heap()->undefined_value();
108 } 116 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DCHECK_EQ(1, args.length()); 300 DCHECK_EQ(1, args.length());
293 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); 301 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0);
294 return function->IsJSBoundFunction() 302 return function->IsJSBoundFunction()
295 ? *JSBoundFunction::ToString( 303 ? *JSBoundFunction::ToString(
296 Handle<JSBoundFunction>::cast(function)) 304 Handle<JSBoundFunction>::cast(function))
297 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); 305 : *JSFunction::ToString(Handle<JSFunction>::cast(function));
298 } 306 }
299 307
300 } // namespace internal 308 } // namespace internal
301 } // namespace v8 309 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698