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 |