Upgrade V8 to 5.1.281.57  DO NOT MERGE

FPIIM-449

Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/src/debug/debug.h b/src/debug/debug.h
index 81db9e5..501de63 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -70,10 +70,6 @@
   static BreakLocation FromFrame(Handle<DebugInfo> debug_info,
                                  JavaScriptFrame* frame);
 
-  static void FromCodeOffsetSameStatement(Handle<DebugInfo> debug_info,
-                                          int offset,
-                                          List<BreakLocation>* result_out);
-
   static void AllForStatementPosition(Handle<DebugInfo> debug_info,
                                       int statement_position,
                                       List<BreakLocation>* result_out);
@@ -85,6 +81,9 @@
 
   inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; }
   inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; }
+  inline bool IsTailCall() const {
+    return type_ == DEBUG_BREAK_SLOT_AT_TAIL_CALL;
+  }
   inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
   inline bool IsDebuggerStatement() const {
     return type_ == DEBUGGER_STATEMENT;
@@ -117,7 +116,8 @@
     DEBUGGER_STATEMENT,
     DEBUG_BREAK_SLOT,
     DEBUG_BREAK_SLOT_AT_CALL,
-    DEBUG_BREAK_SLOT_AT_RETURN
+    DEBUG_BREAK_SLOT_AT_RETURN,
+    DEBUG_BREAK_SLOT_AT_TAIL_CALL,
   };
 
   BreakLocation(Handle<DebugInfo> debug_info, DebugBreakType type,
@@ -142,6 +142,9 @@
 
    protected:
     explicit Iterator(Handle<DebugInfo> debug_info);
+    int ReturnPosition();
+
+    Isolate* isolate() { return debug_info_->GetIsolate(); }
 
     Handle<DebugInfo> debug_info_;
     int break_index_;
@@ -169,7 +172,7 @@
     }
 
    private:
-    static int GetModeMask(BreakLocatorType type);
+    int GetModeMask(BreakLocatorType type);
     RelocInfo::Mode rmode() { return reloc_iterator_.rinfo()->rmode(); }
     RelocInfo* rinfo() { return reloc_iterator_.rinfo(); }
 
@@ -414,7 +417,6 @@
   void OnCompileError(Handle<Script> script);
   void OnBeforeCompile(Handle<Script> script);
   void OnAfterCompile(Handle<Script> script);
-  void OnPromiseEvent(Handle<JSObject> data);
   void OnAsyncTaskEvent(Handle<JSObject> data);
 
   // API facing.
@@ -430,8 +432,8 @@
 
   // Internal logic
   bool Load();
-  void Break(Arguments args, JavaScriptFrame*);
-  Object* SetAfterBreakTarget(JavaScriptFrame* frame);
+  void Break(JavaScriptFrame* frame);
+  void SetAfterBreakTarget(JavaScriptFrame* frame);
 
   // Scripts handling.
   Handle<FixedArray> GetLoadedScripts();
@@ -459,9 +461,6 @@
   void ClearStepOut();
   void EnableStepIn();
 
-  void GetStepinPositions(JavaScriptFrame* frame, StackFrame::Id frame_id,
-                          List<int>* results_out);
-
   bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared);
 
   // Returns whether the operation succeeded. Compilation can only be triggered
@@ -530,6 +529,11 @@
   StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
   int break_id() { return thread_local_.break_id_; }
 
+  Handle<Object> return_value() { return thread_local_.return_value_; }
+  void set_return_value(Handle<Object> value) {
+    thread_local_.return_value_ = value;
+  }
+
   // Support for embedding into generated code.
   Address is_active_address() {
     return reinterpret_cast<Address>(&is_active_);
@@ -575,8 +579,6 @@
       Handle<Object> promise);
   MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent(
       Handle<Script> script, v8::DebugEvent type);
-  MUST_USE_RESULT MaybeHandle<Object> MakePromiseEvent(
-      Handle<JSObject> promise_event);
   MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(
       Handle<JSObject> task_event);
 
@@ -617,6 +619,8 @@
 
   void ThreadInit();
 
+  void PrintBreakLocation();
+
   // Global handles.
   Handle<Context> debug_context_;
   Handle<Object> event_listener_;
@@ -682,6 +686,10 @@
     // Stores the way how LiveEdit has patched the stack. It is used when
     // debugger returns control back to user script.
     LiveEdit::FrameDropMode frame_drop_mode_;
+
+    // Value of accumulator in interpreter frames. In non-interpreter frames
+    // this value will be the hole.
+    Handle<Object> return_value_;
   };
 
   // Storage location for registers when handling debug break calls
@@ -723,6 +731,7 @@
   DebugScope* prev_;               // Previous scope if entered recursively.
   StackFrame::Id break_frame_id_;  // Previous break frame id.
   int break_id_;                   // Previous break id.
+  Handle<Object> return_value_;    // Previous result.
   bool failed_;                    // Did the debug context fail to load?
   SaveContext save_;               // Saves previous context.
   PostponeInterruptsScope no_termination_exceptons_;