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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 namespace { | 327 namespace { |
328 | 328 |
329 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { | 329 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { |
330 JavaScriptFrameIterator it(isolate); | 330 JavaScriptFrameIterator it(isolate); |
331 if (!it.done()) { | 331 if (!it.done()) { |
332 // Compute the location from the function and the relocation info of the | 332 // Compute the location from the function and the relocation info of the |
333 // baseline code. For optimized code this will use the deoptimization | 333 // baseline code. For optimized code this will use the deoptimization |
334 // information to get canonical location information. | 334 // information to get canonical location information. |
335 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | 335 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
336 it.frame()->Summarize(&frames); | 336 it.frame()->Summarize(&frames); |
337 FrameSummary& summary = frames.last(); | 337 auto& summary = frames.last().AsJavaScript(); |
338 Handle<JSFunction> function = summary.function(); | 338 Handle<JSFunction> function = summary.function(); |
339 Handle<Object> script(function->shared()->script(), isolate); | 339 Handle<Object> script(function->shared()->script(), isolate); |
340 int pos = summary.abstract_code()->SourcePosition(summary.code_offset()); | 340 int pos = summary.abstract_code()->SourcePosition(summary.code_offset()); |
341 if (script->IsScript() && | 341 if (script->IsScript() && |
342 !(Handle<Script>::cast(script)->source()->IsUndefined(isolate))) { | 342 !(Handle<Script>::cast(script)->source()->IsUndefined(isolate))) { |
343 Handle<Script> casted_script = Handle<Script>::cast(script); | 343 Handle<Script> casted_script = Handle<Script>::cast(script); |
344 *target = MessageLocation(casted_script, pos, pos + 1, function); | 344 *target = MessageLocation(casted_script, pos, pos + 1, function); |
345 return true; | 345 return true; |
346 } | 346 } |
347 } | 347 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 HandleScope scope(isolate); | 499 HandleScope scope(isolate); |
500 DCHECK_EQ(1, args.length()); | 500 DCHECK_EQ(1, args.length()); |
501 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 501 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
502 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 502 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
503 return *isolate->factory()->ToBoolean( | 503 return *isolate->factory()->ToBoolean( |
504 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 504 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
505 } | 505 } |
506 | 506 |
507 } // namespace internal | 507 } // namespace internal |
508 } // namespace v8 | 508 } // namespace v8 |
OLD | NEW |