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

Unified Diff: src/api.cc

Issue 60083: Move some more ENTER_V8 invocations. The biggest one is to move the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
===================================================================
--- src/api.cc (revision 1672)
+++ src/api.cc (working copy)
@@ -1455,11 +1455,14 @@
Local<Boolean> Value::ToBoolean() const {
if (IsDeadCheck("v8::Value::ToBoolean()")) return Local<Boolean>();
LOG_API("ToBoolean");
- ENTER_V8;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
- i::Handle<i::Object> val =
- obj->IsBoolean() ? obj : i::Execution::ToBoolean(obj);
- return Local<Boolean>(ToApi<Boolean>(val));
+ if (obj->IsBoolean()) {
+ return Local<Boolean>(ToApi<Boolean>(obj));
+ } else {
+ ENTER_V8;
+ i::Handle<i::Object> val = i::Execution::ToBoolean(obj);
+ return Local<Boolean>(ToApi<Boolean>(val));
+ }
}
@@ -1580,11 +1583,14 @@
bool Value::BooleanValue() const {
if (IsDeadCheck("v8::Value::BooleanValue()")) return false;
LOG_API("BooleanValue");
- ENTER_V8;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
- i::Handle<i::Object> value =
- obj->IsBoolean() ? obj : i::Execution::ToBoolean(obj);
- return value->IsTrue();
+ if (obj->IsBoolean()) {
+ return obj->IsTrue();
+ } else {
+ ENTER_V8;
+ i::Handle<i::Object> value = i::Execution::ToBoolean(obj);
+ return value->IsTrue();
+ }
}
@@ -2347,8 +2353,8 @@
// --- E n v i r o n m e n t ---
bool v8::V8::Initialize() {
+ if (i::V8::HasBeenSetup()) return true;
ENTER_V8;
- if (i::V8::HasBeenSetup()) return true;
HandleScope scope;
if (i::Snapshot::Initialize()) {
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698