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 6434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6445 reinterpret_cast<i::Isolate*>(this)->stack_guard()->RequestInterrupt( | 6445 reinterpret_cast<i::Isolate*>(this)->stack_guard()->RequestInterrupt( |
6446 callback, data); | 6446 callback, data); |
6447 } | 6447 } |
6448 | 6448 |
6449 | 6449 |
6450 void Isolate::ClearInterrupt() { | 6450 void Isolate::ClearInterrupt() { |
6451 reinterpret_cast<i::Isolate*>(this)->stack_guard()->ClearInterrupt(); | 6451 reinterpret_cast<i::Isolate*>(this)->stack_guard()->ClearInterrupt(); |
6452 } | 6452 } |
6453 | 6453 |
6454 | 6454 |
| 6455 void Isolate::RequestGarbageCollection(GarbageCollectionType type) { |
| 6456 if (type == kMinorGarbageCollection) { |
| 6457 reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage( |
| 6458 i::NEW_SPACE, "Isolate::RequestGarbageCollection"); |
| 6459 } else { |
| 6460 ASSERT_EQ(kFullGarbageCollection, type); |
| 6461 reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage( |
| 6462 i::Heap::kNoGCFlags, "Isolate::RequestGarbageCollection"); |
| 6463 } |
| 6464 } |
| 6465 |
| 6466 |
6455 Isolate* Isolate::GetCurrent() { | 6467 Isolate* Isolate::GetCurrent() { |
6456 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 6468 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
6457 return reinterpret_cast<Isolate*>(isolate); | 6469 return reinterpret_cast<Isolate*>(isolate); |
6458 } | 6470 } |
6459 | 6471 |
6460 | 6472 |
6461 Isolate* Isolate::New() { | 6473 Isolate* Isolate::New() { |
6462 i::Isolate* isolate = new i::Isolate(); | 6474 i::Isolate* isolate = new i::Isolate(); |
6463 return reinterpret_cast<Isolate*>(isolate); | 6475 return reinterpret_cast<Isolate*>(isolate); |
6464 } | 6476 } |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7458 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7470 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7459 Address callback_address = | 7471 Address callback_address = |
7460 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7472 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7461 VMState<EXTERNAL> state(isolate); | 7473 VMState<EXTERNAL> state(isolate); |
7462 ExternalCallbackScope call_scope(isolate, callback_address); | 7474 ExternalCallbackScope call_scope(isolate, callback_address); |
7463 callback(info); | 7475 callback(info); |
7464 } | 7476 } |
7465 | 7477 |
7466 | 7478 |
7467 } } // namespace v8::internal | 7479 } } // namespace v8::internal |
OLD | NEW |