Revision: 16652
Author: yang...@chromium.org
Date: Wed Sep 11 13:00:27 2013 UTC
Log: Add assertion to UniqueValueId constructor.
R=verwa...@chromium.org
BUG=
Review URL: https://codereview.chromium.org/23781006
http://code.google.com/p/v8/source/detail?r=16652
Modified:
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Sep 9
16:34:40 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Sep 11
13:00:27 2013 UTC
@@ -3455,7 +3455,7 @@
zone,
context(),
isolate()->factory()->free_space_map(),
- UniqueValueId(isolate()->heap()->free_space_map()));
+ UniqueValueId::free_space_map(isolate()->heap()));
filler_map->InsertAfter(free_space_instr);
HInstruction* store_map = HStoreNamedField::New(zone, context(),
free_space_instr, HObjectAccess::ForMap(), filler_map);
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Sep 10 11:11:26
2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Sep 11 13:00:27
2013 UTC
@@ -308,13 +308,9 @@
class UniqueValueId V8_FINAL {
public:
UniqueValueId() : raw_address_(NULL) { }
-
- explicit UniqueValueId(Object* object) {
- raw_address_ = reinterpret_cast<Address>(object);
- ASSERT(IsInitialized());
- }
explicit UniqueValueId(Handle<Object> handle) {
+ ASSERT(!AllowHeapAllocation::IsAllowed());
static const Address kEmptyHandleSentinel =
reinterpret_cast<Address>(1);
if (handle.is_null()) {
raw_address_ = kEmptyHandleSentinel;
@@ -341,9 +337,29 @@
ASSERT(IsInitialized());
return reinterpret_cast<intptr_t>(raw_address_);
}
+
+#define IMMOVABLE_UNIQUE_VALUE_ID(name) \
+ static UniqueValueId name(Heap* heap) { return
UniqueValueId(heap->name()); }
+
+ IMMOVABLE_UNIQUE_VALUE_ID(free_space_map)
+ IMMOVABLE_UNIQUE_VALUE_ID(minus_zero_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(nan_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(undefined_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(null_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(true_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(false_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(the_hole_value)
+ IMMOVABLE_UNIQUE_VALUE_ID(empty_string)
+
+#undef IMMOVABLE_UNIQUE_VALUE_ID
private:
Address raw_address_;
+
+ explicit UniqueValueId(Object* object) {
+ raw_address_ = reinterpret_cast<Address>(object);
+ ASSERT(IsInitialized());
+ }
};
@@ -3327,14 +3343,14 @@
ASSERT(!handle_.is_null());
Heap* heap = isolate()->heap();
- ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value()));
- ASSERT(unique_id_ != UniqueValueId(heap->nan_value()));
- return unique_id_ == UniqueValueId(heap->undefined_value()) ||
- unique_id_ == UniqueValueId(heap->null_value()) ||
- unique_id_ == UniqueValueId(heap->true_value()) ||
- unique_id_ == UniqueValueId(heap->false_value()) ||
- unique_id_ == UniqueValueId(heap->the_hole_value()) ||
- unique_id_ == UniqueValueId(heap->empty_string());
+ ASSERT(unique_id_ != UniqueValueId::minus_zero_value(heap));
+ ASSERT(unique_id_ != UniqueValueId::nan_value(heap));
+ return unique_id_ == UniqueValueId::undefined_value(heap) ||
+ unique_id_ == UniqueValueId::null_value(heap) ||
+ unique_id_ == UniqueValueId::true_value(heap) ||
+ unique_id_ == UniqueValueId::false_value(heap) ||
+ unique_id_ == UniqueValueId::the_hole_value(heap) ||
+ unique_id_ == UniqueValueId::empty_string(heap);
}
bool IsCell() const {
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Mon Sep 9 07:57:23 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Wed Sep 11 13:00:27 2013 UTC
@@ -649,7 +649,7 @@
if (!constant_##name##_.is_set())
{ \
HConstant* constant = new(zone())
HConstant( \
isolate()->factory()->name##_value(), \
-
UniqueValueId(isolate()->heap()->name##_value()), \
+
UniqueValueId::name##_value(isolate()->heap()), \
Representation::Tagged(), \
htype, \
false, \
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.