| OLD | NEW |
| 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 Loading... |
| 1533 if (pre_data_impl != NULL && !pre_data_impl->SanityCheck()) { | 1533 if (pre_data_impl != NULL && !pre_data_impl->SanityCheck()) { |
| 1534 pre_data_impl = NULL; | 1534 pre_data_impl = NULL; |
| 1535 } | 1535 } |
| 1536 i::Handle<i::SharedFunctionInfo> result = | 1536 i::Handle<i::SharedFunctionInfo> result = |
| 1537 i::Compiler::Compile(str, | 1537 i::Compiler::Compile(str, |
| 1538 name_obj, | 1538 name_obj, |
| 1539 line_offset, | 1539 line_offset, |
| 1540 column_offset, | 1540 column_offset, |
| 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 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4387 global_constructor->needs_access_check()); | 4387 global_constructor->needs_access_check()); |
| 4388 global_constructor->set_needs_access_check(false); | 4388 global_constructor->set_needs_access_check(false); |
| 4389 global_constructor->set_access_check_info( | 4389 global_constructor->set_access_check_info( |
| 4390 isolate->heap()->undefined_value()); | 4390 isolate->heap()->undefined_value()); |
| 4391 } | 4391 } |
| 4392 } | 4392 } |
| 4393 | 4393 |
| 4394 // Create the environment. | 4394 // Create the environment. |
| 4395 env = isolate->bootstrapper()->CreateEnvironment( | 4395 env = isolate->bootstrapper()->CreateEnvironment( |
| 4396 isolate, | 4396 isolate, |
| 4397 Utils::OpenHandle(*global_object), | 4397 Utils::OpenHandle(*global_object, true), |
| 4398 proxy_template, | 4398 proxy_template, |
| 4399 extensions); | 4399 extensions); |
| 4400 | 4400 |
| 4401 // Restore the access check info on the global template. | 4401 // Restore the access check info on the global template. |
| 4402 if (!global_template.IsEmpty()) { | 4402 if (!global_template.IsEmpty()) { |
| 4403 ASSERT(!global_constructor.is_null()); | 4403 ASSERT(!global_constructor.is_null()); |
| 4404 ASSERT(!proxy_constructor.is_null()); | 4404 ASSERT(!proxy_constructor.is_null()); |
| 4405 global_constructor->set_access_check_info( | 4405 global_constructor->set_access_check_info( |
| 4406 proxy_constructor->access_check_info()); | 4406 proxy_constructor->access_check_info()); |
| 4407 global_constructor->set_needs_access_check( | 4407 global_constructor->set_needs_access_check( |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5618 ENTER_V8(isolate); | 5618 ENTER_V8(isolate); |
| 5619 | 5619 |
| 5620 isolate->set_debug_event_callback(that); | 5620 isolate->set_debug_event_callback(that); |
| 5621 | 5621 |
| 5622 i::HandleScope scope(isolate); | 5622 i::HandleScope scope(isolate); |
| 5623 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); | 5623 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); |
| 5624 if (that != NULL) { | 5624 if (that != NULL) { |
| 5625 foreign = | 5625 foreign = |
| 5626 isolate->factory()->NewForeign(FUNCTION_ADDR(EventCallbackWrapper)); | 5626 isolate->factory()->NewForeign(FUNCTION_ADDR(EventCallbackWrapper)); |
| 5627 } | 5627 } |
| 5628 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data)); | 5628 isolate->debugger()->SetEventListener(foreign, |
| 5629 Utils::OpenHandle(*data, true)); |
| 5629 return true; | 5630 return true; |
| 5630 } | 5631 } |
| 5631 | 5632 |
| 5632 | 5633 |
| 5633 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { | 5634 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { |
| 5634 i::Isolate* isolate = i::Isolate::Current(); | 5635 i::Isolate* isolate = i::Isolate::Current(); |
| 5635 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); | 5636 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); |
| 5636 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); | 5637 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); |
| 5637 ENTER_V8(isolate); | 5638 ENTER_V8(isolate); |
| 5638 i::HandleScope scope(isolate); | 5639 i::HandleScope scope(isolate); |
| 5639 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); | 5640 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); |
| 5640 if (that != NULL) { | 5641 if (that != NULL) { |
| 5641 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); | 5642 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
| 5642 } | 5643 } |
| 5643 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data)); | 5644 isolate->debugger()->SetEventListener(foreign, |
| 5645 Utils::OpenHandle(*data, true)); |
| 5644 return true; | 5646 return true; |
| 5645 } | 5647 } |
| 5646 | 5648 |
| 5647 | 5649 |
| 5648 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that, | 5650 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that, |
| 5649 Handle<Value> data) { | 5651 Handle<Value> data) { |
| 5650 i::Isolate* isolate = i::Isolate::Current(); | 5652 i::Isolate* isolate = i::Isolate::Current(); |
| 5651 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); | 5653 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false); |
| 5652 ENTER_V8(isolate); | 5654 ENTER_V8(isolate); |
| 5653 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that), | 5655 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that), |
| 5654 Utils::OpenHandle(*data)); | 5656 Utils::OpenHandle(*data, true)); |
| 5655 return true; | 5657 return true; |
| 5656 } | 5658 } |
| 5657 | 5659 |
| 5658 | 5660 |
| 5659 void Debug::DebugBreak(Isolate* isolate) { | 5661 void Debug::DebugBreak(Isolate* isolate) { |
| 5660 // If no isolate is supplied, use the default isolate. | 5662 // If no isolate is supplied, use the default isolate. |
| 5661 if (isolate != NULL) { | 5663 if (isolate != NULL) { |
| 5662 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak(); | 5664 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak(); |
| 5663 } else { | 5665 } else { |
| 5664 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak(); | 5666 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak(); |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6518 | 6520 |
| 6519 v->VisitPointers(blocks_.first(), first_block_limit_); | 6521 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 6520 | 6522 |
| 6521 for (int i = 1; i < blocks_.length(); i++) { | 6523 for (int i = 1; i < blocks_.length(); i++) { |
| 6522 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 6524 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 6523 } | 6525 } |
| 6524 } | 6526 } |
| 6525 | 6527 |
| 6526 | 6528 |
| 6527 } } // namespace v8::internal | 6529 } } // namespace v8::internal |
| OLD | NEW |