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

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

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 | « Source/bindings/core/v8/V8Binding.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.cpp
diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
index 99d6c4facf7b935226d51d804287b84e0b28dcc4..3496cecf602a09291cef3c2df2a8cbaa960414ca 100644
--- a/Source/bindings/core/v8/V8Binding.cpp
+++ b/Source/bindings/core/v8/V8Binding.cpp
@@ -531,19 +531,16 @@ float toRestrictedFloat(v8::Handle<v8::Value> value, ExceptionState& exceptionSt
return numberValue;
}
-double toDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
+double toDoubleSlow(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
{
- if (value->IsNumber())
- return value->NumberValue();
-
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::TryCatch block(isolate);
- v8::Local<v8::Number> numberObject(value->ToNumber(isolate));
+ double doubleValue = value->NumberValue();
if (block.HasCaught()) {
exceptionState.rethrowV8Exception(block.Exception());
return 0;
}
- return numberObject->NumberValue();
+ return doubleValue;
}
double toRestrictedDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698