Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/debug/debug.h b/src/debug/debug.h
index 2cdc151..eb2708c 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -9,13 +9,13 @@
#include "src/arguments.h"
#include "src/assembler.h"
#include "src/base/atomicops.h"
+#include "src/base/hashmap.h"
#include "src/base/platform/platform.h"
#include "src/debug/liveedit.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/flags.h"
#include "src/frames.h"
-#include "src/hashmap.h"
#include "src/interpreter/source-position-table.h"
#include "src/runtime/runtime.h"
#include "src/string-stream.h"
@@ -38,9 +38,10 @@
StepNext = 1, // Step to the next statement in the current function.
StepIn = 2, // Step into new functions invoked or the next statement
// in the current function.
- StepFrame = 3 // Step into a new frame or return to previous frame.
-};
+ StepFrame = 3, // Step into a new frame or return to previous frame.
+ LastStepAction = StepFrame
+};
// Type of exception break. NOTE: These values are in macros.py as well.
enum ExceptionBreakType {
@@ -305,6 +306,8 @@
virtual v8::Local<v8::Context> GetEventContext() const;
virtual v8::Local<v8::Value> GetCallbackData() const;
virtual v8::Debug::ClientData* GetClientData() const;
+ virtual v8::Isolate* GetIsolate() const;
+
private:
DebugEvent event_; // Debug event causing the break.
Handle<JSObject> exec_state_; // Current execution state.
@@ -456,13 +459,15 @@
// Stepping handling.
void PrepareStep(StepAction step_action);
void PrepareStepIn(Handle<JSFunction> function);
+ void PrepareStepInSuspendedGenerator();
void PrepareStepOnThrow();
void ClearStepping();
void ClearStepOut();
- void EnableStepIn();
bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared);
+ void RecordAsyncFunction(Handle<JSGeneratorObject> generator_object);
+
// Returns whether the operation succeeded. Compilation can only be triggered
// if a valid closure is passed as the second argument, otherwise the shared
// function needs to be compiled already.
@@ -497,6 +502,7 @@
char* RestoreDebug(char* from);
static int ArchiveSpacePerThread();
void FreeThreadResources() { }
+ void Iterate(ObjectVisitor* v);
bool CheckExecutionState(int id) {
return is_active() && !debug_context().is_null() && break_id() != 0 &&
@@ -540,8 +546,12 @@
return reinterpret_cast<Address>(&after_break_target_);
}
- Address step_in_enabled_address() {
- return reinterpret_cast<Address>(&thread_local_.step_in_enabled_);
+ Address last_step_action_address() {
+ return reinterpret_cast<Address>(&thread_local_.last_step_action_);
+ }
+
+ Address suspended_generator_address() {
+ return reinterpret_cast<Address>(&thread_local_.suspended_generator_);
}
StepAction last_step_action() { return thread_local_.last_step_action_; }
@@ -564,6 +574,14 @@
return break_disabled_ || in_debug_event_listener_;
}
+ void clear_suspended_generator() {
+ thread_local_.suspended_generator_ = Smi::FromInt(0);
+ }
+
+ bool has_suspended_generator() const {
+ return thread_local_.suspended_generator_ != Smi::FromInt(0);
+ }
+
void OnException(Handle<Object> exception, Handle<Object> promise);
// Constructors for debug event objects.
@@ -675,11 +693,6 @@
// Frame pointer of the target frame we want to arrive at.
Address target_fp_;
- // Whether functions are flooded on entry for step-in and step-frame.
- // If we stepped out to the embedder, disable flooding to spill stepping
- // to the next call that the embedder makes.
- bool step_in_enabled_;
-
// 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_;
@@ -687,6 +700,8 @@
// Value of accumulator in interpreter frames. In non-interpreter frames
// this value will be the hole.
Handle<Object> return_value_;
+
+ Object* suspended_generator_;
};
// Storage location for registers when handling debug break calls