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

Side by Side Diff: src/top.cc

Issue 3165016: Allow allocation in FailedAccessCheckCallback to allow embedders to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 accumulator->Add( 513 accumulator->Add(
514 "\n==== Details ================================================\n\n"); 514 "\n==== Details ================================================\n\n");
515 PrintFrames(accumulator, StackFrame::DETAILS); 515 PrintFrames(accumulator, StackFrame::DETAILS);
516 516
517 accumulator->PrintMentionedObjectCache(); 517 accumulator->PrintMentionedObjectCache();
518 accumulator->Add("=====================\n\n"); 518 accumulator->Add("=====================\n\n");
519 } 519 }
520 520
521 521
522 void Top::SetFailedAccessCheckCallback(v8::FailedAccessCheckCallback callback) { 522 void Top::SetFailedAccessCheckCallback(v8::FailedAccessCheckCallback callback) {
523 ASSERT(thread_local_.failed_access_check_callback_ == NULL);
524 thread_local_.failed_access_check_callback_ = callback; 523 thread_local_.failed_access_check_callback_ = callback;
525 } 524 }
526 525
527 526
528 void Top::ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type) { 527 void Top::ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type) {
529 if (!thread_local_.failed_access_check_callback_) return; 528 if (!thread_local_.failed_access_check_callback_) return;
530 529
531 ASSERT(receiver->IsAccessCheckNeeded()); 530 ASSERT(receiver->IsAccessCheckNeeded());
532 ASSERT(Top::context()); 531 ASSERT(Top::context());
533 // The callers of this method are not expecting a GC.
534 AssertNoAllocation no_gc;
535 532
536 // Get the data object from access check info. 533 // Get the data object from access check info.
537 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); 534 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
538 if (!constructor->shared()->IsApiFunction()) return; 535 if (!constructor->shared()->IsApiFunction()) return;
539 Object* data_obj = 536 Object* data_obj =
540 constructor->shared()->get_api_func_data()->access_check_info(); 537 constructor->shared()->get_api_func_data()->access_check_info();
541 if (data_obj == Heap::undefined_value()) return; 538 if (data_obj == Heap::undefined_value()) return;
542 539
543 HandleScope scope; 540 HandleScope scope;
544 Handle<JSObject> receiver_handle(receiver); 541 Handle<JSObject> receiver_handle(receiver);
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 Top::break_access_->Lock(); 1054 Top::break_access_->Lock();
1058 } 1055 }
1059 1056
1060 1057
1061 ExecutionAccess::~ExecutionAccess() { 1058 ExecutionAccess::~ExecutionAccess() {
1062 Top::break_access_->Unlock(); 1059 Top::break_access_->Unlock();
1063 } 1060 }
1064 1061
1065 1062
1066 } } // namespace v8::internal 1063 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698