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 5795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5806 } | 5806 } |
5807 | 5807 |
5808 | 5808 |
5809 CpuProfiler* Isolate::GetCpuProfiler() { | 5809 CpuProfiler* Isolate::GetCpuProfiler() { |
5810 i::CpuProfiler* cpu_profiler = | 5810 i::CpuProfiler* cpu_profiler = |
5811 reinterpret_cast<i::Isolate*>(this)->cpu_profiler(); | 5811 reinterpret_cast<i::Isolate*>(this)->cpu_profiler(); |
5812 return reinterpret_cast<CpuProfiler*>(cpu_profiler); | 5812 return reinterpret_cast<CpuProfiler*>(cpu_profiler); |
5813 } | 5813 } |
5814 | 5814 |
5815 | 5815 |
| 5816 v8::Local<v8::Context> Isolate::GetCurrentContext() { |
| 5817 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
| 5818 i::Handle<i::Object> current = internal_isolate->native_context(); |
| 5819 if (current.is_null()) return Local<Context>(); |
| 5820 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current); |
| 5821 return Utils::ToLocal(context); |
| 5822 } |
| 5823 |
| 5824 |
5816 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { | 5825 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { |
5817 i::Isolate* isolate = i::Isolate::Current(); | 5826 i::Isolate* isolate = i::Isolate::Current(); |
5818 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; | 5827 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; |
5819 isolate->heap()->SetGlobalGCPrologueCallback(callback); | 5828 isolate->heap()->SetGlobalGCPrologueCallback(callback); |
5820 } | 5829 } |
5821 | 5830 |
5822 | 5831 |
5823 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { | 5832 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { |
5824 i::Isolate* isolate = i::Isolate::Current(); | 5833 i::Isolate* isolate = i::Isolate::Current(); |
5825 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return; | 5834 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return; |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7213 | 7222 |
7214 v->VisitPointers(blocks_.first(), first_block_limit_); | 7223 v->VisitPointers(blocks_.first(), first_block_limit_); |
7215 | 7224 |
7216 for (int i = 1; i < blocks_.length(); i++) { | 7225 for (int i = 1; i < blocks_.length(); i++) { |
7217 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7226 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7218 } | 7227 } |
7219 } | 7228 } |
7220 | 7229 |
7221 | 7230 |
7222 } } // namespace v8::internal | 7231 } } // namespace v8::internal |
OLD | NEW |