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

Unified Diff: src/execution.cc

Issue 12459011: Avoid bool to Oddball conversions by being lazy. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/execution.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 705faa55480247897bd693351824c17800dfc740..10129117c2643d7bf20491af6b8898537a804bdf 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -601,22 +601,6 @@ void StackGuard::InitThread(const ExecutionAccess& lock) {
} while (false)
-Handle<Object> Execution::ToBoolean(Isolate* isolate, Handle<Object> obj) {
- // See the similar code in runtime.js:ToBoolean.
- if (obj->IsBoolean()) return obj;
- bool result = true;
- if (obj->IsString()) {
- result = Handle<String>::cast(obj)->length() != 0;
- } else if (obj->IsNull() || obj->IsUndefined()) {
- result = false;
- } else if (obj->IsNumber()) {
- double value = obj->Number();
- result = !((value == 0) || isnan(value));
- }
- return Handle<Object>(isolate->heap()->ToBoolean(result), isolate);
-}
-
-
Handle<Object> Execution::ToNumber(Handle<Object> obj, bool* exc) {
RETURN_NATIVE_CALL(to_number, { obj }, exc);
}
« no previous file with comments | « src/execution.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698