Changed all text files to have native svn:eol-style.

Added a few samples and support for building them. The samples include a simple shell that can be used to benchmark and test V8.

Changed V8::GetVersion to return the version as a string.

Added source for lazily loaded scripts to snapshots and made serialization non-destructive.

Improved ARM support by fixing the write barrier code to use aligned loads and stores and by removing premature locals optimization that relied on broken support for callee-saved registers (removed).

Refactored the code for marking live objects during garbage collection and the code for allocating objects in paged spaces. Introduced an abstraction for the map word of a heap-allocated object and changed the memory allocator to allocate executable memory only for spaces that may contain code objects.

Moved StringBuilder to utils.h and ScopedLock to platform.h, where they can be used by debugging and logging modules. Added thread-safe message queues for dealing with debugger events.

Fixed the source code reported by toString for certain builtin empty functions and made sure that the prototype property of a function is enumerable.

Improved performance of converting values to condition flags in generated code.

Merged disassembler-{arch} files.


git-svn-id: http://v8.googlecode.com/svn/trunk@8 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/frames.cc b/src/frames.cc
index 568295b..ef976a0 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -73,12 +73,12 @@
 #define INITIALIZE_SINGLETON(type, field) field##_(this),
 StackFrameIterator::StackFrameIterator()
     : STACK_FRAME_TYPE_LIST(INITIALIZE_SINGLETON)
-      frame_(NULL), handler_(NULL), thread(Top::GetCurrentThread()) {
+      frame_(NULL), handler_(NULL), thread_(Top::GetCurrentThread()) {
   Reset();
 }
 StackFrameIterator::StackFrameIterator(ThreadLocalTop* t)
     : STACK_FRAME_TYPE_LIST(INITIALIZE_SINGLETON)
-      frame_(NULL), handler_(NULL), thread(t) {
+      frame_(NULL), handler_(NULL), thread_(t) {
   Reset();
 }
 #undef INITIALIZE_SINGLETON
@@ -93,13 +93,6 @@
   StackFrame::State state;
   StackFrame::Type type = frame_->GetCallerState(&state);
 
-  // Restore any callee-saved registers to the register buffer. Avoid
-  // the virtual call if the platform doesn't have any callee-saved
-  // registers.
-  if (kNumJSCalleeSaved > 0) {
-    frame_->RestoreCalleeSavedRegisters(register_buffer());
-  }
-
   // Unwind handlers corresponding to the current frame.
   StackHandlerIterator it(frame_, handler_);
   while (!it.done()) it.Advance();
@@ -115,33 +108,11 @@
 
 
 void StackFrameIterator::Reset() {
-  Address fp = Top::c_entry_fp(thread);
+  Address fp = Top::c_entry_fp(thread_);
   StackFrame::State state;
   StackFrame::Type type = ExitFrame::GetStateForFramePointer(fp, &state);
   frame_ = SingletonFor(type, &state);
-  handler_ = StackHandler::FromAddress(Top::handler(thread));
-  // Zap the register buffer in debug mode.
-  if (kDebug) {
-    Object** buffer = register_buffer();
-    for (int i = 0; i < kNumJSCalleeSaved; i++) {
-      buffer[i] = reinterpret_cast<Object*>(kZapValue);
-    }
-  }
-}
-
-
-Object** StackFrameIterator::RestoreCalleeSavedForTopHandler(Object** buffer) {
-  ASSERT(kNumJSCalleeSaved > 0);
-  // Traverse the frames until we find the frame containing the top
-  // handler. Such a frame is guaranteed to always exists by the
-  // callers of this function.
-  for (StackFrameIterator it; true; it.Advance()) {
-    StackHandlerIterator handlers(it.frame(), it.handler());
-    if (!handlers.done()) {
-      memcpy(buffer, it.register_buffer(), kNumJSCalleeSaved * kPointerSize);
-      return buffer;
-    }
-  }
+  handler_ = StackHandler::FromAddress(Top::handler(thread_));
 }
 
 
@@ -302,20 +273,9 @@
 }
 
 
-RegList ExitFrame::FindCalleeSavedRegisters() const {
-  // Exit frames save all - if any - callee-saved registers.
-  return kJSCalleeSaved;
-}
-
-
 Address StandardFrame::GetExpressionAddress(int n) const {
-  ASSERT(0 <= n && n < ComputeExpressionsCount());
-  if (kNumJSCalleeSaved > 0 && n < kNumJSCalleeSaved) {
-    return reinterpret_cast<Address>(top_register_buffer() + n);
-  } else {
-    const int offset = StandardFrameConstants::kExpressionsOffset;
-    return fp() + offset - (n - kNumJSCalleeSaved) * kPointerSize;
-  }
+  const int offset = StandardFrameConstants::kExpressionsOffset;
+  return fp() + offset - n * kPointerSize;
 }
 
 
@@ -326,7 +286,7 @@
   Address limit = sp();
   ASSERT(base >= limit);  // stack grows downwards
   // Include register-allocated locals in number of expressions.
-  return (base - limit) / kPointerSize + kNumJSCalleeSaved;
+  return (base - limit) / kPointerSize;
 }
 
 
@@ -360,12 +320,7 @@
 int JavaScriptFrame::ComputeParametersCount() const {
   Address base  = pp() + JavaScriptFrameConstants::kReceiverOffset;
   Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset;
-  int result = (base - limit) / kPointerSize;
-  if (kNumJSCalleeSaved > 0) {
-    return result - NumRegs(FindCalleeSavedRegisters());
-  } else {
-    return result;
-  }
+  return (base - limit) / kPointerSize;
 }
 
 
@@ -492,7 +447,7 @@
   }
 
   // Print the expression stack.
-  int expressions_start = Max(stack_locals_count, kNumJSCalleeSaved);
+  int expressions_start = stack_locals_count;
   if (expressions_start < expressions_count) {
     accumulator->Add("  // expression stack (top to bottom)\n");
   }
@@ -643,36 +598,4 @@
 }
 
 
-int JSCalleeSavedCode(int n) {
-  static int reg_code[kNumJSCalleeSaved + 1];  // avoid zero-size array error
-  static bool initialized = false;
-  if (!initialized) {
-    initialized = true;
-    int i = 0;
-    for (int r = 0; r < kNumRegs; r++)
-      if ((kJSCalleeSaved & (1 << r)) != 0)
-        reg_code[i++] = r;
-
-    ASSERT(i == kNumJSCalleeSaved);
-  }
-  ASSERT(0 <= n && n < kNumJSCalleeSaved);
-  return reg_code[n];
-}
-
-
-RegList JSCalleeSavedList(int n) {
-  // avoid zero-size array error
-  static RegList reg_list[kNumJSCalleeSaved + 1];
-  static bool initialized = false;
-  if (!initialized) {
-    initialized = true;
-    reg_list[0] = 0;
-    for (int i = 0; i < kNumJSCalleeSaved; i++)
-      reg_list[i+1] = reg_list[i] + (1 << JSCalleeSavedCode(i));
-  }
-  ASSERT(0 <= n && n <= kNumJSCalleeSaved);
-  return reg_list[n];
-}
-
-
 } }  // namespace v8::internal