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

Unified Diff: src/hydrogen-instructions.cc

Issue 146623003: Improve HConstant::ImmortalImmovable() to check for all immortal immovable roots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 889ebfd05fc6f47a4cb835269ab29ddbd686f02e..469caf6c46763ebe09b4d910f6dc98a17e31a59a 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2611,6 +2611,41 @@ void HConstant::Initialize(Representation r) {
}
+bool HConstant::ImmortalImmovable() const {
+ if (has_int32_value_) {
+ return false;
+ }
+ if (has_double_value_) {
+ if (IsSpecialDouble()) {
+ return true;
+ }
+ return false;
+ }
+ if (has_external_reference_value_) {
+ return false;
+ }
+
+ ASSERT(!object_.handle().is_null());
+ Heap* heap = isolate()->heap();
+ ASSERT(!object_.IsKnownGlobal(heap->minus_zero_value()));
+ ASSERT(!object_.IsKnownGlobal(heap->nan_value()));
+ return
+#define IMMORTAL_IMMOVABLE_ROOT(name) \
+ object_.IsKnownGlobal(heap->name()) ||
+ IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT)
+#undef IMMORTAL_IMMOVABLE_ROOT
+#define INTERNALIZED_STRING(name, value) \
+ object_.IsKnownGlobal(heap->name()) ||
+ INTERNALIZED_STRING_LIST(INTERNALIZED_STRING)
+#undef INTERNALIZED_STRING
+#define STRING_TYPE(NAME, size, name, Name) \
+ object_.IsKnownGlobal(heap->name##_map()) ||
+ STRING_TYPE_LIST(STRING_TYPE)
+#undef STRING_TYPE
+ false;
+}
+
+
bool HConstant::EmitAtUses() {
ASSERT(IsLinked());
if (block()->graph()->has_osr() &&
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698