Update V8 to r7427: Initial merge by git
As required by WebKit r82507
Change-Id: I7ae83ef3f689356043b4929255b7c1dd31d8c5df
diff --git a/src/frames.h b/src/frames.h
index 5378709..bee95cc 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -28,6 +28,7 @@
#ifndef V8_FRAMES_H_
#define V8_FRAMES_H_
+#include "handles.h"
#include "safepoint-table.h"
namespace v8 {
@@ -44,11 +45,10 @@
// Forward declarations.
class StackFrameIterator;
-class Top;
class ThreadLocalTop;
+class Isolate;
-
-class PcToCodeCache : AllStatic {
+class PcToCodeCache {
public:
struct PcToCodeCacheEntry {
Address pc;
@@ -56,22 +56,28 @@
SafepointEntry safepoint_entry;
};
- static PcToCodeCacheEntry* cache(int index) {
- return &cache_[index];
+ explicit PcToCodeCache(Isolate* isolate) : isolate_(isolate) {
+ Flush();
}
- static Code* GcSafeFindCodeForPc(Address pc);
- static Code* GcSafeCastToCode(HeapObject* object, Address pc);
+ Code* GcSafeFindCodeForPc(Address pc);
+ Code* GcSafeCastToCode(HeapObject* object, Address pc);
- static void FlushPcToCodeCache() {
+ void Flush() {
memset(&cache_[0], 0, sizeof(cache_));
}
- static PcToCodeCacheEntry* GetCacheEntry(Address pc);
+ PcToCodeCacheEntry* GetCacheEntry(Address pc);
private:
+ PcToCodeCacheEntry* cache(int index) { return &cache_[index]; }
+
+ Isolate* isolate_;
+
static const int kPcToCodeCacheSize = 1024;
- static PcToCodeCacheEntry cache_[kPcToCodeCacheSize];
+ PcToCodeCacheEntry cache_[kPcToCodeCacheSize];
+
+ DISALLOW_COPY_AND_ASSIGN(PcToCodeCache);
};
@@ -199,12 +205,12 @@
virtual Code* unchecked_code() const = 0;
// Get the code associated with this frame.
- Code* code() const { return GetContainingCode(pc()); }
+ Code* LookupCode(Isolate* isolate) const {
+ return GetContainingCode(isolate, pc());
+ }
// Get the code object that contains the given pc.
- static Code* GetContainingCode(Address pc) {
- return PcToCodeCache::GetCacheEntry(pc)->code;
- }
+ static inline Code* GetContainingCode(Isolate* isolate, Address pc);
// Get the code object containing the given pc and fill in the
// safepoint entry and the number of stack slots. The pc must be at
@@ -452,12 +458,6 @@
Object* GetParameter(int index) const;
int ComputeParametersCount() const;
- // Temporary way of getting access to the number of parameters
- // passed on the stack by the caller. Once argument adaptor frames
- // has been introduced on ARM, this number will always match the
- // computed parameters count.
- int GetProvidedParametersCount() const;
-
// Check if this frame is a constructor frame invoked through 'new'.
bool IsConstructor() const;
@@ -618,7 +618,7 @@
// An iterator that can start from a given FP address.
// If use_top, then work as usual, if fp isn't NULL, use it,
// otherwise, do nothing.
- StackFrameIterator(bool use_top, Address fp, Address sp);
+ StackFrameIterator(Isolate* isolate, bool use_top, Address fp, Address sp);
StackFrame* frame() const {
ASSERT(!done());
@@ -681,6 +681,13 @@
if (!done()) Advance();
}
+ JavaScriptFrameIteratorTemp(Isolate* isolate,
+ Address fp, Address sp,
+ Address low_bound, Address high_bound) :
+ iterator_(isolate, fp, sp, low_bound, high_bound) {
+ if (!done()) Advance();
+ }
+
inline JavaScriptFrame* frame() const;
bool done() const { return iterator_.done(); }
@@ -718,7 +725,8 @@
class SafeStackFrameIterator BASE_EMBEDDED {
public:
- SafeStackFrameIterator(Address fp, Address sp,
+ SafeStackFrameIterator(Isolate* isolate,
+ Address fp, Address sp,
Address low_bound, Address high_bound);
StackFrame* frame() const {
@@ -768,7 +776,8 @@
bool CanIterateHandles(StackFrame* frame, StackHandler* handler);
bool IsValidFrame(StackFrame* frame) const;
bool IsValidCaller(StackFrame* frame);
- static bool IsValidTop(Address low_bound, Address high_bound);
+ static bool IsValidTop(Isolate* isolate,
+ Address low_bound, Address high_bound);
// This is a nasty hack to make sure the active count is incremented
// before the constructor for the embedded iterator is invoked. This
@@ -782,6 +791,7 @@
};
ActiveCountMaintainer maintainer_;
+ // TODO(isolates): this is dangerous.
static int active_count_;
StackAddressValidator stack_validator_;
const bool is_valid_top_;
@@ -799,7 +809,8 @@
class SafeStackTraceFrameIterator: public SafeJavaScriptFrameIterator {
public:
- explicit SafeStackTraceFrameIterator(Address fp, Address sp,
+ explicit SafeStackTraceFrameIterator(Isolate* isolate,
+ Address fp, Address sp,
Address low_bound, Address high_bound);
void Advance();
};