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

Unified Diff: src/handles.cc

Issue 7977001: Added ability to lock strings to prevent their representation or encoding from changing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bug in test when running threaded. Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/handles.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index b37d164676eeff71aa7946388eabbcd4eeaedcf9..ce4258d618e12f41d5289b0f6bda1218b3592c9b 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -942,4 +942,20 @@ bool CompileOptimized(Handle<JSFunction> function,
return CompileLazyHelper(&info, flag);
}
+
+void LockString(Handle<String> string) {
+ CALL_HEAP_FUNCTION_VOID(string->GetHeap()->isolate(),
+ string->GetHeap()->LockString(*string));
+}
+
+
+StringLock::StringLock(Handle<String> string) : string_(string) {
+ LockString(string);
+}
+
+
+StringLock::~StringLock() {
+ string_->GetHeap()->UnlockString(*string_);
+}
+
} } // namespace v8::internal
« no previous file with comments | « src/handles.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698