Version 1.2.5.

Fixed bug in initial boundary check for Boyer-Moore text search (issue 349).

Fixed compilation issues with MinGW and gcc 4.3+ and added support for armv7 and cortex-a8 architectures.  Patches by Lei Zhang and Craig Schlenter.

Added a script cache to the debugger.

Optimized compilation performance by improving internal data structures and avoiding expensive property load optimizations for code that's infrequently executed.

Exposed the calling JavaScript context through the static API function Context::GetCalling().


git-svn-id: http://v8.googlecode.com/svn/trunk@2050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 7821178..475b57b 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -40,7 +40,8 @@
 #include "conversions-inl.h"
 #include "property.h"
 
-namespace v8 { namespace internal {
+namespace v8 {
+namespace internal {
 
 PropertyDetails::PropertyDetails(Smi* smi) {
   value_ = smi->value();
@@ -764,9 +765,11 @@
 
 Failure* Failure::Construct(Type type, int value) {
   int info = (value << kFailureTypeTagSize) | type;
+  // TODO(X64): Stop using Smi validation for non-smi checks, even if they
+  // happen to be identical at the moment.
   ASSERT(Smi::IsValid(info));  // Same validation check as in Smi
   return reinterpret_cast<Failure*>(
-      static_cast<intptr_t>((info << kFailureTagSize) | kFailureTag));
+      (static_cast<intptr_t>(info) << kFailureTagSize) | kFailureTag);
 }
 
 
@@ -1794,7 +1797,7 @@
 
 
 void Map::set_instance_size(int value) {
-  ASSERT((value & ~(kPointerSize - 1)) == value);
+  ASSERT_EQ(0, value & (kPointerSize - 1));
   value >>= kPointerSizeLog2;
   ASSERT(0 <= value && value < 256);
   WRITE_BYTE_FIELD(this, kInstanceSizeOffset, static_cast<byte>(value));
@@ -1895,6 +1898,11 @@
 }
 
 
+InLoopFlag Code::ic_in_loop() {
+  return ExtractICInLoopFromFlags(flags());
+}
+
+
 InlineCacheState Code::ic_state() {
   InlineCacheState result = ExtractICStateFromFlags(flags());
   // Only allow uninitialized or debugger states for non-IC code
@@ -1941,11 +1949,13 @@
 
 
 Code::Flags Code::ComputeFlags(Kind kind,
+                               InLoopFlag in_loop,
                                InlineCacheState ic_state,
                                PropertyType type,
                                int argc) {
   // Compute the bit mask.
   int bits = kind << kFlagsKindShift;
+  if (in_loop) bits |= kFlagsICInLoopMask;
   bits |= ic_state << kFlagsICStateShift;
   bits |= type << kFlagsTypeShift;
   bits |= argc << kFlagsArgumentsCountShift;
@@ -1953,6 +1963,7 @@
   Flags result = static_cast<Flags>(bits);
   ASSERT(ExtractKindFromFlags(result) == kind);
   ASSERT(ExtractICStateFromFlags(result) == ic_state);
+  ASSERT(ExtractICInLoopFromFlags(result) == in_loop);
   ASSERT(ExtractTypeFromFlags(result) == type);
   ASSERT(ExtractArgumentsCountFromFlags(result) == argc);
   return result;
@@ -1961,8 +1972,9 @@
 
 Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
                                           PropertyType type,
+                                          InLoopFlag in_loop,
                                           int argc) {
-  return ComputeFlags(kind, MONOMORPHIC, type, argc);
+  return ComputeFlags(kind, in_loop, MONOMORPHIC, type, argc);
 }
 
 
@@ -1978,6 +1990,12 @@
 }
 
 
+InLoopFlag Code::ExtractICInLoopFromFlags(Flags flags) {
+  int bits = (flags & kFlagsICInLoopMask);
+  return bits != 0 ? IN_LOOP : NOT_IN_LOOP;
+}
+
+
 PropertyType Code::ExtractTypeFromFlags(Flags flags) {
   int bits = (flags & kFlagsTypeMask) >> kFlagsTypeShift;
   return static_cast<PropertyType>(bits);