Upgrade V8 to 5.1.281.57  DO NOT MERGE

FPIIM-449

Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h
index 387dd0c..f10150d 100644
--- a/src/heap/incremental-marking.h
+++ b/src/heap/incremental-marking.h
@@ -29,7 +29,7 @@
 
   enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION };
 
-  enum GCRequestType { COMPLETE_MARKING, FINALIZATION };
+  enum GCRequestType { NONE, COMPLETE_MARKING, FINALIZATION };
 
   struct StepActions {
     StepActions(CompletionAction complete_action_,
@@ -80,6 +80,8 @@
 
   GCRequestType request_type() const { return request_type_; }
 
+  void reset_request_type() { request_type_ = NONE; }
+
   bool CanBeActivated();
 
   bool ShouldActivateEvenWithoutIdleNotification();
@@ -104,13 +106,10 @@
 
   void Epilogue();
 
-  // Performs incremental marking steps of step_size_in_bytes as long as
-  // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute
-  // an estimate increment. Returns the remaining time that cannot be used
-  // for incremental marking anymore because a single step would exceed the
-  // deadline.
-  double AdvanceIncrementalMarking(intptr_t step_size_in_bytes,
-                                   double deadline_in_ms,
+  // Performs incremental marking steps until deadline_in_ms is reached. It
+  // returns the remaining time that cannot be used for incremental marking
+  // anymore because a single step would exceed the deadline.
+  double AdvanceIncrementalMarking(double deadline_in_ms,
                                    StepActions step_actions);
 
   // It's hard to know how much work the incremental marker should do to make
@@ -165,23 +164,17 @@
   // the incremental cycle (stays white).
   INLINE(bool BaseRecordWrite(HeapObject* obj, Object* value));
   INLINE(void RecordWrite(HeapObject* obj, Object** slot, Object* value));
-  INLINE(void RecordWriteIntoCode(HeapObject* obj, RelocInfo* rinfo,
-                                  Object* value));
+  INLINE(void RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* value));
   INLINE(void RecordWriteOfCodeEntry(JSFunction* host, Object** slot,
                                      Code* value));
 
 
   void RecordWriteSlow(HeapObject* obj, Object** slot, Object* value);
-  void RecordWriteIntoCodeSlow(HeapObject* obj, RelocInfo* rinfo,
-                               Object* value);
+  void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* value);
   void RecordWriteOfCodeEntrySlow(JSFunction* host, Object** slot, Code* value);
   void RecordCodeTargetPatch(Code* host, Address pc, HeapObject* value);
   void RecordCodeTargetPatch(Address pc, HeapObject* value);
 
-  void RecordWrites(HeapObject* obj);
-
-  void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit);
-
   void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit);
 
   inline void SetOldSpacePageFlags(MemoryChunk* chunk) {
@@ -198,10 +191,6 @@
 
   void NotifyOfHighPromotionRate();
 
-  void EnterNoMarkingScope() { no_marking_scope_depth_++; }
-
-  void LeaveNoMarkingScope() { no_marking_scope_depth_--; }
-
   void NotifyIncompleteScanOfObject(int unscanned_bytes) {
     unscanned_bytes_of_large_object_ = unscanned_bytes;
   }
@@ -210,7 +199,9 @@
 
   bool IsIdleMarkingDelayCounterLimitReached();
 
-  INLINE(static void MarkObject(Heap* heap, HeapObject* object));
+  static void MarkObject(Heap* heap, HeapObject* object);
+
+  void IterateBlackObject(HeapObject* object);
 
   Heap* heap() const { return heap_; }
 
@@ -218,6 +209,8 @@
     return &incremental_marking_job_;
   }
 
+  bool black_allocation() { return black_allocation_; }
+
  private:
   class Observer : public AllocationObserver {
    public:
@@ -242,6 +235,9 @@
 
   void StartMarking();
 
+  void StartBlackAllocation();
+  void FinishBlackAllocation();
+
   void MarkRoots();
   void MarkObjectGroups();
   void ProcessWeakCells();
@@ -288,12 +284,12 @@
   intptr_t write_barriers_invoked_since_last_step_;
   size_t idle_marking_delay_counter_;
 
-  int no_marking_scope_depth_;
-
   int unscanned_bytes_of_large_object_;
 
   bool was_activated_;
 
+  bool black_allocation_;
+
   bool finalize_marking_completed_;
 
   int incremental_marking_finalization_rounds_;