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

Unified Diff: Source/bindings/core/v8/V8Binding.h

Issue 939923002: [bindings] Break V8Binding::toDouble into fast inline and slower non-inline code paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed. Created 5 years, 10 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 | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.h
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h
index 143ff2d9a8ef9e0c7c5115f1353361051818e758..8e7347fe5bab15c5742cb2e2df7faf0b7d9616a1 100644
--- a/Source/bindings/core/v8/V8Binding.h
+++ b/Source/bindings/core/v8/V8Binding.h
@@ -478,7 +478,14 @@ inline float toFloat(v8::Local<v8::Value> value)
}
// Convert a value to a double precision float, which might fail.
-double toDouble(v8::Handle<v8::Value>, ExceptionState&);
+double toDoubleSlow(v8::Handle<v8::Value>, ExceptionState&);
+
+inline double toDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
+{
+ if (value->IsNumber())
+ return value->NumberValue();
+ return toDoubleSlow(value, exceptionState);
+}
// Convert a value to a double precision float, throwing on non-finite values.
double toRestrictedDouble(v8::Handle<v8::Value>, ExceptionState&);
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698