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

Side by Side Diff: src/api.cc

Issue 131443008: Introduce an API mirroring the gc extension (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 11 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 | « include/v8.h ('k') | no next file » | 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 6434 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::RequestGarbageCollectionForTesting(GarbageCollectionType type) {
6456 CHECK(i::FLAG_expose_gc);
6457 if (type == kMinorGarbageCollection) {
6458 reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage(
6459 i::NEW_SPACE, "Isolate::RequestGarbageCollection");
6460 } else {
6461 ASSERT_EQ(kFullGarbageCollection, type);
6462 reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
6463 i::Heap::kNoGCFlags, "Isolate::RequestGarbageCollection");
6464 }
6465 }
6466
6467
6455 Isolate* Isolate::GetCurrent() { 6468 Isolate* Isolate::GetCurrent() {
6456 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 6469 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
6457 return reinterpret_cast<Isolate*>(isolate); 6470 return reinterpret_cast<Isolate*>(isolate);
6458 } 6471 }
6459 6472
6460 6473
6461 Isolate* Isolate::New() { 6474 Isolate* Isolate::New() {
6462 i::Isolate* isolate = new i::Isolate(); 6475 i::Isolate* isolate = new i::Isolate();
6463 return reinterpret_cast<Isolate*>(isolate); 6476 return reinterpret_cast<Isolate*>(isolate);
6464 } 6477 }
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
7458 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7471 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7459 Address callback_address = 7472 Address callback_address =
7460 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7473 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7461 VMState<EXTERNAL> state(isolate); 7474 VMState<EXTERNAL> state(isolate);
7462 ExternalCallbackScope call_scope(isolate, callback_address); 7475 ExternalCallbackScope call_scope(isolate, callback_address);
7463 callback(info); 7476 callback(info);
7464 } 7477 }
7465 7478
7466 7479
7467 } } // namespace v8::internal 7480 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698