Push version 1.2.3 to trunk.
Fixed bug in reporting of out-of-memory situations.
Introduced hidden prototypes on certain builtin prototype objects such as String.prototype to emulate JSC's behavior of restoring the original function when deleting functions from those prototype objects.
Fixed crash bug in the register allocator.
git-svn-id: http://v8.googlecode.com/svn/trunk@1909 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 58e4f7c..7821178 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -689,6 +689,14 @@
Smi* Smi::FromInt(int value) {
ASSERT(Smi::IsValid(value));
+ intptr_t tagged_value =
+ (static_cast<intptr_t>(value) << kSmiTagSize) | kSmiTag;
+ return reinterpret_cast<Smi*>(tagged_value);
+}
+
+
+Smi* Smi::FromIntptr(intptr_t value) {
+ ASSERT(Smi::IsValid(value));
return reinterpret_cast<Smi*>((value << kSmiTagSize) | kSmiTag);
}
@@ -784,6 +792,18 @@
}
+bool Smi::IsIntptrValid(intptr_t value) {
+#ifdef DEBUG
+ bool in_range = (value >= kMinValue) && (value <= kMaxValue);
+#endif
+ // See Smi::IsValid(int) for description.
+ bool result =
+ ((static_cast<uintptr_t>(value) + 0x40000000U) < 0x80000000U);
+ ASSERT(result == in_range);
+ return result;
+}
+
+
MapWord MapWord::FromMap(Map* map) {
return MapWord(reinterpret_cast<uintptr_t>(map));
}
@@ -2071,6 +2091,7 @@
ACCESSORS(Script, line_offset, Smi, kLineOffsetOffset)
ACCESSORS(Script, column_offset, Smi, kColumnOffsetOffset)
ACCESSORS(Script, data, Object, kDataOffset)
+ACCESSORS(Script, context_data, Object, kContextOffset)
ACCESSORS(Script, wrapper, Proxy, kWrapperOffset)
ACCESSORS(Script, type, Smi, kTypeOffset)
ACCESSORS(Script, line_ends, Object, kLineEndsOffset)