Roll V8 back to 3.6
Roll back to V8 3.6 to fix x86 build, we don't have ucontext.h.
This reverts commits:
5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b
c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9
592a9fc1d8ea420377a2e7efd0600e20b058be2b
Bug: 5688872
Change-Id: Ic961bb5e65b778e98bbfb71cce71d99fa949e995
diff --git a/src/deoptimizer.h b/src/deoptimizer.h
index 6bc4a51..8641261 100644
--- a/src/deoptimizer.h
+++ b/src/deoptimizer.h
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -86,8 +86,8 @@
#endif
private:
- MemoryChunk* eager_deoptimization_entry_code_;
- MemoryChunk* lazy_deoptimization_entry_code_;
+ LargeObjectChunk* eager_deoptimization_entry_code_;
+ LargeObjectChunk* lazy_deoptimization_entry_code_;
Deoptimizer* current_;
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -119,9 +119,6 @@
int output_count() const { return output_count_; }
- // Number of created JS frames. Not all created frames are necessarily JS.
- int jsframe_count() const { return jsframe_count_; }
-
static Deoptimizer* New(JSFunction* function,
BailoutType type,
unsigned bailout_id,
@@ -134,7 +131,7 @@
// The returned object with information on the optimized frame needs to be
// freed before another one can be generated.
static DeoptimizedFrameInfo* DebuggerInspectableFrame(JavaScriptFrame* frame,
- int jsframe_index,
+ int frame_index,
Isolate* isolate);
static void DeleteDebuggerInspectableFrame(DeoptimizedFrameInfo* info,
Isolate* isolate);
@@ -176,8 +173,7 @@
// Patch stack guard check at instruction before pc_after in
// the unoptimized code to unconditionally call replacement_code.
- static void PatchStackCheckCodeAt(Code* unoptimized_code,
- Address pc_after,
+ static void PatchStackCheckCodeAt(Address pc_after,
Code* check_code,
Code* replacement_code);
@@ -189,8 +185,7 @@
// Change all patched stack guard checks in the unoptimized code
// back to a normal stack guard check.
- static void RevertStackCheckCodeAt(Code* unoptimized_code,
- Address pc_after,
+ static void RevertStackCheckCodeAt(Address pc_after,
Code* check_code,
Code* replacement_code);
@@ -199,11 +194,7 @@
void MaterializeHeapNumbers();
#ifdef ENABLE_DEBUGGER_SUPPORT
void MaterializeHeapNumbersForDebuggerInspectableFrame(
- Address parameters_top,
- uint32_t parameters_size,
- Address expressions_top,
- uint32_t expressions_size,
- DeoptimizedFrameInfo* info);
+ Address top, uint32_t size, DeoptimizedFrameInfo* info);
#endif
static void ComputeOutputFrames(Deoptimizer* deoptimizer);
@@ -259,10 +250,8 @@
int count_;
};
- int ConvertJSFrameIndexToFrameIndex(int jsframe_index);
-
private:
- static const int kNumberOfEntries = 16384;
+ static const int kNumberOfEntries = 4096;
Deoptimizer(Isolate* isolate,
JSFunction* function,
@@ -275,11 +264,7 @@
void DoComputeOutputFrames();
void DoComputeOsrOutputFrame();
- void DoComputeJSFrame(TranslationIterator* iterator, int frame_index);
- void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator,
- int frame_index);
- void DoComputeConstructStubFrame(TranslationIterator* iterator,
- int frame_index);
+ void DoComputeFrame(TranslationIterator* iterator, int frame_index);
void DoTranslateCommand(TranslationIterator* iterator,
int frame_index,
unsigned output_offset);
@@ -300,7 +285,7 @@
void AddDoubleValue(intptr_t slot_address, double value);
- static MemoryChunk* CreateCode(BailoutType type);
+ static LargeObjectChunk* CreateCode(BailoutType type);
static void GenerateDeoptimizationEntries(
MacroAssembler* masm, int count, BailoutType type);
@@ -327,8 +312,6 @@
FrameDescription* input_;
// Number of output frames.
int output_count_;
- // Number of output js frames.
- int jsframe_count_;
// Array of output frame descriptions.
FrameDescription** output_;
@@ -368,27 +351,14 @@
JSFunction* GetFunction() const { return function_; }
- unsigned GetOffsetFromSlotIndex(int slot_index);
+ unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index);
intptr_t GetFrameSlot(unsigned offset) {
return *GetFrameSlotPointer(offset);
}
double GetDoubleFrameSlot(unsigned offset) {
- intptr_t* ptr = GetFrameSlotPointer(offset);
-#if V8_TARGET_ARCH_MIPS
- // Prevent gcc from using load-double (mips ldc1) on (possibly)
- // non-64-bit aligned double. Uses two lwc1 instructions.
- union conversion {
- double d;
- uint32_t u[2];
- } c;
- c.u[0] = *reinterpret_cast<uint32_t*>(ptr);
- c.u[1] = *(reinterpret_cast<uint32_t*>(ptr) + 1);
- return c.d;
-#else
- return *reinterpret_cast<double*>(ptr);
-#endif
+ return *reinterpret_cast<double*>(GetFrameSlotPointer(offset));
}
void SetFrameSlot(unsigned offset, intptr_t value) {
@@ -424,28 +394,27 @@
intptr_t GetFp() const { return fp_; }
void SetFp(intptr_t fp) { fp_ = fp; }
- intptr_t GetContext() const { return context_; }
- void SetContext(intptr_t context) { context_ = context; }
-
Smi* GetState() const { return state_; }
void SetState(Smi* state) { state_ = state; }
void SetContinuation(intptr_t pc) { continuation_ = pc; }
- StackFrame::Type GetFrameType() const { return type_; }
- void SetFrameType(StackFrame::Type type) { type_ = type; }
+#ifdef DEBUG
+ Code::Kind GetKind() const { return kind_; }
+ void SetKind(Code::Kind kind) { kind_ = kind; }
+#endif
// Get the incoming arguments count.
int ComputeParametersCount();
// Get a parameter value for an unoptimized frame.
- Object* GetParameter(int index);
+ Object* GetParameter(Deoptimizer* deoptimizer, int index);
// Get the expression stack height for a unoptimized frame.
- unsigned GetExpressionCount();
+ unsigned GetExpressionCount(Deoptimizer* deoptimizer);
// Get the expression stack value for an unoptimized frame.
- Object* GetExpression(int index);
+ Object* GetExpression(Deoptimizer* deoptimizer, int index);
static int registers_offset() {
return OFFSET_OF(FrameDescription, registers_);
@@ -488,8 +457,6 @@
intptr_t top_;
intptr_t pc_;
intptr_t fp_;
- intptr_t context_;
- StackFrame::Type type_;
Smi* state_;
#ifdef DEBUG
Code::Kind kind_;
@@ -508,8 +475,6 @@
return reinterpret_cast<intptr_t*>(
reinterpret_cast<Address>(this) + frame_content_offset() + offset);
}
-
- int ComputeFixedSize();
};
@@ -552,9 +517,7 @@
public:
enum Opcode {
BEGIN,
- JS_FRAME,
- CONSTRUCT_STUB_FRAME,
- ARGUMENTS_ADAPTOR_FRAME,
+ FRAME,
REGISTER,
INT32_REGISTER,
DOUBLE_REGISTER,
@@ -569,20 +532,17 @@
DUPLICATE
};
- Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count)
+ Translation(TranslationBuffer* buffer, int frame_count)
: buffer_(buffer),
index_(buffer->CurrentIndex()) {
buffer_->Add(BEGIN);
buffer_->Add(frame_count);
- buffer_->Add(jsframe_count);
}
int index() const { return index_; }
// Commands.
- void BeginJSFrame(int node_id, int literal_id, unsigned height);
- void BeginArgumentsAdaptorFrame(int literal_id, unsigned height);
- void BeginConstructStubFrame(int literal_id, unsigned height);
+ void BeginFrame(int node_id, int literal_id, unsigned height);
void StoreRegister(Register reg);
void StoreInt32Register(Register reg);
void StoreDoubleRegister(DoubleRegister reg);
@@ -672,10 +632,9 @@
}
}
- static Vector<SlotRef> ComputeSlotMappingForArguments(
- JavaScriptFrame* frame,
- int inlined_frame_index,
- int formal_parameter_count);
+ static void ComputeSlotMappingForArguments(JavaScriptFrame* frame,
+ int inlined_frame_index,
+ Vector<SlotRef>* args_slots);
private:
Address addr_;
@@ -695,12 +654,6 @@
static SlotRef ComputeSlotForNextArgument(TranslationIterator* iterator,
DeoptimizationInputData* data,
JavaScriptFrame* frame);
-
- static void ComputeSlotsForArguments(
- Vector<SlotRef>* args_slots,
- TranslationIterator* iterator,
- DeoptimizationInputData* data,
- JavaScriptFrame* frame);
};
@@ -709,14 +662,9 @@
// needs to inspect a frame that is part of an optimized frame. The
// internally used FrameDescription objects are not GC safe so for use
// by the debugger frame information is copied to an object of this type.
-// Represents parameters in unadapted form so their number might mismatch
-// formal parameter count.
class DeoptimizedFrameInfo : public Malloced {
public:
- DeoptimizedFrameInfo(Deoptimizer* deoptimizer,
- int frame_index,
- bool has_arguments_adaptor,
- bool has_construct_stub);
+ DeoptimizedFrameInfo(Deoptimizer* deoptimizer, int frame_index);
virtual ~DeoptimizedFrameInfo();
// GC support.
@@ -733,12 +681,6 @@
return function_;
}
- // Check if this frame is preceded by construct stub frame. The bottom-most
- // inlined frame might still be called by an uninlined construct stub.
- bool HasConstructStub() {
- return has_construct_stub_;
- }
-
// Get an incoming argument.
Object* GetParameter(int index) {
ASSERT(0 <= index && index < parameters_count());
@@ -751,11 +693,12 @@
return expression_stack_[index];
}
- int GetSourcePosition() {
- return source_position_;
+ private:
+ // Set the frame function.
+ void SetFunction(JSFunction* function) {
+ function_ = function;
}
- private:
// Set an incoming argument.
void SetParameter(int index, Object* obj) {
ASSERT(0 <= index && index < parameters_count());
@@ -769,12 +712,10 @@
}
JSFunction* function_;
- bool has_construct_stub_;
int parameters_count_;
int expression_count_;
Object** parameters_;
Object** expression_stack_;
- int source_position_;
friend class Deoptimizer;
};