Fixed exception reporting bug where certain exceptions were incorrectly reported as uncaught.

Improved the memory allocation strategy used during compilation to make running out of memory when compiling huge scripts less likely.

Optimized String.replace by avoiding the construction of certain sub strings.

Fixed bug in code generation for large switch statements on ARM.

Fixed bug that caused V8 to change the global object template passed in by the user.

Changed the API for creating object groups used during garbage collection.  Entire object groups are now passed to V8 instead of individual members of the groups.


git-svn-id: http://v8.googlecode.com/svn/trunk@968 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/debug.h b/src/debug.h
index 629cebe..fdb80bd 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -194,7 +194,6 @@
 
   static Handle<Object> GetSourceBreakLocations(
       Handle<SharedFunctionInfo> shared);
-  static Code* GetCodeTarget(Address target);
 
   // Getter for the debug_context.
   inline static Handle<Context> debug_context() { return debug_context_; }
@@ -262,6 +261,19 @@
   static const int kIa32CallInstructionLength = 5;
   static const int kIa32JSReturnSequenceLength = 6;
 
+  // Code generator routines.
+  static void GenerateLoadICDebugBreak(MacroAssembler* masm);
+  static void GenerateStoreICDebugBreak(MacroAssembler* masm);
+  static void GenerateKeyedLoadICDebugBreak(MacroAssembler* masm);
+  static void GenerateKeyedStoreICDebugBreak(MacroAssembler* masm);
+  static void GenerateConstructCallDebugBreak(MacroAssembler* masm);
+  static void GenerateReturnDebugBreak(MacroAssembler* masm);
+  static void GenerateReturnDebugBreakEntry(MacroAssembler* masm);
+  static void GenerateStubNoRegistersDebugBreak(MacroAssembler* masm);
+
+  // Called from stub-cache.cc.
+  static void GenerateCallICDebugBreak(MacroAssembler* masm);
+
  private:
   static bool CompileDebuggerScript(int index);
   static void ClearOneShot();
@@ -448,7 +460,7 @@
   // which forwards it to the debug_message_handler set by the API.
   void SendMessage(Vector<uint16_t> event_json);
   // Formats an event into JSON, and calls SendMessage.
-  void SetEventJSONFromEvent(Handle<Object> event_data);
+  bool SetEventJSONFromEvent(Handle<Object> event_data);
   // Puts a command coming from the public API on the queue.  Called
   // by the API client thread.  This is where the API client hands off
   // processing of the command to the DebugMessageThread thread.
@@ -477,16 +489,17 @@
 // some reason could not be entered FailedToEnter will return true.
 class EnterDebugger BASE_EMBEDDED {
  public:
-  EnterDebugger() : set_(!it_.done()) {
-    // If there is no JavaScript frames on the stack don't switch to new break
-    // and break frame.
-    if (set_) {
-      // Store the previous break is and frame id.
-      break_id_ = Top::break_id();
-      break_frame_id_ = Top::break_frame_id();
+  EnterDebugger() : has_js_frames_(!it_.done()) {
+    // Store the previous break id and frame id.
+    break_id_ = Top::break_id();
+    break_frame_id_ = Top::break_frame_id();
 
-      // Create the new break info.
+    // Create the new break info. If there is no JavaScript frames there is no
+    // break frame id.
+    if (has_js_frames_) {
       Top::new_break(it_.frame()->id());
+    } else {
+      Top::new_break(StackFrame::NO_ID);
     }
 
     // Make sure that debugger is loaded and enter the debugger context.
@@ -499,21 +512,19 @@
   }
 
   ~EnterDebugger() {
-    if (set_) {
-      // Restore to the previous break state.
-      Top::set_break(break_frame_id_, break_id_);
-    }
+    // Restore to the previous break state.
+    Top::set_break(break_frame_id_, break_id_);
   }
 
   // Check whether the debugger could be entered.
   inline bool FailedToEnter() { return load_failed_; }
 
   // Check whether there are any JavaScript frames on the stack.
-  inline bool HasJavaScriptFrames() { return set_; }
+  inline bool HasJavaScriptFrames() { return has_js_frames_; }
 
  private:
   JavaScriptFrameIterator it_;
-  const bool set_;  // Was the break actually set?
+  const bool has_js_frames_;  // Were there any JavaScript frames?
   StackFrame::Id break_frame_id_;  // Previous break frame id.
   int break_id_;  // Previous break id.
   bool load_failed_;  // Did the debugger fail to load?