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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 prev_limit_ = current->limit; | 655 prev_limit_ = current->limit; |
656 current->level++; | 656 current->level++; |
657 } | 657 } |
658 | 658 |
659 | 659 |
660 HandleScope::~HandleScope() { | 660 HandleScope::~HandleScope() { |
661 i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_); | 661 i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_); |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 int HandleScope::NumberOfHandles() { | 665 int HandleScope::NumberOfHandles(Isolate* isolate) { |
666 i::Isolate* isolate = i::Isolate::Current(); | 666 return i::HandleScope::NumberOfHandles( |
667 if (!EnsureInitializedForIsolate(isolate, "HandleScope::NumberOfHandles")) { | 667 reinterpret_cast<i::Isolate*>(isolate)); |
668 return 0; | |
669 } | |
670 return i::HandleScope::NumberOfHandles(isolate); | |
671 } | 668 } |
672 | 669 |
673 | 670 |
674 i::Object** HandleScope::CreateHandle(i::Isolate* isolate, i::Object* value) { | 671 i::Object** HandleScope::CreateHandle(i::Isolate* isolate, i::Object* value) { |
675 return i::HandleScope::CreateHandle(isolate, value); | 672 return i::HandleScope::CreateHandle(isolate, value); |
676 } | 673 } |
677 | 674 |
678 | 675 |
679 i::Object** HandleScope::CreateHandle(i::HeapObject* heap_object, | 676 i::Object** HandleScope::CreateHandle(i::HeapObject* heap_object, |
680 i::Object* value) { | 677 i::Object* value) { |
(...skipping 6781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7462 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7459 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7463 Address callback_address = | 7460 Address callback_address = |
7464 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7461 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7465 VMState<EXTERNAL> state(isolate); | 7462 VMState<EXTERNAL> state(isolate); |
7466 ExternalCallbackScope call_scope(isolate, callback_address); | 7463 ExternalCallbackScope call_scope(isolate, callback_address); |
7467 callback(info); | 7464 callback(info); |
7468 } | 7465 } |
7469 | 7466 |
7470 | 7467 |
7471 } } // namespace v8::internal | 7468 } } // namespace v8::internal |
OLD | NEW |