Chromium Code Reviews

Unified Diff: include/v8.h

Issue 11411353: Enforce stack allocation of TryCatch blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 01a4cc9dea7f9e29b565597e3b984215a96ed91f..6671d8c78cbf3f35b34bfb1ff2ae2aa6fa6377c5 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3559,7 +3559,9 @@ class V8EXPORT V8 {
class V8EXPORT TryCatch {
public:
/**
- * Creates a new try/catch block and registers it with v8.
+ * Creates a new try/catch block and registers it with v8. Note that
+ * all TryCatch blocks should be stack allocated because the memory
+ * location itself is compared against JavaScript try/catch blocks.
*/
TryCatch();
@@ -3649,6 +3651,12 @@ class V8EXPORT TryCatch {
void SetCaptureMessage(bool value);
private:
+ // Make it impossible to create heap-allocated TryCatch blocks.
Sven Panne 2012/12/04 11:55:28 s/impossible/hard/, same for other places like thi
Michael Starzinger 2012/12/04 12:12:40 Done.
+ TryCatch(const TryCatch&);
+ void operator=(const TryCatch&);
+ void* operator new(size_t size);
+ void operator delete(void*, size_t);
+
v8::internal::Isolate* isolate_;
void* next_;
void* exception_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine