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

Unified Diff: src/code-stubs.cc

Issue 7484022: Do not explicitly record undetectable objects in the ToBoolean stub. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
===================================================================
--- src/code-stubs.cc (revision 8716)
+++ src/code-stubs.cc (working copy)
@@ -342,7 +342,6 @@
if (Contains(BOOLEAN)) stream->Add("Bool");
if (Contains(SMI)) stream->Add("Smi");
if (Contains(NULL_TYPE)) stream->Add("Null");
- if (Contains(UNDETECTABLE)) stream->Add("Undetectable");
if (Contains(SPEC_OBJECT)) stream->Add("SpecObject");
if (Contains(STRING)) stream->Add("String");
if (Contains(HEAP_NUMBER)) stream->Add("HeapNumber");
@@ -378,22 +377,20 @@
} else if (object->IsSmi()) {
Add(SMI);
return Smi::cast(*object)->value() != 0;
- } else if (object->IsUndetectableObject()) {
- Add(UNDETECTABLE);
- return false;
} else if (object->IsSpecObject()) {
Add(SPEC_OBJECT);
- return true;
+ return !object->IsUndetectableObject();
} else if (object->IsString()) {
Add(STRING);
- return String::cast(*object)->length() != 0;
+ return !object->IsUndetectableObject() &&
+ String::cast(*object)->length() != 0;
} else if (object->IsHeapNumber()) {
Add(HEAP_NUMBER);
double value = HeapNumber::cast(*object)->value();
- return value != 0 && !isnan(value);
+ return !object->IsUndetectableObject() && value != 0 && !isnan(value);
} else {
Add(INTERNAL_OBJECT);
- return true;
+ return !object->IsUndetectableObject();
}
}
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698