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

Unified Diff: include/v8.h

Issue 16621004: make empty string returnable by ReturnValue (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: nit Created 7 years, 6 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 | « no previous file | test/cctest/test-api.cc » ('j') | 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 e99c6d9a98035d9b6abe7d26705c7ae1b02a280e..b7eb29489f845be536a9c4a7151b2e449a2fa046 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2845,6 +2845,7 @@ class ReturnValue {
// Fast JS primitive setters
V8_INLINE(void SetNull());
V8_INLINE(void SetUndefined());
+ V8_INLINE(void SetEmptyString());
// Convenience getter for Isolate
V8_INLINE(Isolate* GetIsolate());
@@ -5730,6 +5731,12 @@ void ReturnValue<T>::SetUndefined() {
}
template<typename T>
+void ReturnValue<T>::SetEmptyString() {
+ typedef internal::Internals I;
+ *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
+}
+
+template<typename T>
Isolate* ReturnValue<T>::GetIsolate() {
// Isolate is always the pointer below the default value on the stack.
return *reinterpret_cast<Isolate**>(&value_[-2]);
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698