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

Side by Side Diff: src/execution.cc

Issue 2201823002: Make CallSite constructor inaccessible from JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@get-stack-trace-line
Patch Set: Revert "CHECK invalid arguments to CallSite constructor" Created 4 years, 4 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/builtins/builtins-internal.cc ('k') | src/messages.h » ('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/execution.h" 5 #include "src/execution.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 425
426 // --- C a l l s t o n a t i v e s --- 426 // --- C a l l s t o n a t i v e s ---
427 427
428 428
429 Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, 429 Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
430 Handle<JSFunction> fun, 430 Handle<JSFunction> fun,
431 Handle<Object> pos, 431 Handle<Object> pos,
432 Handle<Object> is_global) { 432 Handle<Object> is_global) {
433 Isolate* isolate = fun->GetIsolate(); 433 Isolate* isolate = fun->GetIsolate();
434
435 Handle<JSFunction> ctor =
436 handle(isolate->native_context()->callsite_function(), isolate);
437 Handle<Object> strict_mode = isolate->factory()->ToBoolean(false); 434 Handle<Object> strict_mode = isolate->factory()->ToBoolean(false);
438 435
439 MaybeHandle<Object> maybe_callsite = CallSiteUtils::Construct( 436 MaybeHandle<Object> maybe_callsite =
440 isolate, ctor, ctor, recv, fun, pos, strict_mode); 437 CallSiteUtils::Construct(isolate, recv, fun, pos, strict_mode);
441 if (maybe_callsite.is_null()) { 438 if (maybe_callsite.is_null()) {
442 isolate->clear_pending_exception(); 439 isolate->clear_pending_exception();
443 return isolate->factory()->empty_string(); 440 return isolate->factory()->empty_string();
444 } 441 }
445 442
446 MaybeHandle<String> maybe_to_string = 443 MaybeHandle<String> maybe_to_string =
447 CallSiteUtils::ToString(isolate, maybe_callsite.ToHandleChecked()); 444 CallSiteUtils::ToString(isolate, maybe_callsite.ToHandleChecked());
448 if (maybe_to_string.is_null()) { 445 if (maybe_to_string.is_null()) {
449 isolate->clear_pending_exception(); 446 isolate->clear_pending_exception();
450 return isolate->factory()->empty_string(); 447 return isolate->factory()->empty_string();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 492
496 isolate_->counters()->stack_interrupts()->Increment(); 493 isolate_->counters()->stack_interrupts()->Increment();
497 isolate_->counters()->runtime_profiler_ticks()->Increment(); 494 isolate_->counters()->runtime_profiler_ticks()->Increment();
498 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); 495 isolate_->runtime_profiler()->MarkCandidatesForOptimization();
499 496
500 return isolate_->heap()->undefined_value(); 497 return isolate_->heap()->undefined_value();
501 } 498 }
502 499
503 } // namespace internal 500 } // namespace internal
504 } // namespace v8 501 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-internal.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698