Upgrade to 3.7.3.

This commit is contained in:
Vanilla I. Shu 2011-11-03 15:13:15 +00:00
parent a8cfef0835
commit 613870a936
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=284987
8 changed files with 141 additions and 104 deletions

View File

@ -6,20 +6,18 @@
#
PORTNAME= v8
PORTVERSION= 3.5.10
PORTVERSION= 3.7.3
PORTREVISION= 0
CATEGORIES= lang
MASTER_SITES= http://github.com/${PORTNAME}/${PORTNAME}/tarball/${PORTVERSION}/
DISTNAME= ${PORTNAME}-${PORTNAME}-${PORTVERSION}-${GITVERSION}
MASTER_SITES= LOCAL/vanilla
MAINTAINER= vanilla@FreeBSD.org
COMMENT= Google\'s open source JavaScript engine
LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
GITVERSION= 0-g4cf15c7
USE_XZ= yes
FETCH_ARGS= -pRr
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTNAME}-${GITVERSION:S/^0-g//}
USE_SCONS= yes
USE_LDCONFIG= yes
OPTIONS= DEBUG "Build in debug mode" Off \

View File

@ -1,2 +1,2 @@
SHA256 (v8-v8-3.5.10-0-g4cf15c7.tar.gz) = 81cdde77c0e6eb9f032a4c8e36be8bc2bed0ccf37e40b61e5a25c3817bff2704
SIZE (v8-v8-3.5.10-0-g4cf15c7.tar.gz) = 10933103
SHA256 (v8-3.7.3.tar.xz) = ee993686d9c1e71f9c1adbe42d3e8ccb374f6d8f2e91c6378ce0ee880ff327fe
SIZE (v8-3.7.3.tar.xz) = 7921496

View File

@ -0,0 +1,136 @@
--- src/platform-freebsd.cc.orig 2011-10-25 19:44:21.000000000 +0800
+++ src/platform-freebsd.cc 2011-10-25 20:08:08.000000000 +0800
@@ -333,32 +333,96 @@ int OS::StackWalk(Vector<OS::StackFrame>
static const int kMmapFd = -1;
static const int kMmapFdOffset = 0;
+VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
+
+
+VirtualMemory::VirtualMemory(size_t size)
+ : address_(ReserveRegion(size)), size_(size) { }
-VirtualMemory::VirtualMemory(size_t size) {
- address_ = mmap(NULL, size, PROT_NONE,
- MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
- kMmapFd, kMmapFdOffset);
- size_ = size;
-}
+VirtualMemory::VirtualMemory(size_t size, size_t alignment)
+ : address_(NULL), size_(0) {
+ ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment())));
+ size_t request_size = RoundUp(size + alignment,
+ static_cast<intptr_t>(OS::AllocateAlignment()));
+ void* reservation = mmap(OS::GetRandomMmapAddr(),
+ request_size,
+ PROT_NONE,
+ MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
+ kMmapFd,
+ kMmapFdOffset);
+ if (reservation == MAP_FAILED) return;
+
+ Address base = static_cast<Address>(reservation);
+ Address aligned_base = RoundUp(base, alignment);
+ ASSERT_LE(base, aligned_base);
+
+ // Unmap extra memory reserved before and after the desired block.
+ if (aligned_base != base) {
+ size_t prefix_size = static_cast<size_t>(aligned_base - base);
+ OS::Free(base, prefix_size);
+ request_size -= prefix_size;
+ }
+
+ size_t aligned_size = RoundUp(size, OS::AllocateAlignment());
+ ASSERT_LE(aligned_size, request_size);
+
+ if (aligned_size != request_size) {
+ size_t suffix_size = request_size - aligned_size;
+ OS::Free(aligned_base + aligned_size, suffix_size);
+ request_size -= suffix_size;
+ }
+
+ ASSERT(aligned_size == request_size);
+
+ address_ = static_cast<void*>(aligned_base);
+ size_ = aligned_size;
+}
VirtualMemory::~VirtualMemory() {
if (IsReserved()) {
- if (0 == munmap(address(), size())) address_ = MAP_FAILED;
+ bool result = ReleaseRegion(address(), size());
+ ASSERT(result);
+ USE(result);
}
}
+void VirtualMemory::Reset() {
+ address_ = NULL;
+ size_ = 0;
+}
+
+void* VirtualMemory::ReserveRegion(size_t size) {
+ void* result = mmap(OS::GetRandomMmapAddr(),
+ size,
+ PROT_NONE,
+ MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
+ kMmapFd,
+ kMmapFdOffset);
+
+ if (result == MAP_FAILED) return NULL;
+
+ return result;
+}
bool VirtualMemory::IsReserved() {
return address_ != MAP_FAILED;
}
+bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
+ return CommitRegion(address, size, is_executable);
+}
-bool VirtualMemory::Commit(void* address, size_t size, bool executable) {
- int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
- if (MAP_FAILED == mmap(address, size, prot,
+bool VirtualMemory::CommitRegion(void* address,
+ size_t size,
+ bool is_executable) {
+ int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
+ if (MAP_FAILED == mmap(address,
+ size,
+ prot,
MAP_PRIVATE | MAP_ANON | MAP_FIXED,
- kMmapFd, kMmapFdOffset)) {
+ kMmapFd,
+ kMmapFdOffset)) {
return false;
}
@@ -366,13 +430,22 @@ bool VirtualMemory::Commit(void* address
return true;
}
-
bool VirtualMemory::Uncommit(void* address, size_t size) {
- return mmap(address, size, PROT_NONE,
+ return UncommitRegion(address, size);
+}
+
+bool VirtualMemory::UncommitRegion(void* address, size_t size) {
+ return mmap(address,
+ size,
+ PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED,
- kMmapFd, kMmapFdOffset) != MAP_FAILED;
+ kMmapFd,
+ kMmapFdOffset) != MAP_FAILED;
}
+bool VirtualMemory::ReleaseRegion(void* address, size_t size) {
+ return munmap(address, size) == 0;
+}
class Thread::PlatformData : public Malloced {
public:

View File

@ -1,19 +0,0 @@
--- src/conversions.h.orig 2011-09-23 16:57:57.000000000 +0800
+++ src/conversions.h 2011-09-23 16:58:09.000000000 +0800
@@ -45,14 +45,14 @@ namespace internal {
const int kMaxSignificantDigits = 772;
-static bool isDigit(int x, int radix) {
+static inline bool isDigit(int x, int radix) {
return (x >= '0' && x <= '9' && x < '0' + radix)
|| (radix > 10 && x >= 'a' && x < 'a' + radix - 10)
|| (radix > 10 && x >= 'A' && x < 'A' + radix - 10);
}
-static double SignedZero(bool negative) {
+static inline double SignedZero(bool negative) {
return negative ? -0.0 : 0.0;
}

View File

@ -1,28 +0,0 @@
--- src/hydrogen-instructions.cc.orig 2011-08-31 17:03:56.000000000 +0800
+++ src/hydrogen-instructions.cc 2011-09-23 20:39:25.000000000 +0800
@@ -1203,10 +1203,10 @@ void HBinaryOperation::PrintDataTo(Strin
Range* HBitAnd::InferRange() {
int32_t left_mask = (left()->range() != NULL)
? left()->range()->Mask()
- : 0xffffffff;
+ : (int32_t) 0xffffffff;
int32_t right_mask = (right()->range() != NULL)
? right()->range()->Mask()
- : 0xffffffff;
+ : (int32_t) 0xffffffff;
int32_t result_mask = left_mask & right_mask;
return (result_mask >= 0)
? new Range(0, result_mask)
@@ -1217,10 +1217,10 @@ Range* HBitAnd::InferRange() {
Range* HBitOr::InferRange() {
int32_t left_mask = (left()->range() != NULL)
? left()->range()->Mask()
- : 0xffffffff;
+ : (int32_t) 0xffffffff;
int32_t right_mask = (right()->range() != NULL)
? right()->range()->Mask()
- : 0xffffffff;
+ : (int32_t) 0xffffffff;
int32_t result_mask = left_mask | right_mask;
return (result_mask >= 0)
? new Range(0, result_mask)

View File

@ -1,29 +0,0 @@
--- src/jsregexp.cc.orig 2011-08-31 17:03:56.000000000 +0800
+++ src/jsregexp.cc 2011-09-23 20:41:09.000000000 +0800
@@ -2661,7 +2661,7 @@ int TextNode::GreedyLoopTextLength() {
// this alternative and back to this choice node. If there are variable
// length nodes or other complications in the way then return a sentinel
// value indicating that a greedy loop cannot be constructed.
-int ChoiceNode::GreedyLoopTextLength(GuardedAlternative* alternative) {
+int ChoiceNode::GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative) {
int length = 0;
RegExpNode* node = alternative->node();
// Later we will generate code for all these text nodes using recursion
@@ -2700,7 +2700,7 @@ void LoopChoiceNode::AddContinueAlternat
void LoopChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
if (trace->stop_node() == this) {
- int text_length = GreedyLoopTextLength(&(alternatives_->at(0)));
+ int text_length = GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
ASSERT(text_length != kNodeIsTooComplexForGreedyLoops);
// Update the counter-based backtracking info on the stack. This is an
// optimization for greedy loops (see below).
@@ -2893,7 +2893,7 @@ void ChoiceNode::Emit(RegExpCompiler* co
Trace* current_trace = trace;
- int text_length = GreedyLoopTextLength(&(alternatives_->at(0)));
+ int text_length = GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
bool greedy_loop = false;
Label greedy_loop_label;
Trace counter_backtrack_trace;

View File

@ -1,11 +0,0 @@
--- src/jsregexp.h.orig 2011-09-23 16:55:52.000000000 +0800
+++ src/jsregexp.h 2011-09-23 16:56:04.000000000 +0800
@@ -1071,7 +1071,7 @@ class ChoiceNode: public RegExpNode {
virtual bool try_to_emit_quick_check_for_alternative(int i) { return true; }
protected:
- int GreedyLoopTextLength(GuardedAlternative* alternative);
+ int GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
ZoneList<GuardedAlternative>* alternatives_;
private:

View File

@ -1,10 +0,0 @@
--- src/ia32/lithium-codegen-ia32.cc.orig 2011-09-23 17:00:54.000000000 +0800
+++ src/ia32/lithium-codegen-ia32.cc 2011-09-23 17:01:10.000000000 +0800
@@ -3175,7 +3175,6 @@ void LCodeGen::DoStoreKeyedFastElement(L
void LCodeGen::DoStoreKeyedFastDoubleElement(
LStoreKeyedFastDoubleElement* instr) {
XMMRegister value = ToDoubleRegister(instr->value());
- Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
Label have_value;
__ ucomisd(value, value);