Update V8 to r7427: Initial merge by git
As required by WebKit r82507
Change-Id: I7ae83ef3f689356043b4929255b7c1dd31d8c5df
diff --git a/src/deoptimizer.h b/src/deoptimizer.h
index 1d4f477..a53de3d 100644
--- a/src/deoptimizer.h
+++ b/src/deoptimizer.h
@@ -93,6 +93,31 @@
};
+class Deoptimizer;
+
+
+class DeoptimizerData {
+ public:
+ DeoptimizerData();
+ ~DeoptimizerData();
+
+ private:
+ LargeObjectChunk* eager_deoptimization_entry_code_;
+ LargeObjectChunk* lazy_deoptimization_entry_code_;
+ Deoptimizer* current_;
+
+ // List of deoptimized code which still have references from active stack
+ // frames. These code objects are needed by the deoptimizer when deoptimizing
+ // a frame for which the code object for the function function has been
+ // changed from the code present when deoptimizing was done.
+ DeoptimizingCodeListNode* deoptimizing_code_list_;
+
+ friend class Deoptimizer;
+
+ DISALLOW_COPY_AND_ASSIGN(DeoptimizerData);
+};
+
+
class Deoptimizer : public Malloced {
public:
enum BailoutType {
@@ -107,8 +132,16 @@
BailoutType type,
unsigned bailout_id,
Address from,
- int fp_to_sp_delta);
- static Deoptimizer* Grab();
+ int fp_to_sp_delta,
+ Isolate* isolate);
+ static Deoptimizer* Grab(Isolate* isolate);
+
+ // Makes sure that there is enough room in the relocation
+ // information of a code object to perform lazy deoptimization
+ // patching. If there is not enough room a new relocation
+ // information object is allocated and comments are added until it
+ // is big enough.
+ static void EnsureRelocSpaceForLazyDeoptimization(Handle<Code> code);
// Deoptimize the function now. Its current optimized code will never be run
// again and any activations of the optimized code will get deoptimized when
@@ -159,7 +192,7 @@
void InsertHeapNumberValues(int index, JavaScriptFrame* frame);
- static void ComputeOutputFrames(Deoptimizer* deoptimizer);
+ static void ComputeOutputFrames(Deoptimizer* deoptimizer, Isolate* isolate);
static Address GetDeoptimizationEntry(int id, BailoutType type);
static int GetDeoptimizationId(Address addr, BailoutType type);
@@ -167,9 +200,6 @@
unsigned node_id,
SharedFunctionInfo* shared);
- static void Setup();
- static void TearDown();
-
// Code generation support.
static int input_offset() { return OFFSET_OF(Deoptimizer, input_); }
static int output_count_offset() {
@@ -177,7 +207,7 @@
}
static int output_offset() { return OFFSET_OF(Deoptimizer, output_); }
- static int GetDeoptimizedCodeCount();
+ static int GetDeoptimizedCodeCount(Isolate* isolate);
static const int kNotDeoptimizationEntry = -1;
@@ -218,7 +248,8 @@
private:
static const int kNumberOfEntries = 4096;
- Deoptimizer(JSFunction* function,
+ Deoptimizer(Isolate* isolate,
+ JSFunction* function,
BailoutType type,
unsigned bailout_id,
Address from,
@@ -264,16 +295,7 @@
static Code* FindDeoptimizingCodeFromAddress(Address addr);
static void RemoveDeoptimizingCode(Code* code);
- static LargeObjectChunk* eager_deoptimization_entry_code_;
- static LargeObjectChunk* lazy_deoptimization_entry_code_;
- static Deoptimizer* current_;
-
- // List of deoptimized code which still have references from active stack
- // frames. These code objects are needed by the deoptimizer when deoptimizing
- // a frame for which the code object for the function function has been
- // changed from the code present when deoptimizing was done.
- static DeoptimizingCodeListNode* deoptimizing_code_list_;
-
+ Isolate* isolate_;
JSFunction* function_;
Code* optimized_code_;
unsigned bailout_id_;
@@ -304,7 +326,9 @@
JSFunction* function);
void* operator new(size_t size, uint32_t frame_size) {
- return malloc(size + frame_size);
+ // Subtracts kPointerSize, as the member frame_content_ already supplies
+ // the first element of the area to store the frame.
+ return malloc(size + frame_size - kPointerSize);
}
void operator delete(void* description) {
@@ -388,7 +412,7 @@
}
static int frame_content_offset() {
- return sizeof(FrameDescription);
+ return OFFSET_OF(FrameDescription, frame_content_);
}
private:
@@ -407,6 +431,10 @@
// deoptimizing.
intptr_t continuation_;
+ // This must be at the end of the object as the object is allocated larger
+ // than it's definition indicate to extend this array.
+ intptr_t frame_content_[1];
+
intptr_t* GetFrameSlotPointer(unsigned offset) {
ASSERT(offset < frame_size_);
return reinterpret_cast<intptr_t*>(