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

Side by Side Diff: src/api.cc

Issue 10917088: Add empty-handle checks to API functions (#ifdef ENABLE_EXTRA_CHECKS) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/api.h ('k') | src/checks.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 pre_data_impl = NULL; 1533 pre_data_impl = NULL;
1534 } 1534 }
1535 i::Handle<i::SharedFunctionInfo> result = 1535 i::Handle<i::SharedFunctionInfo> result =
1536 i::Compiler::Compile(str, 1536 i::Compiler::Compile(str,
1537 name_obj, 1537 name_obj,
1538 line_offset, 1538 line_offset,
1539 column_offset, 1539 column_offset,
1540 isolate->global_context(), 1540 isolate->global_context(),
1541 NULL, 1541 NULL,
1542 pre_data_impl, 1542 pre_data_impl,
1543 Utils::OpenHandle(*script_data), 1543 Utils::OpenHandle(*script_data, true),
1544 i::NOT_NATIVES_CODE); 1544 i::NOT_NATIVES_CODE);
1545 has_pending_exception = result.is_null(); 1545 has_pending_exception = result.is_null();
1546 EXCEPTION_BAILOUT_CHECK(isolate, Local<Script>()); 1546 EXCEPTION_BAILOUT_CHECK(isolate, Local<Script>());
1547 raw_result = *result; 1547 raw_result = *result;
1548 } 1548 }
1549 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate); 1549 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate);
1550 return Local<Script>(ToApi<Script>(result)); 1550 return Local<Script>(ToApi<Script>(result));
1551 } 1551 }
1552 1552
1553 1553
(...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 global_constructor->needs_access_check()); 4397 global_constructor->needs_access_check());
4398 global_constructor->set_needs_access_check(false); 4398 global_constructor->set_needs_access_check(false);
4399 global_constructor->set_access_check_info( 4399 global_constructor->set_access_check_info(
4400 isolate->heap()->undefined_value()); 4400 isolate->heap()->undefined_value());
4401 } 4401 }
4402 } 4402 }
4403 4403
4404 // Create the environment. 4404 // Create the environment.
4405 env = isolate->bootstrapper()->CreateEnvironment( 4405 env = isolate->bootstrapper()->CreateEnvironment(
4406 isolate, 4406 isolate,
4407 Utils::OpenHandle(*global_object), 4407 Utils::OpenHandle(*global_object, true),
4408 proxy_template, 4408 proxy_template,
4409 extensions); 4409 extensions);
4410 4410
4411 // Restore the access check info on the global template. 4411 // Restore the access check info on the global template.
4412 if (!global_template.IsEmpty()) { 4412 if (!global_template.IsEmpty()) {
4413 ASSERT(!global_constructor.is_null()); 4413 ASSERT(!global_constructor.is_null());
4414 ASSERT(!proxy_constructor.is_null()); 4414 ASSERT(!proxy_constructor.is_null());
4415 global_constructor->set_access_check_info( 4415 global_constructor->set_access_check_info(
4416 proxy_constructor->access_check_info()); 4416 proxy_constructor->access_check_info());
4417 global_constructor->set_needs_access_check( 4417 global_constructor->set_needs_access_check(
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
5635 ENTER_V8(isolate); 5635 ENTER_V8(isolate);
5636 5636
5637 isolate->set_debug_event_callback(that); 5637 isolate->set_debug_event_callback(that);
5638 5638
5639 i::HandleScope scope(isolate); 5639 i::HandleScope scope(isolate);
5640 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); 5640 i::Handle<i::Object> foreign = isolate->factory()->undefined_value();
5641 if (that != NULL) { 5641 if (that != NULL) {
5642 foreign = 5642 foreign =
5643 isolate->factory()->NewForeign(FUNCTION_ADDR(EventCallbackWrapper)); 5643 isolate->factory()->NewForeign(FUNCTION_ADDR(EventCallbackWrapper));
5644 } 5644 }
5645 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data)); 5645 isolate->debugger()->SetEventListener(foreign,
5646 Utils::OpenHandle(*data, true));
5646 return true; 5647 return true;
5647 } 5648 }
5648 5649
5649 5650
5650 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { 5651 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) {
5651 i::Isolate* isolate = i::Isolate::Current(); 5652 i::Isolate* isolate = i::Isolate::Current();
5652 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); 5653 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()");
5653 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); 5654 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false);
5654 ENTER_V8(isolate); 5655 ENTER_V8(isolate);
5655 i::HandleScope scope(isolate); 5656 i::HandleScope scope(isolate);
5656 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); 5657 i::Handle<i::Object> foreign = isolate->factory()->undefined_value();
5657 if (that != NULL) { 5658 if (that != NULL) {
5658 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); 5659 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that));
5659 } 5660 }
5660 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data)); 5661 isolate->debugger()->SetEventListener(foreign,
5662 Utils::OpenHandle(*data, true));
5661 return true; 5663 return true;
5662 } 5664 }
5663 5665
5664 5666
5665 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that, 5667 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that,
5666 Handle<Value> data) { 5668 Handle<Value> data) {
5667 i::Isolate* isolate = i::Isolate::Current(); 5669 i::Isolate* isolate = i::Isolate::Current();
5668 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); 5670 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
5669 ENTER_V8(isolate); 5671 ENTER_V8(isolate);
5670 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that), 5672 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that),
5671 Utils::OpenHandle(*data)); 5673 Utils::OpenHandle(*data, true));
5672 return true; 5674 return true;
5673 } 5675 }
5674 5676
5675 5677
5676 void Debug::DebugBreak(Isolate* isolate) { 5678 void Debug::DebugBreak(Isolate* isolate) {
5677 // If no isolate is supplied, use the default isolate. 5679 // If no isolate is supplied, use the default isolate.
5678 if (isolate != NULL) { 5680 if (isolate != NULL) {
5679 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak(); 5681 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak();
5680 } else { 5682 } else {
5681 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak(); 5683 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak();
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
6535 6537
6536 v->VisitPointers(blocks_.first(), first_block_limit_); 6538 v->VisitPointers(blocks_.first(), first_block_limit_);
6537 6539
6538 for (int i = 1; i < blocks_.length(); i++) { 6540 for (int i = 1; i < blocks_.length(); i++) {
6539 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 6541 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
6540 } 6542 }
6541 } 6543 }
6542 6544
6543 6545
6544 } } // namespace v8::internal 6546 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.h ('k') | src/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698