Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Lubomir Rintel
f61de35059 Actually add the sconstruct patch 2019-03-26 09:58:00 +01:00
Lubomir Rintel
ead160dc5c Fix build with newer SConstruct & GCC 2019-03-20 10:24:57 +01:00
Lubomir Rintel
40dc258a76 Revert "old, broken, effectively useless"
This reverts commit b7a8187978.
2019-03-19 13:18:29 +01:00
35 changed files with 63718 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/v8-3.14.5.10.tar.bz2

935
0002_mips.patch Normal file
View file

@ -0,0 +1,935 @@
Description: mips arch support backported to v8 3.14 branch
Origin: https://github.com/paul99/v8m-rb/tree/dm-mipsbe-3.14
Last-Update: 2014-04-09
Acked-by: Jérémy Lal <kapouer@melix.org>
--- a/Makefile
+++ b/Makefile
@@ -133,7 +133,7 @@
# Architectures and modes to be compiled. Consider these to be internal
# variables, don't override them (use the targets instead).
-ARCHES = ia32 x64 arm mipsel
+ARCHES = ia32 x64 arm mipsel mips
DEFAULT_ARCHES = ia32 x64 arm
MODES = release debug
ANDROID_ARCHES = android_ia32 android_arm
@@ -168,10 +168,6 @@
$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
-mips mips.release mips.debug:
- @echo "V8 does not support big-endian MIPS builds at the moment," \
- "please use little-endian builds (mipsel)."
-
# Compile targets. MODES and ARCHES are convenience targets.
.SECONDEXPANSION:
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -176,7 +176,7 @@
'V8_TARGET_ARCH_IA32',
],
}], # v8_target_arch=="ia32"
- ['v8_target_arch=="mipsel"', {
+ ['v8_target_arch=="mipsel" or v8_target_arch=="mips"', {
'defines': [
'V8_TARGET_ARCH_MIPS',
],
@@ -187,12 +187,17 @@
['mipscompiler=="yes"', {
'target_conditions': [
['_toolset=="target"', {
- 'cflags': ['-EL'],
- 'ldflags': ['-EL'],
'conditions': [
+ ['v8_target_arch=="mipsel"', {
+ 'cflags': ['-EL'],
+ 'ldflags': ['-EL'],
+ }],
+ ['v8_target_arch=="mips"', {
+ 'cflags': ['-EB'],
+ 'ldflags': ['-EB'],
+ }],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'cflags': ['-mhard-float'],
- 'ldflags': ['-mhard-float'],
}, {
'cflags': ['-msoft-float'],
'ldflags': ['-msoft-float'],
@@ -202,7 +207,8 @@
}],
['mips_arch_variant=="loongson"', {
'cflags': ['-mips3', '-Wa,-mips3'],
- }, {
+ }],
+ ['mips_arch_variant=="mips32r1"', {
'cflags': ['-mips32', '-Wa,-mips32'],
}],
],
@@ -290,7 +296,7 @@
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="mac" or OS=="android") and \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
- v8_target_arch=="mipsel")', {
+ v8_target_arch=="mipsel" or v8_target_arch=="mips")', {
# Check whether the host compiler and target compiler support the
# '-m32' option and set it if so.
'target_conditions': [
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -68,6 +68,7 @@
'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="mipsel" and host_arch!="mipsel") or \
+ (v8_target_arch=="mips" and host_arch!="mips") or \
(v8_target_arch=="x64" and host_arch!="x64") or \
(OS=="android")', {
'want_separate_host_toolset': 1,
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -75,7 +75,11 @@
if (x < k2Pow52) {
x += k2Pow52;
uint32_t result;
+#ifndef BIG_ENDIAN_FLOATING_POINT
Address mantissa_ptr = reinterpret_cast<Address>(&x);
+#else
+ Address mantissa_ptr = reinterpret_cast<Address>(&x) + 4;
+#endif
// Copy least significant 32 bits of mantissa.
memcpy(&result, mantissa_ptr, sizeof(result));
return negative ? ~result + 1 : result;
--- a/src/globals.h
+++ b/src/globals.h
@@ -83,7 +83,7 @@
#if CAN_USE_UNALIGNED_ACCESSES
#define V8_HOST_CAN_READ_UNALIGNED 1
#endif
-#elif defined(__MIPSEL__)
+#elif defined(__MIPSEL__) || defined(__MIPSEB__)
#define V8_HOST_ARCH_MIPS 1
#define V8_HOST_ARCH_32_BIT 1
#else
@@ -101,13 +101,17 @@
#define V8_TARGET_ARCH_IA32 1
#elif defined(__ARMEL__)
#define V8_TARGET_ARCH_ARM 1
-#elif defined(__MIPSEL__)
+#elif defined(__MIPSEL__) || defined(__MIPSEB__)
#define V8_TARGET_ARCH_MIPS 1
#else
#error Target architecture was not detected as supported by v8
#endif
#endif
+#if defined(__MIPSEB__)
+#define BIG_ENDIAN_FLOATING_POINT 1
+#endif
+
// Check for supported combinations of host and target architectures.
#if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32)
#error Target architecture ia32 is only supported on ia32 host
--- a/src/mips/assembler-mips.cc
+++ b/src/mips/assembler-mips.cc
@@ -1631,10 +1631,17 @@
void Assembler::ldc1(FPURegister fd, const MemOperand& src) {
// Workaround for non-8-byte alignment of HeapNumber, convert 64-bit
// load to two 32-bit loads.
+#ifndef BIG_ENDIAN_FLOATING_POINT
GenInstrImmediate(LWC1, src.rm(), fd, src.offset_);
FPURegister nextfpreg;
nextfpreg.setcode(fd.code() + 1);
GenInstrImmediate(LWC1, src.rm(), nextfpreg, src.offset_ + 4);
+#else
+ GenInstrImmediate(LWC1, src.rm(), fd, src.offset_ + 4);
+ FPURegister nextfpreg;
+ nextfpreg.setcode(fd.code() + 1);
+ GenInstrImmediate(LWC1, src.rm(), nextfpreg, src.offset_);
+#endif
}
@@ -1646,10 +1653,17 @@
void Assembler::sdc1(FPURegister fd, const MemOperand& src) {
// Workaround for non-8-byte alignment of HeapNumber, convert 64-bit
// store to two 32-bit stores.
+#ifndef BIG_ENDIAN_FLOATING_POINT
GenInstrImmediate(SWC1, src.rm(), fd, src.offset_);
FPURegister nextfpreg;
nextfpreg.setcode(fd.code() + 1);
GenInstrImmediate(SWC1, src.rm(), nextfpreg, src.offset_ + 4);
+#else
+ GenInstrImmediate(SWC1, src.rm(), fd, src.offset_ + 4);
+ FPURegister nextfpreg;
+ nextfpreg.setcode(fd.code() + 1);
+ GenInstrImmediate(SWC1, src.rm(), nextfpreg, src.offset_ );
+#endif
}
--- a/src/mips/assembler-mips.h
+++ b/src/mips/assembler-mips.h
@@ -74,6 +74,13 @@
static const int kNumRegisters = v8::internal::kNumRegisters;
static const int kNumAllocatableRegisters = 14; // v0 through t7.
static const int kSizeInBytes = 4;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ static const int kMantissaOffset = 0;
+ static const int kExponentOffset = 4;
+#else
+ static const int kMantissaOffset = 4;
+ static const int kExponentOffset = 0;
+#endif
static int ToAllocationIndex(Register reg) {
return reg.code() - 2; // zero_reg and 'at' are skipped.
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -869,9 +869,7 @@
ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize);
__ LoadRoot(t7, Heap::kUndefinedValueRootIndex);
if (count_constructions) {
- __ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset));
- __ Ext(a0, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte,
- kBitsPerByte);
+ __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset));
__ sll(t0, a0, kPointerSizeLog2);
__ addu(a0, t5, t0);
// a0: offset of first field after pre-allocated fields
@@ -899,14 +897,12 @@
__ lbu(a3, FieldMemOperand(a2, Map::kUnusedPropertyFieldsOffset));
// The field instance sizes contains both pre-allocated property fields
// and in-object properties.
- __ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset));
- __ Ext(t6, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte,
- kBitsPerByte);
+ __ lbu(t6, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset));
__ Addu(a3, a3, Operand(t6));
- __ Ext(t6, a0, Map::kInObjectPropertiesByte * kBitsPerByte,
- kBitsPerByte);
+ __ lbu(t6, FieldMemOperand(a2, Map::kInObjectPropertiesOffset));
__ subu(a3, a3, t6);
+
// Done if no extra properties are to be allocated.
__ Branch(&allocated, eq, a3, Operand(zero_reg));
__ Assert(greater_equal, "Property allocation count failed.",
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -536,13 +536,8 @@
void ConvertToDoubleStub::Generate(MacroAssembler* masm) {
-#ifndef BIG_ENDIAN_FLOATING_POINT
Register exponent = result1_;
Register mantissa = result2_;
-#else
- Register exponent = result2_;
- Register mantissa = result1_;
-#endif
Label not_special;
// Convert from Smi to integer.
__ sra(source_, source_, kSmiTagSize);
@@ -679,9 +674,8 @@
} else {
ASSERT(destination == kCoreRegisters);
// Load the double from heap number to dst1 and dst2 in double format.
- __ lw(dst1, FieldMemOperand(object, HeapNumber::kValueOffset));
- __ lw(dst2, FieldMemOperand(object,
- HeapNumber::kValueOffset + kPointerSize));
+ __ lw(dst1, FieldMemOperand(object, HeapNumber::kMantissaOffset));
+ __ lw(dst2, FieldMemOperand(object, HeapNumber::kExponentOffset));
}
__ Branch(&done);
@@ -1075,6 +1069,11 @@
// a0-a3 registers to f12/f14 register pairs.
__ Move(f12, a0, a1);
__ Move(f14, a2, a3);
+ } else {
+#ifdef BIG_ENDIAN_FLOATING_POINT
+ __ Swap(a0, a1);
+ __ Swap(a2, a3);
+#endif
}
{
AllowExternalCallThatCantCauseGC scope(masm);
@@ -1088,8 +1087,13 @@
__ sdc1(f0, FieldMemOperand(heap_number_result, HeapNumber::kValueOffset));
} else {
// Double returned in registers v0 and v1.
+#ifndef BIG_ENDIAN_FLOATING_POINT
__ sw(v1, FieldMemOperand(heap_number_result, HeapNumber::kExponentOffset));
__ sw(v0, FieldMemOperand(heap_number_result, HeapNumber::kMantissaOffset));
+#else
+ __ sw(v0, FieldMemOperand(heap_number_result, HeapNumber::kExponentOffset));
+ __ sw(v1, FieldMemOperand(heap_number_result, HeapNumber::kMantissaOffset));
+#endif
}
// Place heap_number_result in v0 and return to the pushed return address.
__ pop(ra);
@@ -1320,8 +1324,8 @@
__ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset));
} else {
// Load lhs to a double in a2, a3.
- __ lw(a3, FieldMemOperand(lhs, HeapNumber::kValueOffset + 4));
- __ lw(a2, FieldMemOperand(lhs, HeapNumber::kValueOffset));
+ __ lw(a3, FieldMemOperand(lhs, HeapNumber::kExponentOffset));
+ __ lw(a2, FieldMemOperand(lhs, HeapNumber::kMantissaOffset));
// Write Smi from rhs to a1 and a0 in double format. t5 is scratch.
__ mov(t6, rhs);
@@ -1366,11 +1370,11 @@
__ pop(ra);
// Load rhs to a double in a1, a0.
if (rhs.is(a0)) {
- __ lw(a1, FieldMemOperand(rhs, HeapNumber::kValueOffset + 4));
- __ lw(a0, FieldMemOperand(rhs, HeapNumber::kValueOffset));
+ __ lw(a1, FieldMemOperand(rhs, HeapNumber::kExponentOffset));
+ __ lw(a0, FieldMemOperand(rhs, HeapNumber::kMantissaOffset));
} else {
- __ lw(a0, FieldMemOperand(rhs, HeapNumber::kValueOffset));
- __ lw(a1, FieldMemOperand(rhs, HeapNumber::kValueOffset + 4));
+ __ lw(a0, FieldMemOperand(rhs, HeapNumber::kMantissaOffset));
+ __ lw(a1, FieldMemOperand(rhs, HeapNumber::kExponentOffset));
}
}
// Fall through to both_loaded_as_doubles.
@@ -1378,7 +1382,6 @@
void EmitNanCheck(MacroAssembler* masm, Condition cc) {
- bool exp_first = (HeapNumber::kExponentOffset == HeapNumber::kValueOffset);
if (CpuFeatures::IsSupported(FPU)) {
CpuFeatures::Scope scope(FPU);
// Lhs and rhs are already loaded to f12 and f14 register pairs.
@@ -1391,10 +1394,10 @@
__ mov(t2, a2); // a2 has LS 32 bits of lhs.
__ mov(t3, a3); // a3 has MS 32 bits of lhs.
}
- Register rhs_exponent = exp_first ? t0 : t1;
- Register lhs_exponent = exp_first ? t2 : t3;
- Register rhs_mantissa = exp_first ? t1 : t0;
- Register lhs_mantissa = exp_first ? t3 : t2;
+ Register rhs_exponent = t1;
+ Register lhs_exponent = t3;
+ Register rhs_mantissa = t0;
+ Register lhs_mantissa = t2;
Label one_is_nan, neither_is_nan;
Label lhs_not_nan_exp_mask_is_loaded;
@@ -1445,7 +1448,6 @@
if (cc == eq) {
// Doubles are not equal unless they have the same bit pattern.
// Exception: 0 and -0.
- bool exp_first = (HeapNumber::kExponentOffset == HeapNumber::kValueOffset);
if (CpuFeatures::IsSupported(FPU)) {
CpuFeatures::Scope scope(FPU);
// Lhs and rhs are already loaded to f12 and f14 register pairs.
@@ -1458,10 +1460,10 @@
__ mov(t2, a2); // a2 has LS 32 bits of lhs.
__ mov(t3, a3); // a3 has MS 32 bits of lhs.
}
- Register rhs_exponent = exp_first ? t0 : t1;
- Register lhs_exponent = exp_first ? t2 : t3;
- Register rhs_mantissa = exp_first ? t1 : t0;
- Register lhs_mantissa = exp_first ? t3 : t2;
+ Register rhs_exponent = t1;
+ Register lhs_exponent = t3;
+ Register rhs_mantissa = t0;
+ Register lhs_mantissa = t2;
__ xor_(v0, rhs_mantissa, lhs_mantissa);
__ Branch(&return_result_not_equal, ne, v0, Operand(zero_reg));
@@ -1495,6 +1497,11 @@
// a0-a3 registers to f12/f14 register pairs.
__ Move(f12, a0, a1);
__ Move(f14, a2, a3);
+ } else {
+#ifdef BIG_ENDIAN_FLOATING_POINT
+ __ Swap(a0, a1);
+ __ Swap(a2, a3);
+#endif
}
AllowExternalCallThatCantCauseGC scope(masm);
@@ -1582,14 +1589,14 @@
__ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset));
__ ldc1(f14, FieldMemOperand(rhs, HeapNumber::kValueOffset));
} else {
- __ lw(a2, FieldMemOperand(lhs, HeapNumber::kValueOffset));
- __ lw(a3, FieldMemOperand(lhs, HeapNumber::kValueOffset + 4));
+ __ lw(a2, FieldMemOperand(lhs, HeapNumber::kMantissaOffset));
+ __ lw(a3, FieldMemOperand(lhs, HeapNumber::kExponentOffset));
if (rhs.is(a0)) {
- __ lw(a1, FieldMemOperand(rhs, HeapNumber::kValueOffset + 4));
- __ lw(a0, FieldMemOperand(rhs, HeapNumber::kValueOffset));
+ __ lw(a1, FieldMemOperand(rhs, HeapNumber::kExponentOffset));
+ __ lw(a0, FieldMemOperand(rhs, HeapNumber::kMantissaOffset));
} else {
- __ lw(a0, FieldMemOperand(rhs, HeapNumber::kValueOffset));
- __ lw(a1, FieldMemOperand(rhs, HeapNumber::kValueOffset + 4));
+ __ lw(a0, FieldMemOperand(rhs, HeapNumber::kMantissaOffset));
+ __ lw(a1, FieldMemOperand(rhs, HeapNumber::kExponentOffset));
}
}
__ jmp(both_loaded_as_doubles);
@@ -5902,14 +5909,18 @@
__ Branch(&simple_loop, eq, scratch4, Operand(zero_reg));
// Loop for src/dst that are not aligned the same way.
- // This loop uses lwl and lwr instructions. These instructions
- // depend on the endianness, and the implementation assumes little-endian.
{
Label loop;
__ bind(&loop);
+#if __BYTE_ORDER == __BIG_ENDIAN
+ __ lwl(scratch1, MemOperand(src));
+ __ Addu(src, src, Operand(kReadAlignment));
+ __ lwr(scratch1, MemOperand(src, -1));
+#else
__ lwr(scratch1, MemOperand(src));
__ Addu(src, src, Operand(kReadAlignment));
__ lwl(scratch1, MemOperand(src, -1));
+#endif
__ sw(scratch1, MemOperand(dest));
__ Addu(dest, dest, Operand(kReadAlignment));
__ Subu(scratch2, limit, dest);
@@ -6616,6 +6627,11 @@
// in a little endian mode).
__ li(t2, Operand(2));
__ AllocateAsciiString(v0, t2, t0, t1, t5, &call_runtime);
+#if __BYTE_ORDER == __BIG_ENDIAN
+ __ sll(t0, a2, 8);
+ __ srl(t1, a2, 8);
+ __ or_(a2, t0, t1);
+#endif
__ sh(a2, FieldMemOperand(v0, SeqAsciiString::kHeaderSize));
__ IncrementCounter(counters->string_add_native(), 1, a2, a3);
__ DropAndRet(2);
--- a/src/mips/codegen-mips.cc
+++ b/src/mips/codegen-mips.cc
@@ -210,8 +210,8 @@
a1,
t7,
f0);
- __ sw(a0, MemOperand(t3)); // mantissa
- __ sw(a1, MemOperand(t3, kIntSize)); // exponent
+ __ sw(a0, MemOperand(t3, Register::kMantissaOffset)); // mantissa
+ __ sw(a1, MemOperand(t3, Register::kExponentOffset)); // exponent
__ Addu(t3, t3, kDoubleSize);
}
__ Branch(&entry);
@@ -225,8 +225,8 @@
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Assert(eq, "object found in smi-only array", at, Operand(t5));
}
- __ sw(t0, MemOperand(t3)); // mantissa
- __ sw(t1, MemOperand(t3, kIntSize)); // exponent
+ __ sw(t0, MemOperand(t3, Register::kMantissaOffset)); // mantissa
+ __ sw(t1, MemOperand(t3, Register::kExponentOffset)); // exponent
__ Addu(t3, t3, kDoubleSize);
__ bind(&entry);
@@ -273,7 +273,7 @@
__ sw(t5, MemOperand(t2, HeapObject::kMapOffset));
// Prepare for conversion loop.
- __ Addu(t0, t0, Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag + 4));
+ __ Addu(t0, t0, Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag + Register::kExponentOffset));
__ Addu(a3, t2, Operand(FixedArray::kHeaderSize));
__ Addu(t2, t2, Operand(kHeapObjectTag));
__ sll(t1, t1, 1);
@@ -282,7 +282,7 @@
__ LoadRoot(t5, Heap::kHeapNumberMapRootIndex);
// Using offsetted addresses.
// a3: begin of destination FixedArray element fields, not tagged
- // t0: begin of source FixedDoubleArray element fields, not tagged, +4
+ // t0: begin of source FixedDoubleArray element fields, not tagged, points to the exponent
// t1: end of destination FixedArray, not tagged
// t2: destination FixedArray
// t3: the-hole pointer
@@ -296,7 +296,7 @@
__ Branch(fail);
__ bind(&loop);
- __ lw(a1, MemOperand(t0));
+ __ lw(a1, MemOperand(t0, 0)); // exponent
__ Addu(t0, t0, kDoubleSize);
// a1: current element's upper 32 bit
// t0: address of next element's upper 32 bit
@@ -305,7 +305,8 @@
// Non-hole double, copy value into a heap number.
__ AllocateHeapNumber(a2, a0, t6, t5, &gc_required);
// a2: new heap number
- __ lw(a0, MemOperand(t0, -12));
+ // Load mantissa of current element, t0 point to exponent of next element.
+ __ lw(a0, MemOperand(t0, (Register::kMantissaOffset - Register::kExponentOffset - kDoubleSize)));
__ sw(a0, FieldMemOperand(a2, HeapNumber::kMantissaOffset));
__ sw(a1, FieldMemOperand(a2, HeapNumber::kExponentOffset));
__ mov(a0, a3);
--- a/src/mips/constants-mips.h
+++ b/src/mips/constants-mips.h
@@ -69,6 +69,15 @@
#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+const uint32_t kHoleNanUpper32Offset = 4;
+const uint32_t kHoleNanLower32Offset = 0;
+#else
+const uint32_t kHoleNanUpper32Offset = 0;
+const uint32_t kHoleNanLower32Offset = 4;
+#endif
+
+
// Defines constants and accessor classes to assemble, disassemble and
// simulate MIPS32 instructions.
//
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -2699,7 +2699,7 @@
}
if (instr->hydrogen()->RequiresHoleCheck()) {
- __ lw(scratch, MemOperand(elements, sizeof(kHoleNanLower32)));
+ __ lw(scratch, MemOperand(elements, kHoleNanUpper32Offset));
DeoptimizeIf(eq, instr->environment(), scratch, Operand(kHoleNanUpper32));
}
@@ -4869,15 +4869,14 @@
Handle<FixedDoubleArray>::cast(elements);
for (int i = 0; i < elements_length; i++) {
int64_t value = double_array->get_representation(i);
- // We only support little endian mode...
int32_t value_low = static_cast<int32_t>(value & 0xFFFFFFFF);
int32_t value_high = static_cast<int32_t>(value >> 32);
int total_offset =
elements_offset + FixedDoubleArray::OffsetOfElementAt(i);
__ li(a2, Operand(value_low));
- __ sw(a2, FieldMemOperand(result, total_offset));
+ __ sw(a2, FieldMemOperand(result, total_offset + Register::kMantissaOffset));
__ li(a2, Operand(value_high));
- __ sw(a2, FieldMemOperand(result, total_offset + 4));
+ __ sw(a2, FieldMemOperand(result, total_offset + Register::kExponentOffset));
}
} else if (elements->IsFixedArray()) {
Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements);
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -3300,6 +3300,7 @@
// TODO(kalmard) check if this can be optimized to use sw in most cases.
// Can't use unaligned access - copy byte by byte.
+#if __BYTE_ORDER == __LITTLE_ENDIAN
sb(scratch, MemOperand(dst, 0));
srl(scratch, scratch, 8);
sb(scratch, MemOperand(dst, 1));
@@ -3307,6 +3308,16 @@
sb(scratch, MemOperand(dst, 2));
srl(scratch, scratch, 8);
sb(scratch, MemOperand(dst, 3));
+#else
+ sb(scratch, MemOperand(dst, 3));
+ srl(scratch, scratch, 8);
+ sb(scratch, MemOperand(dst, 2));
+ srl(scratch, scratch, 8);
+ sb(scratch, MemOperand(dst, 1));
+ srl(scratch, scratch, 8);
+ sb(scratch, MemOperand(dst, 0));
+#endif
+
Addu(dst, dst, 4);
Subu(length, length, Operand(kPointerSize));
@@ -3412,9 +3423,8 @@
bind(&have_double_value);
sll(scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize);
Addu(scratch1, scratch1, elements_reg);
- sw(mantissa_reg, FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize));
- uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
- sw(exponent_reg, FieldMemOperand(scratch1, offset));
+ sw(mantissa_reg, FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize + kHoleNanLower32Offset));
+ sw(exponent_reg, FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize + kHoleNanUpper32Offset));
jmp(&done);
bind(&maybe_nan);
@@ -3459,8 +3469,8 @@
CpuFeatures::Scope scope(FPU);
sdc1(f0, MemOperand(scratch1, 0));
} else {
- sw(mantissa_reg, MemOperand(scratch1, 0));
- sw(exponent_reg, MemOperand(scratch1, Register::kSizeInBytes));
+ sw(mantissa_reg, MemOperand(scratch1, Register::kMantissaOffset));
+ sw(exponent_reg, MemOperand(scratch1, Register::kExponentOffset));
}
bind(&done);
}
--- a/src/mips/stub-cache-mips.cc
+++ b/src/mips/stub-cache-mips.cc
@@ -2195,7 +2195,7 @@
// Start checking for special cases.
// Get the argument exponent and clear the sign bit.
- __ lw(t1, FieldMemOperand(v0, HeapNumber::kValueOffset + kPointerSize));
+ __ lw(t1, FieldMemOperand(v0, HeapNumber::kExponentOffset));
__ And(t2, t1, Operand(~HeapNumber::kSignMask));
__ srl(t2, t2, HeapNumber::kMantissaBitsInTopWord);
@@ -3768,8 +3768,8 @@
__ ldc1(f0, MemOperand(t3, 0));
} else {
// t3: pointer to the beginning of the double we want to load.
- __ lw(a2, MemOperand(t3, 0));
- __ lw(a3, MemOperand(t3, Register::kSizeInBytes));
+ __ lw(a2, MemOperand(t3, Register::kMantissaOffset));
+ __ lw(a3, MemOperand(t3, Register::kExponentOffset));
}
break;
case FAST_ELEMENTS:
@@ -4132,8 +4132,8 @@
CpuFeatures::Scope scope(FPU);
__ sdc1(f0, MemOperand(a3, 0));
} else {
- __ sw(t2, MemOperand(a3, 0));
- __ sw(t3, MemOperand(a3, Register::kSizeInBytes));
+ __ sw(t2, MemOperand(a3, Register::kMantissaOffset));
+ __ sw(t3, MemOperand(a3, Register::kExponentOffset));
}
break;
case FAST_ELEMENTS:
@@ -4296,8 +4296,8 @@
__ sll(t8, key, 2);
__ addu(t8, a3, t8);
// t8: effective address of destination element.
- __ sw(t4, MemOperand(t8, 0));
- __ sw(t3, MemOperand(t8, Register::kSizeInBytes));
+ __ sw(t4, MemOperand(t8, Register::kMantissaOffset));
+ __ sw(t3, MemOperand(t8, Register::kExponentOffset));
__ mov(v0, a0);
__ Ret();
} else {
@@ -4497,11 +4497,11 @@
__ lw(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset));
__ Branch(&miss_force_generic, hs, key_reg, Operand(scratch));
- // Load the upper word of the double in the fixed array and test for NaN.
+ // Load the exponent in the fixed array and test for NaN.
__ sll(scratch2, key_reg, kDoubleSizeLog2 - kSmiTagSize);
__ Addu(indexed_double_offset, elements_reg, Operand(scratch2));
- uint32_t upper_32_offset = FixedArray::kHeaderSize + sizeof(kHoleNanLower32);
- __ lw(scratch, FieldMemOperand(indexed_double_offset, upper_32_offset));
+ __ lw(scratch, FieldMemOperand(indexed_double_offset,
+ FixedArray::kHeaderSize + kHoleNanUpper32Offset));
__ Branch(&miss_force_generic, eq, scratch, Operand(kHoleNanUpper32));
// Non-NaN. Allocate a new heap number and copy the double value into it.
@@ -4509,12 +4509,12 @@
__ AllocateHeapNumber(heap_number_reg, scratch2, scratch3,
heap_number_map, &slow_allocate_heapnumber);
- // Don't need to reload the upper 32 bits of the double, it's already in
+ // Don't need to reload the exponent (the upper 32 bits of the double), it's already in
// scratch.
__ sw(scratch, FieldMemOperand(heap_number_reg,
HeapNumber::kExponentOffset));
__ lw(scratch, FieldMemOperand(indexed_double_offset,
- FixedArray::kHeaderSize));
+ FixedArray::kHeaderSize + kHoleNanLower32Offset));
__ sw(scratch, FieldMemOperand(heap_number_reg,
HeapNumber::kMantissaOffset));
--- a/src/objects.h
+++ b/src/objects.h
@@ -1344,8 +1344,13 @@
// is a mixture of sign, exponent and mantissa. Our current platforms are all
// little endian apart from non-EABI arm which is little endian with big
// endian floating point word ordering!
+#ifndef BIG_ENDIAN_FLOATING_POINT
static const int kMantissaOffset = kValueOffset;
static const int kExponentOffset = kValueOffset + 4;
+#else
+ static const int kMantissaOffset = kValueOffset + 4;
+ static const int kExponentOffset = kValueOffset;
+#endif
static const int kSize = kValueOffset + kDoubleSize;
static const uint32_t kSignMask = 0x80000000u;
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -1819,7 +1819,9 @@
Address field = obj->address() + offset;
ASSERT(!Memory::Object_at(field)->IsFailure());
ASSERT(Memory::Object_at(field)->IsHeapObject());
- *field |= kFailureTag;
+ Object* untagged = *reinterpret_cast<Object**>(field);
+ intptr_t tagged = reinterpret_cast<intptr_t>(untagged) | kFailureTag;
+ *reinterpret_cast<Object**>(field) = reinterpret_cast<Object*>(tagged);
}
private:
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8553,8 +8553,15 @@
#else
typedef uint64_t ObjectPair;
static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
return reinterpret_cast<uint32_t>(x) |
(reinterpret_cast<ObjectPair>(y) << 32);
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ return reinterpret_cast<uint32_t>(y) |
+ (reinterpret_cast<ObjectPair>(x) << 32);
+#else
+#error Unknown endianess
+#endif
}
#endif
--- a/test/cctest/cctest.gyp
+++ b/test/cctest/cctest.gyp
@@ -118,7 +118,7 @@
'test-disasm-arm.cc'
],
}],
- ['v8_target_arch=="mipsel"', {
+ ['v8_target_arch=="mipsel" or v8_target_arch=="mips"', {
'sources': [
'test-assembler-mips.cc',
'test-disasm-mips.cc',
--- a/test/cctest/test-assembler-mips.cc
+++ b/test/cctest/test-assembler-mips.cc
@@ -537,11 +537,21 @@
USE(dummy);
CHECK_EQ(0x11223344, t.r1);
+#if __BYTE_ORDER == __LITTLE_ENDIAN
CHECK_EQ(0x3344, t.r2);
CHECK_EQ(0xffffbbcc, t.r3);
CHECK_EQ(0x0000bbcc, t.r4);
CHECK_EQ(0xffffffcc, t.r5);
CHECK_EQ(0x3333bbcc, t.r6);
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ CHECK_EQ(0x1122, t.r2);
+ CHECK_EQ(0xffff99aa, t.r3);
+ CHECK_EQ(0x000099aa, t.r4);
+ CHECK_EQ(0xffffff99, t.r5);
+ CHECK_EQ(0x99aa3333, t.r6);
+#else
+#error Unknown endianess
+#endif
}
@@ -955,6 +965,7 @@
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
+#if __BYTE_ORDER == __LITTLE_ENDIAN
CHECK_EQ(0x44bbccdd, t.lwl_0);
CHECK_EQ(0x3344ccdd, t.lwl_1);
CHECK_EQ(0x223344dd, t.lwl_2);
@@ -974,6 +985,29 @@
CHECK_EQ(0xbbccdd44, t.swr_1);
CHECK_EQ(0xccdd3344, t.swr_2);
CHECK_EQ(0xdd223344, t.swr_3);
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ CHECK_EQ(0x11223344, t.lwl_0);
+ CHECK_EQ(0x223344dd, t.lwl_1);
+ CHECK_EQ(0x3344ccdd, t.lwl_2);
+ CHECK_EQ(0x44bbccdd, t.lwl_3);
+
+ CHECK_EQ(0xaabbcc11, t.lwr_0);
+ CHECK_EQ(0xaabb1122, t.lwr_1);
+ CHECK_EQ(0xaa112233, t.lwr_2);
+ CHECK_EQ(0x11223344, t.lwr_3);
+
+ CHECK_EQ(0xaabbccdd, t.swl_0);
+ CHECK_EQ(0x11aabbcc, t.swl_1);
+ CHECK_EQ(0x1122aabb, t.swl_2);
+ CHECK_EQ(0x112233aa, t.swl_3);
+
+ CHECK_EQ(0xdd223344, t.swr_0);
+ CHECK_EQ(0xccdd3344, t.swr_1);
+ CHECK_EQ(0xbbccdd44, t.swr_2);
+ CHECK_EQ(0xaabbccdd, t.swr_3);
+#else
+#error Unknown endianess
+#endif
}
--- a/test/mjsunit/mjsunit.status
+++ b/test/mjsunit/mjsunit.status
@@ -49,7 +49,7 @@
##############################################################################
# These use a built-in that's only present in debug mode. They take
# too long to run in debug mode on ARM and MIPS.
-fuzz-natives-part*: PASS, SKIP if ($mode == release || $arch == arm || $arch == android_arm || $arch == mipsel)
+fuzz-natives-part*: PASS, SKIP if ($mode == release || $arch == arm || $arch == android_arm || $arch == mipsel || $arch == mips)
big-object-literal: PASS, SKIP if ($arch == arm || $arch == android_arm)
@@ -57,7 +57,7 @@
array-constructor: PASS || TIMEOUT
# Very slow on ARM and MIPS, contains no architecture dependent code.
-unicode-case-overoptimization: PASS, TIMEOUT if ($arch == arm || $arch == android_arm || $arch == mipsel)
+unicode-case-overoptimization: PASS, TIMEOUT if ($arch == arm || $arch == android_arm || $arch == mipsel || $arch == mips)
##############################################################################
# This test sets the umask on a per-process basis and hence cannot be
@@ -127,7 +127,7 @@
math-floor-of-div-minus-zero: SKIP
##############################################################################
-[ $arch == mipsel ]
+[ $arch == mipsel || $arch == mips ]
# Slow tests which times out in debug mode.
try: PASS, SKIP if $mode == debug
--- a/test/mozilla/mozilla.status
+++ b/test/mozilla/mozilla.status
@@ -126,13 +126,13 @@
ecma/Date/15.9.2.2-6: PASS || FAIL
# 1026139: These date tests fail on arm and mips
-ecma/Date/15.9.5.29-1: PASS || FAIL if ($arch == arm || $arch == mipsel)
-ecma/Date/15.9.5.34-1: PASS || FAIL if ($arch == arm || $arch == mipsel)
-ecma/Date/15.9.5.28-1: PASS || FAIL if ($arch == arm || $arch == mipsel)
+ecma/Date/15.9.5.29-1: PASS || FAIL if ($arch == arm || $arch == mipsel || $arch == mips)
+ecma/Date/15.9.5.34-1: PASS || FAIL if ($arch == arm || $arch == mipsel || $arch == mips)
+ecma/Date/15.9.5.28-1: PASS || FAIL if ($arch == arm || $arch == mipsel || $arch == mips)
# 1050186: Arm/MIPS vm is broken; probably unrelated to dates
-ecma/Array/15.4.4.5-3: PASS || FAIL if ($arch == arm || $arch == mipsel)
-ecma/Date/15.9.5.22-2: PASS || FAIL if ($arch == arm || $arch == mipsel)
+ecma/Array/15.4.4.5-3: PASS || FAIL if ($arch == arm || $arch == mipsel || $arch == mips)
+ecma/Date/15.9.5.22-2: PASS || FAIL if ($arch == arm || $arch == mipsel || $arch == mips)
# Flaky test that fails due to what appears to be a bug in the test.
# Occurs depending on current time
@@ -854,6 +854,28 @@
# Times out and print so much output that we need to skip it to not
# hang the builder.
+js1_5/extensions/regress-342960: SKIP
+
+# BUG(3251229): Times out when running new crankshaft test script.
+ecma_3/RegExp/regress-311414: SKIP
+ecma/Date/15.9.5.8: SKIP
+ecma/Date/15.9.5.10-2: SKIP
+ecma/Date/15.9.5.11-2: SKIP
+ecma/Date/15.9.5.12-2: SKIP
+js1_5/Array/regress-99120-02: SKIP
+js1_5/extensions/regress-371636: SKIP
+js1_5/Regress/regress-203278-1: SKIP
+js1_5/Regress/regress-404755: SKIP
+js1_5/Regress/regress-451322: SKIP
+
+
+# BUG(1040): Allow this test to timeout.
+js1_5/GC/regress-203278-2: PASS || TIMEOUT
+
+[ $arch == mips ]
+
+# Times out and print so much output that we need to skip it to not
+# hang the builder.
js1_5/extensions/regress-342960: SKIP
# BUG(3251229): Times out when running new crankshaft test script.
--- a/test/sputnik/sputnik.status
+++ b/test/sputnik/sputnik.status
@@ -229,3 +229,17 @@
S15.1.3.4_A2.3_T1: SKIP
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
+
+[ $arch == mips ]
+
+# BUG(3251225): Tests that timeout with --nocrankshaft.
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
+S15.1.3.1_A2.4_T1: SKIP
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.4_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
+S15.1.3.3_A2.3_T1: SKIP
+S15.1.3.4_A2.3_T1: SKIP
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
--- a/test/test262/test262.status
+++ b/test/test262/test262.status
@@ -74,7 +74,7 @@
S15.1.3.1_A2.5_T1: PASS, SKIP if $mode == debug
S15.1.3.2_A2.5_T1: PASS, SKIP if $mode == debug
-[ $arch == arm || $arch == mipsel ]
+[ $arch == arm || $arch == mipsel || $arch == mips ]
# TODO(mstarzinger): Causes stack overflow on simulators due to eager
# compilation of parenthesized function literals. Needs investigation.
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -564,7 +564,7 @@
'../../src/ia32/stub-cache-ia32.cc',
],
}],
- ['v8_target_arch=="mipsel"', {
+ ['v8_target_arch=="mipsel" or v8_target_arch=="mips"', {
'sources': [
'../../src/mips/assembler-mips.cc',
'../../src/mips/assembler-mips.h',
--- a/tools/run-tests.py
+++ b/tools/run-tests.py
@@ -65,6 +65,7 @@
"arm",
"ia32",
"mipsel",
+ "mips",
"x64"]
@@ -268,7 +269,7 @@
timeout = options.timeout
if timeout == -1:
# Simulators are slow, therefore allow a longer default timeout.
- if arch in ["android", "arm", "mipsel"]:
+ if arch in ["android", "arm", "mipsel", "mips"]:
timeout = 2 * TIMEOUT_DEFAULT;
else:
timeout = TIMEOUT_DEFAULT;
--- a/tools/test-wrapper-gypbuild.py
+++ b/tools/test-wrapper-gypbuild.py
@@ -151,7 +151,7 @@
print "Unknown mode %s" % mode
return False
for arch in options.arch:
- if not arch in ['ia32', 'x64', 'arm', 'mipsel', 'android_arm',
+ if not arch in ['ia32', 'x64', 'arm', 'mipsel', 'mips', 'android_arm',
'android_ia32']:
print "Unknown architecture %s" % arch
return False
--- a/tools/test.py
+++ b/tools/test.py
@@ -1282,7 +1282,7 @@
options.scons_flags.append("arch=" + options.arch)
# Simulators are slow, therefore allow a longer default timeout.
if options.timeout == -1:
- if options.arch in ['android', 'arm', 'mipsel']:
+ if options.arch in ['android', 'arm', 'mipsel', 'mips']:
options.timeout = 2 * TIMEOUT_DEFAULT;
else:
options.timeout = TIMEOUT_DEFAULT;
--- a/tools/testrunner/local/statusfile.py
+++ b/tools/testrunner/local/statusfile.py
@@ -59,7 +59,7 @@
# Support arches, modes to be written as keywords instead of strings.
VARIABLES = {ALWAYS: True}
for var in ["debug", "release", "android_arm", "android_ia32", "arm", "ia32",
- "mipsel", "x64"]:
+ "mipsel", "mips", "x64"]:
VARIABLES[var] = var

View file

@ -0,0 +1,17 @@
Description: upstream fix needed by mips arch
Origin: https://code.google.com/p/v8/source/detail?r=15102
--- a/test/cctest/test-mark-compact.cc
+++ b/test/cctest/test-mark-compact.cc
@@ -545,9 +545,9 @@
}
} else {
if (v8::internal::Snapshot::IsEnabled()) {
- CHECK_LE(delta, 2500 * 1024); // 2400.
+ CHECK_LE(delta, 2942 * 1024); // 2400.
} else {
- CHECK_LE(delta, 2860 * 1024); // 2760.
+ CHECK_LE(delta, 3400 * 1024); // 2760.
}
}
}

View file

@ -0,0 +1,71 @@
Description: upstream fix needed by mips arch
Origin: https://code.google.com/p/v8/source/detail?r=19121
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -7808,9 +7808,16 @@
const int32_t kReturnAddressDistanceFromFunctionStart =
Assembler::kCallTargetAddressOffset + (2 * Assembler::kInstrSize);
- // Save live volatile registers.
- __ Push(ra, t1, a1);
- const int32_t kNumSavedRegs = 3;
+ // This should contain all kJSCallerSaved registers.
+ const RegList kSavedRegs =
+ kJSCallerSaved | // Caller saved registers.
+ s5.bit(); // Saved stack pointer.
+
+ // We also save ra, so the count here is one higher than the mask indicates.
+ const int32_t kNumSavedRegs = kNumJSCallerSaved + 2;
+
+ // Save all caller-save registers as this may be called from anywhere.
+ __ MultiPush(kSavedRegs | ra.bit());
// Compute the function's address for the first argument.
__ Subu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart));
@@ -7822,32 +7829,36 @@
// Align the stack if necessary.
int frame_alignment = masm->ActivationFrameAlignment();
if (frame_alignment > kPointerSize) {
- __ mov(t1, sp);
ASSERT(IsPowerOf2(frame_alignment));
+ __ mov(s5, sp);
__ And(sp, sp, Operand(-frame_alignment));
}
-
+ // Allocate space for arg slots.
+ __ Subu(sp, sp, kCArgsSlotsSize);
#if defined(V8_HOST_ARCH_MIPS)
- __ li(at, Operand(reinterpret_cast<int32_t>(&entry_hook_)));
- __ lw(at, MemOperand(at));
+ __ li(t9, Operand(reinterpret_cast<int32_t>(&entry_hook_)));
+ __ lw(t9, MemOperand(t9));
#else
// Under the simulator we need to indirect the entry hook through a
// trampoline function at a known address.
Address trampoline_address = reinterpret_cast<Address>(
reinterpret_cast<intptr_t>(EntryHookTrampoline));
ApiFunction dispatcher(trampoline_address);
- __ li(at, Operand(ExternalReference(&dispatcher,
+ __ li(t9, Operand(ExternalReference(&dispatcher,
ExternalReference::BUILTIN_CALL,
masm->isolate())));
#endif
- __ Call(at);
-
+ // Call C function through t9 to conform ABI for PIC.
+ __ Call(t9);
// Restore the stack pointer if needed.
if (frame_alignment > kPointerSize) {
- __ mov(sp, t1);
+ __ mov(sp, s5);
+ } else {
+ __ Addu(sp, sp, kCArgsSlotsSize);
}
- __ Pop(ra, t1, a1);
+ // Also pop ra to get Ret(0).
+ __ MultiPop(kSavedRegs | ra.bit());
__ Ret();
}

View file

@ -0,0 +1,22 @@
Description: Forced whole instruction cache flushing on Loongson.
Workaround for instruction cache flushing malfunction on Loongson systems
that occasionally cause failures under stress test conditions.
Author: Dusan Milosavljevic <dusan.milosavljevic@rt-rk.com>
Origin:upstream,https://github.com/paul99/v8m-rb/commit/ded6c2c2.patch
Last-Update: 2012-06-13
--- a/src/mips/cpu-mips.cc
+++ b/src/mips/cpu-mips.cc
@@ -72,6 +72,13 @@
#else // ANDROID
int res;
// See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
+ if (kArchVariant==kLoongson) {
+ // Force flushing of whole instruction cache on Loongson. This is a
+ // workaround for problem when under stress tests cache lines are not
+ // flushed through syscall for some reasons.
+ size_t iCacheSize = 64 * KB;
+ size = iCacheSize + 1;
+ }
res = syscall(__NR_cacheflush, start, size, ICACHE);
if (res) {
V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache");

View file

@ -1 +0,0 @@
old, broken, effectively useless

1
sources Normal file
View file

@ -0,0 +1 @@
d4e3a038ad387fd7b75d40a89e231ef7 v8-3.14.5.10.tar.bz2

View file

@ -0,0 +1,55 @@
From 18e43f925d5d502b7531f40e4a1becba56089303 Mon Sep 17 00:00:00 2001
From: "mstarzinger@chromium.org" <mstarzinger@chromium.org>
Date: Mon, 15 Jul 2013 11:41:41 +0000
Subject: [PATCH] Use internal array as API function cache.
R=yangguo@chromium.org
BUG=chromium:260106
TEST=cctest/test-api/Regress260106
Review URL: https://codereview.chromium.org/19159003
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@15665 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
---
src/apinatives.js | 2 +-
test/cctest/test-api.cc | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/apinatives.js b/src/apinatives.js
index 79b41dd..adefab6 100644
--- a/src/apinatives.js
+++ b/src/apinatives.js
@@ -37,7 +37,7 @@ function CreateDate(time) {
}
-var kApiFunctionCache = {};
+var kApiFunctionCache = new InternalArray();
var functionCache = kApiFunctionCache;
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 728a8f7..bcd28bd 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -17707,6 +17707,17 @@ THREADED_TEST(Regress157124) {
}
+THREADED_TEST(Regress260106) {
+ LocalContext context;
+ v8::HandleScope scope(context->GetIsolate());
+ Local<FunctionTemplate> templ = FunctionTemplate::New(DummyCallHandler);
+ CompileRun("for (var i = 0; i < 128; i++) Object.prototype[i] = 0;");
+ Local<Function> function = templ->GetFunction();
+ CHECK(!function.IsEmpty());
+ CHECK(function->IsFunction());
+}
+
+
#ifndef WIN32
class ThreadInterruptTest {
public:
--
1.8.3.1

View file

@ -0,0 +1,316 @@
From 520f94a1da96b0f1fd3d0e0c0b82e4d7c1e7d58f Mon Sep 17 00:00:00 2001
From: "T.C. Hollingsworth" <tchollingsworth@gmail.com>
Date: Fri, 13 Dec 2013 00:45:27 -0700
Subject: [PATCH] Limit size of dehoistable array indices
backported from upstream r17801
---
src/elements-kind.cc | 30 ++++++++++++++++
src/elements-kind.h | 2 ++
src/hydrogen-instructions.h | 9 +++++
src/hydrogen.cc | 2 +-
src/lithium.cc | 30 ----------------
src/lithium.h | 3 --
test/mjsunit/regress/regress-crbug-319835.js | 51 ++++++++++++++++++++++++++++
test/mjsunit/regress/regress-crbug-319860.js | 47 +++++++++++++++++++++++++
8 files changed, 140 insertions(+), 34 deletions(-)
create mode 100644 test/mjsunit/regress/regress-crbug-319835.js
create mode 100644 test/mjsunit/regress/regress-crbug-319860.js
diff --git a/src/elements-kind.cc b/src/elements-kind.cc
index 655a23b..c93a602 100644
--- a/src/elements-kind.cc
+++ b/src/elements-kind.cc
@@ -35,6 +35,36 @@ namespace v8 {
namespace internal {
+int ElementsKindToShiftSize(ElementsKind elements_kind) {
+ switch (elements_kind) {
+ case EXTERNAL_BYTE_ELEMENTS:
+ case EXTERNAL_PIXEL_ELEMENTS:
+ case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
+ return 0;
+ case EXTERNAL_SHORT_ELEMENTS:
+ case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
+ return 1;
+ case EXTERNAL_INT_ELEMENTS:
+ case EXTERNAL_UNSIGNED_INT_ELEMENTS:
+ case EXTERNAL_FLOAT_ELEMENTS:
+ return 2;
+ case EXTERNAL_DOUBLE_ELEMENTS:
+ case FAST_DOUBLE_ELEMENTS:
+ case FAST_HOLEY_DOUBLE_ELEMENTS:
+ return 3;
+ case FAST_SMI_ELEMENTS:
+ case FAST_ELEMENTS:
+ case FAST_HOLEY_SMI_ELEMENTS:
+ case FAST_HOLEY_ELEMENTS:
+ case DICTIONARY_ELEMENTS:
+ case NON_STRICT_ARGUMENTS_ELEMENTS:
+ return kPointerSizeLog2;
+ }
+ UNREACHABLE();
+ return 0;
+}
+
+
void PrintElementsKind(FILE* out, ElementsKind kind) {
ElementsAccessor* accessor = ElementsAccessor::ForKind(kind);
PrintF(out, "%s", accessor->name());
diff --git a/src/elements-kind.h b/src/elements-kind.h
index 3be7711..c5d9df8 100644
--- a/src/elements-kind.h
+++ b/src/elements-kind.h
@@ -77,6 +77,8 @@ const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1;
const int kFastElementsKindCount = LAST_FAST_ELEMENTS_KIND -
FIRST_FAST_ELEMENTS_KIND + 1;
+int ElementsKindToShiftSize(ElementsKind elements_kind);
+
void PrintElementsKind(FILE* out, ElementsKind kind);
ElementsKind GetInitialFastElementsKind();
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 015212d..a1e5b97 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -4240,6 +4240,7 @@ class ArrayInstructionInterface {
virtual HValue* GetKey() = 0;
virtual void SetKey(HValue* key) = 0;
virtual void SetIndexOffset(uint32_t index_offset) = 0;
+ virtual int MaxIndexOffsetBits() = 0;
virtual bool IsDehoisted() = 0;
virtual void SetDehoisted(bool is_dehoisted) = 0;
virtual ~ArrayInstructionInterface() { };
@@ -4274,6 +4275,7 @@ class HLoadKeyedFastElement
void SetIndexOffset(uint32_t index_offset) {
bit_field_ = IndexOffsetField::update(bit_field_, index_offset);
}
+ int MaxIndexOffsetBits() { return 25; }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); }
@@ -4343,6 +4345,7 @@ class HLoadKeyedFastDoubleElement
HValue* dependency() { return OperandAt(2); }
uint32_t index_offset() { return index_offset_; }
void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
+ int MaxIndexOffsetBits() { return 25; }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return is_dehoisted_; }
@@ -4420,6 +4423,7 @@ class HLoadKeyedSpecializedArrayElement
ElementsKind elements_kind() const { return elements_kind_; }
uint32_t index_offset() { return index_offset_; }
void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
+ int MaxIndexOffsetBits() { return 25; }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return is_dehoisted_; }
@@ -4595,6 +4599,7 @@ class HStoreKeyedFastElement
}
uint32_t index_offset() { return index_offset_; }
void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
+ int MaxIndexOffsetBits() { return 25; }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return is_dehoisted_; }
@@ -4648,6 +4653,7 @@ class HStoreKeyedFastDoubleElement
HValue* value() { return OperandAt(2); }
uint32_t index_offset() { return index_offset_; }
void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
+ int MaxIndexOffsetBits() { return 25; }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return is_dehoisted_; }
@@ -4706,6 +4712,9 @@ class HStoreKeyedSpecializedArrayElement
ElementsKind elements_kind() const { return elements_kind_; }
uint32_t index_offset() { return index_offset_; }
void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
+ int MaxIndexOffsetBits() {
+ return 31 - ElementsKindToShiftSize(elements_kind_);
+ }
HValue* GetKey() { return key(); }
void SetKey(HValue* key) { SetOperandAt(1, key); }
bool IsDehoisted() { return is_dehoisted_; }
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 8393e51..e3f79ee 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3737,7 +3737,7 @@ static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
int32_t value = constant->Integer32Value() * sign;
// We limit offset values to 30 bits because we want to avoid the risk of
// overflows when the offset is added to the object header size.
- if (value >= 1 << 30 || value < 0) return;
+ if (value >= 1 << array_operation->MaxIndexOffsetBits() || value < 0) return;
array_operation->SetKey(subexpression);
if (index->HasNoUses()) {
index->DeleteAndReplaceWith(NULL);
diff --git a/src/lithium.cc b/src/lithium.cc
index eb2198d..1232bf1 100644
--- a/src/lithium.cc
+++ b/src/lithium.cc
@@ -227,36 +227,6 @@ void LPointerMap::PrintTo(StringStream* stream) {
}
-int ElementsKindToShiftSize(ElementsKind elements_kind) {
- switch (elements_kind) {
- case EXTERNAL_BYTE_ELEMENTS:
- case EXTERNAL_PIXEL_ELEMENTS:
- case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
- return 0;
- case EXTERNAL_SHORT_ELEMENTS:
- case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
- return 1;
- case EXTERNAL_INT_ELEMENTS:
- case EXTERNAL_UNSIGNED_INT_ELEMENTS:
- case EXTERNAL_FLOAT_ELEMENTS:
- return 2;
- case EXTERNAL_DOUBLE_ELEMENTS:
- case FAST_DOUBLE_ELEMENTS:
- case FAST_HOLEY_DOUBLE_ELEMENTS:
- return 3;
- case FAST_SMI_ELEMENTS:
- case FAST_ELEMENTS:
- case FAST_HOLEY_SMI_ELEMENTS:
- case FAST_HOLEY_ELEMENTS:
- case DICTIONARY_ELEMENTS:
- case NON_STRICT_ARGUMENTS_ELEMENTS:
- return kPointerSizeLog2;
- }
- UNREACHABLE();
- return 0;
-}
-
-
LLabel* LChunk::GetLabel(int block_id) const {
HBasicBlock* block = graph_->blocks()->at(block_id);
int first_instruction = block->first_instruction_index();
diff --git a/src/lithium.h b/src/lithium.h
index 089926e..a29d9d0 100644
--- a/src/lithium.h
+++ b/src/lithium.h
@@ -704,9 +704,6 @@ class LChunk: public ZoneObject {
};
-int ElementsKindToShiftSize(ElementsKind elements_kind);
-
-
} } // namespace v8::internal
#endif // V8_LITHIUM_H_
diff --git a/test/mjsunit/regress/regress-crbug-319835.js b/test/mjsunit/regress/regress-crbug-319835.js
new file mode 100644
index 0000000..48f871f
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-319835.js
@@ -0,0 +1,51 @@
+// Copyright 2013 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+try {} catch(e) {} // No need to optimize the top level.
+
+var size = 0x20000;
+var a = new Float64Array(size);
+var training = new Float64Array(10);
+function store(a, index) {
+ var offset = 0x20000000;
+ for (var i = 0; i < 1; i++) {
+ a[index + offset] = 0xcc;
+ }
+}
+
+store(training, -0x20000000);
+store(training, -0x20000000 + 1);
+store(training, -0x20000000);
+store(training, -0x20000000 + 1);
+%OptimizeFunctionOnNextCall(store);
+
+// Segfault maybe?
+for (var i = -0x20000000; i < -0x20000000 + size; i++) {
+ store(a, i);
+}
diff --git a/test/mjsunit/regress/regress-crbug-319860.js b/test/mjsunit/regress/regress-crbug-319860.js
new file mode 100644
index 0000000..b81fb85
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-319860.js
@@ -0,0 +1,47 @@
+// Copyright 2013 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+function read(a, index) {
+ var offset = 0x2000000;
+ var result;
+ for (var i = 0; i < 1; i++) {
+ result = a[index + offset];
+ }
+ return result;
+}
+
+var a = new Int8Array(0x2000001);
+read(a, 0);
+read(a, 0);
+%OptimizeFunctionOnNextCall(read);
+
+// Segfault maybe?
+for (var i = 0; i > -1000000; --i) {
+ read(a, i);
+}
--
1.8.4.2

View file

@ -0,0 +1,80 @@
From 3928813f014d3cdaed83fefc3a454078272f114b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hr=C4=8Dka?= <thrcka@redhat.com>
Date: Tue, 18 Feb 2014 00:23:04 +0100
Subject: [PATCH] Backport Fix for CVE-2013-6650 Original patch
https://code.google.com/p/v8/source/detail?r=18483
Resolve: rhbz#1059070
---
src/store-buffer.cc | 2 +-
test/mjsunit/regress/regress-331444.js | 45 ++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 test/mjsunit/regress/regress-331444.js
diff --git a/src/store-buffer.cc b/src/store-buffer.cc
index 66488ae..b9055f8 100644
--- a/src/store-buffer.cc
+++ b/src/store-buffer.cc
@@ -242,7 +242,7 @@ void StoreBuffer::ExemptPopularPages(int prime_sample_step, int threshold) {
containing_chunk = MemoryChunk::FromAnyPointerAddress(addr);
}
int old_counter = containing_chunk->store_buffer_counter();
- if (old_counter == threshold) {
+ if (old_counter >= threshold) {
containing_chunk->set_scan_on_scavenge(true);
created_new_scan_on_scavenge_pages = true;
}
diff --git a/test/mjsunit/regress/regress-331444.js b/test/mjsunit/regress/regress-331444.js
new file mode 100644
index 0000000..3df0a08
--- /dev/null
+++ b/test/mjsunit/regress/regress-331444.js
@@ -0,0 +1,45 @@
+// Copyright 2014 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc
+
+
+function boom() {
+ var args = [];
+ for (var i = 0; i < 125000; i++)
+ args.push(i);
+ return Array.apply(Array, args);
+}
+var array = boom();
+function fib(n) {
+ var f0 = 0, f1 = 1;
+ for (; n > 0; n = n - 1) {
+ f0 + f1;
+ f0 = array;
+ }
+}
+fib(12);
--
1.8.3.1

View file

@ -0,0 +1,60 @@
From 3122e0eae64c5ab494b29d0a9cadef902d93f1f9 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Fri, 22 Aug 2014 03:59:35 +0400
Subject: [PATCH] deps: fix up v8 after fd80a3
fd80a31e0697d6317ce8c2d289575399f4e06d21 has introduced a segfault
during redundant boundary check elimination (#8208).
The problem consists of two parts:
1. Abscense of instruction iterator in
`EliminateRedundantBoundsChecks`. It was present in recent v8, but
wasn't considered important at the time of backport. However, since
the function is changing instructions order in block, it is
important to not rely at `i->next()` at the end of the loop.
2. Too strict ASSERT in `MoveIndexIfNecessary`. It is essentially a
backport of a45c96ab from v8's upstream. See
https://github.com/v8/v8/commit/a45c96ab for details.
fix #8208
---
src/hydrogen.cc | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 50d8e49..18a6b60 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3546,7 +3546,11 @@ class BoundsCheckBbData: public ZoneObject {
void MoveIndexIfNecessary(HValue* index_raw,
HBoundsCheck* insert_before,
HInstruction* end_of_scan_range) {
- ASSERT(index_raw->IsAdd() || index_raw->IsSub());
+ if (!index_raw->IsAdd() && !index_raw->IsSub()) {
+ // index_raw can be HAdd(index_base, offset), HSub(index_base, offset),
+ // or index_base directly. In the latter case, no need to move anything.
+ return;
+ }
HBinaryOperation* index =
HArithmeticBinaryOperation::cast(index_raw);
HValue* left_input = index->left();
@@ -3581,7 +3585,6 @@ class BoundsCheckBbData: public ZoneObject {
HBoundsCheck* tighter_check) {
ASSERT(original_check->length() == tighter_check->length());
MoveIndexIfNecessary(tighter_check->index(), original_check, tighter_check);
- original_check->ReplaceAllUsesWith(original_check->index());
original_check->SetOperandAt(0, tighter_check->index());
}
};
@@ -3624,7 +3627,9 @@ void HGraph::EliminateRedundantBoundsChecks(HBasicBlock* bb,
BoundsCheckTable* table) {
BoundsCheckBbData* bb_data_list = NULL;
- for (HInstruction* i = bb->first(); i != NULL; i = i->next()) {
+ HInstruction* next;
+ for (HInstruction* i = bb->first(); i != NULL; i = next) {
+ next = i->next();
if (!i->IsBoundsCheck()) continue;
HBoundsCheck* check = HBoundsCheck::cast(i);

View file

@ -0,0 +1,186 @@
From fd80a31e0697d6317ce8c2d289575399f4e06d21 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Thu, 14 Aug 2014 19:29:28 +0400
Subject: [PATCH] deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://codereview.chromium.org/172093002
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@19475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
fix #8070
---
src/hydrogen.cc | 106 +++++++++++++++++++++++-------------------------
1 file changed, 50 insertions(+), 56 deletions(-)
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index e3f79ee..50d8e49 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3487,13 +3487,7 @@ class BoundsCheckBbData: public ZoneObject {
keep_new_check = true;
upper_check_ = new_check;
} else {
- BuildOffsetAdd(upper_check_,
- &added_upper_index_,
- &added_upper_offset_,
- Key()->IndexBase(),
- new_check->index()->representation(),
- new_offset);
- upper_check_->SetOperandAt(0, added_upper_index_);
+ TightenCheck(upper_check_, new_check);
}
} else if (new_offset < lower_offset_) {
lower_offset_ = new_offset;
@@ -3501,28 +3495,27 @@ class BoundsCheckBbData: public ZoneObject {
keep_new_check = true;
lower_check_ = new_check;
} else {
- BuildOffsetAdd(lower_check_,
- &added_lower_index_,
- &added_lower_offset_,
- Key()->IndexBase(),
- new_check->index()->representation(),
- new_offset);
- lower_check_->SetOperandAt(0, added_lower_index_);
+ TightenCheck(lower_check_, new_check);
}
} else {
- ASSERT(false);
+ // Should never have called CoverCheck() in this case.
+ UNREACHABLE();
}
if (!keep_new_check) {
new_check->DeleteAndReplaceWith(NULL);
+ } else {
+ HBoundsCheck* first_check = new_check == lower_check_ ? upper_check_
+ : lower_check_;
+ // The length is guaranteed to be live at first_check.
+ ASSERT(new_check->length() == first_check->length());
+ HInstruction* old_position = new_check->next();
+ new_check->Unlink();
+ new_check->InsertAfter(first_check);
+ MoveIndexIfNecessary(new_check->index(), new_check, old_position);
}
}
- void RemoveZeroOperations() {
- RemoveZeroAdd(&added_lower_index_, &added_lower_offset_);
- RemoveZeroAdd(&added_upper_index_, &added_upper_offset_);
- }
-
BoundsCheckBbData(BoundsCheckKey* key,
int32_t lower_offset,
int32_t upper_offset,
@@ -3537,10 +3530,6 @@ class BoundsCheckBbData: public ZoneObject {
basic_block_(bb),
lower_check_(lower_check),
upper_check_(upper_check),
- added_lower_index_(NULL),
- added_lower_offset_(NULL),
- added_upper_index_(NULL),
- added_upper_offset_(NULL),
next_in_bb_(next_in_bb),
father_in_dt_(father_in_dt) { }
@@ -3551,44 +3540,50 @@ class BoundsCheckBbData: public ZoneObject {
HBasicBlock* basic_block_;
HBoundsCheck* lower_check_;
HBoundsCheck* upper_check_;
- HAdd* added_lower_index_;
- HConstant* added_lower_offset_;
- HAdd* added_upper_index_;
- HConstant* added_upper_offset_;
BoundsCheckBbData* next_in_bb_;
BoundsCheckBbData* father_in_dt_;
- void BuildOffsetAdd(HBoundsCheck* check,
- HAdd** add,
- HConstant** constant,
- HValue* original_value,
- Representation representation,
- int32_t new_offset) {
- HConstant* new_constant = new(BasicBlock()->zone())
- HConstant(new_offset, Representation::Integer32());
- if (*add == NULL) {
- new_constant->InsertBefore(check);
- // Because of the bounds checks elimination algorithm, the index is always
- // an HAdd or an HSub here, so we can safely cast to an HBinaryOperation.
- HValue* context = HBinaryOperation::cast(check->index())->context();
- *add = new(BasicBlock()->zone()) HAdd(context,
- original_value,
- new_constant);
- (*add)->AssumeRepresentation(representation);
- (*add)->InsertBefore(check);
- } else {
- new_constant->InsertBefore(*add);
- (*constant)->DeleteAndReplaceWith(new_constant);
+ void MoveIndexIfNecessary(HValue* index_raw,
+ HBoundsCheck* insert_before,
+ HInstruction* end_of_scan_range) {
+ ASSERT(index_raw->IsAdd() || index_raw->IsSub());
+ HBinaryOperation* index =
+ HArithmeticBinaryOperation::cast(index_raw);
+ HValue* left_input = index->left();
+ HValue* right_input = index->right();
+ bool must_move_index = false;
+ bool must_move_left_input = false;
+ bool must_move_right_input = false;
+ for (HInstruction* cursor = end_of_scan_range; cursor != insert_before;) {
+ if (cursor == left_input) must_move_left_input = true;
+ if (cursor == right_input) must_move_right_input = true;
+ if (cursor == index) must_move_index = true;
+ if (cursor->previous() == NULL) {
+ cursor = cursor->block()->dominator()->end();
+ } else {
+ cursor = cursor->previous();
+ }
}
- *constant = new_constant;
- }
- void RemoveZeroAdd(HAdd** add, HConstant** constant) {
- if (*add != NULL && (*constant)->Integer32Value() == 0) {
- (*add)->DeleteAndReplaceWith((*add)->left());
- (*constant)->DeleteAndReplaceWith(NULL);
+ // The BCE algorithm only selects mergeable bounds checks that share
+ // the same "index_base", so we'll only ever have to move constants.
+ if (must_move_left_input) {
+ HConstant::cast(left_input)->Unlink();
+ HConstant::cast(left_input)->InsertBefore(index);
+ }
+ if (must_move_right_input) {
+ HConstant::cast(right_input)->Unlink();
+ HConstant::cast(right_input)->InsertBefore(index);
}
}
+
+ void TightenCheck(HBoundsCheck* original_check,
+ HBoundsCheck* tighter_check) {
+ ASSERT(original_check->length() == tighter_check->length());
+ MoveIndexIfNecessary(tighter_check->index(), original_check, tighter_check);
+ original_check->ReplaceAllUsesWith(original_check->index());
+ original_check->SetOperandAt(0, tighter_check->index());
+ }
};
@@ -3683,7 +3678,6 @@ void HGraph::EliminateRedundantBoundsChecks(HBasicBlock* bb,
for (BoundsCheckBbData* data = bb_data_list;
data != NULL;
data = data->NextInBasicBlock()) {
- data->RemoveZeroOperations();
if (data->FatherInDominatorTree()) {
table->Insert(data->Key(), data->FatherInDominatorTree(), zone());
} else {

View file

@ -0,0 +1,77 @@
From bf973073d98660edf35e01e6984029e46eb85368 Mon Sep 17 00:00:00 2001
From: "dslomov@chromium.org"
<dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Date: Mon, 13 Jan 2014 13:00:09 +0000
Subject: [PATCH] Use unsigned integer arithmetic in Zone::NewExpand.
BUG=328202
R=jkummerow@chromium.org
LOG=N
Review URL: https://codereview.chromium.org/108783005
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@18564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
---
src/zone.cc | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/src/zone.cc b/src/zone.cc
index 51b8113..c12978f 100644
--- a/src/zone.cc
+++ b/src/zone.cc
@@ -175,25 +175,31 @@ Address Zone::NewExpand(int size) {
// except that we employ a maximum segment size when we delete. This
// is to avoid excessive malloc() and free() overhead.
Segment* head = segment_head_;
- int old_size = (head == NULL) ? 0 : head->size();
- static const int kSegmentOverhead = sizeof(Segment) + kAlignment;
- int new_size_no_overhead = size + (old_size << 1);
- int new_size = kSegmentOverhead + new_size_no_overhead;
+ const size_t old_size = (head == NULL) ? 0 : head->size();
+ static const size_t kSegmentOverhead = sizeof(Segment) + kAlignment;
+ const size_t new_size_no_overhead = size + (old_size << 1);
+ size_t new_size = kSegmentOverhead + new_size_no_overhead;
+ const size_t min_new_size = kSegmentOverhead + static_cast<size_t>(size);
// Guard against integer overflow.
- if (new_size_no_overhead < size || new_size < kSegmentOverhead) {
+ if (new_size_no_overhead < static_cast<size_t>(size) ||
+ new_size < static_cast<size_t>(kSegmentOverhead)) {
V8::FatalProcessOutOfMemory("Zone");
return NULL;
}
- if (new_size < kMinimumSegmentSize) {
+ if (new_size < static_cast<size_t>(kMinimumSegmentSize)) {
new_size = kMinimumSegmentSize;
- } else if (new_size > kMaximumSegmentSize) {
+ } else if (new_size > static_cast<size_t>(kMaximumSegmentSize)) {
// Limit the size of new segments to avoid growing the segment size
// exponentially, thus putting pressure on contiguous virtual address space.
// All the while making sure to allocate a segment large enough to hold the
// requested size.
- new_size = Max(kSegmentOverhead + size, kMaximumSegmentSize);
+ new_size = Max(min_new_size, static_cast<size_t>(kMaximumSegmentSize));
}
- Segment* segment = NewSegment(new_size);
+ if (new_size > INT_MAX) {
+ V8::FatalProcessOutOfMemory("Zone");
+ return NULL;
+ }
+ Segment* segment = NewSegment(static_cast<int>(new_size));
if (segment == NULL) {
V8::FatalProcessOutOfMemory("Zone");
return NULL;
@@ -203,7 +209,10 @@ Address Zone::NewExpand(int size) {
Address result = RoundUp(segment->start(), kAlignment);
position_ = result + size;
// Check for address overflow.
- if (position_ < result) {
+ // (Should not happen since the segment is guaranteed to accomodate
+ // size bytes + header and alignment padding)
+ if (reinterpret_cast<uintptr_t>(position_)
+ < reinterpret_cast<uintptr_t>(result)) {
V8::FatalProcessOutOfMemory("Zone");
return NULL;
}
--
1.8.5.3

View file

@ -0,0 +1,30 @@
diff -up v8-3.14.5.10/src/zone.cc.3a9bfec v8-3.14.5.10/src/zone.cc
--- v8-3.14.5.10/src/zone.cc.3a9bfec 2016-07-06 11:21:45.362891427 -0400
+++ v8-3.14.5.10/src/zone.cc 2016-07-06 11:22:08.538764825 -0400
@@ -168,7 +168,10 @@ Address Zone::NewExpand(int size) {
// Make sure the requested size is already properly aligned and that
// there isn't enough room in the Zone to satisfy the request.
ASSERT(size == RoundDown(size, kAlignment));
- ASSERT(size > limit_ - position_);
+ ASSERT(limit_ < position_ ||
+ reinterpret_cast<uintptr_t>(limit_) -
+ reinterpret_cast<uintptr_t>(position_) <
+ size);
// Compute the new segment size. We use a 'high water mark'
// strategy, where we increase the segment size every time we expand
diff -up v8-3.14.5.10/src/zone-inl.h.3a9bfec v8-3.14.5.10/src/zone-inl.h
--- v8-3.14.5.10/src/zone-inl.h.3a9bfec 2016-07-06 11:21:00.075136898 -0400
+++ v8-3.14.5.10/src/zone-inl.h 2016-07-06 11:21:31.546966899 -0400
@@ -55,7 +55,10 @@ inline void* Zone::New(int size) {
// Check if the requested size is available without expanding.
Address result = position_;
- if (size > limit_ - position_) {
+ const uintptr_t limit = reinterpret_cast<uintptr_t>(limit_);
+ const uintptr_t position = reinterpret_cast<uintptr_t>(position_);
+ // position_ > limit_ can be true after the alignment correction above.
+ if (limit < position || (size_t) size > limit - position) {
result = NewExpand(size);
} else {
position_ += size;

View file

@ -0,0 +1,195 @@
diff -up v8-3.14.5.10/include/v8.h.riu v8-3.14.5.10/include/v8.h
--- v8-3.14.5.10/include/v8.h.riu 2015-09-21 13:31:44.871068685 -0400
+++ v8-3.14.5.10/include/v8.h 2015-09-21 13:32:08.884868178 -0400
@@ -1076,7 +1076,11 @@ class String : public Primitive {
NO_OPTIONS = 0,
HINT_MANY_WRITES_EXPECTED = 1,
NO_NULL_TERMINATION = 2,
- PRESERVE_ASCII_NULL = 4
+ PRESERVE_ASCII_NULL = 4,
+ // Used by WriteUtf8 to replace orphan surrogate code units with the
+ // unicode replacement character. Needs to be set to guarantee valid UTF-8
+ // output.
+ REPLACE_INVALID_UTF8 = 8
};
// 16-bit character codes.
diff -up v8-3.14.5.10/src/api.cc.riu v8-3.14.5.10/src/api.cc
--- v8-3.14.5.10/src/api.cc.riu 2015-09-21 13:33:24.604235945 -0400
+++ v8-3.14.5.10/src/api.cc 2015-09-21 13:37:21.428258540 -0400
@@ -3759,7 +3759,8 @@ static int RecursivelySerializeToUtf8(i:
int end,
int recursion_budget,
int32_t previous_character,
- int32_t* last_character) {
+ int32_t* last_character,
+ bool replace_invalid_utf8) {
int utf8_bytes = 0;
while (true) {
if (string->IsAsciiRepresentation()) {
@@ -3775,7 +3776,10 @@ static int RecursivelySerializeToUtf8(i:
for (int i = start; i < end; i++) {
uint16_t character = data[i];
current +=
- unibrow::Utf8::Encode(current, character, previous_character);
+ unibrow::Utf8::Encode(current,
+ character,
+ previous_character,
+ replace_invalid_utf8);
previous_character = character;
}
*last_character = previous_character;
@@ -3788,7 +3792,10 @@ static int RecursivelySerializeToUtf8(i:
for (int i = start; i < end; i++) {
uint16_t character = data[i];
current +=
- unibrow::Utf8::Encode(current, character, previous_character);
+ unibrow::Utf8::Encode(current,
+ character,
+ previous_character,
+ replace_invalid_utf8);
previous_character = character;
}
*last_character = previous_character;
@@ -3824,7 +3831,8 @@ static int RecursivelySerializeToUtf8(i:
boundary,
recursion_budget - 1,
previous_character,
- &previous_character);
+ &previous_character,
+ replace_invalid_utf8);
if (extra_utf8_bytes < 0) return extra_utf8_bytes;
buffer += extra_utf8_bytes;
utf8_bytes += extra_utf8_bytes;
@@ -3879,7 +3887,10 @@ int String::WriteUtf8(char* buffer,
return len;
}
- if (capacity == -1 || capacity / 3 >= string_length) {
+ bool replace_invalid_utf8 = (options & REPLACE_INVALID_UTF8);
+ int max16BitCodeUnitSize = unibrow::Utf8::kMax16BitCodeUnitSize;
+
+ if (capacity == -1 || capacity / max16BitCodeUnitSize >= string_length) {
int32_t previous = unibrow::Utf16::kNoPreviousCharacter;
const int kMaxRecursion = 100;
int utf8_bytes =
@@ -3889,7 +3900,8 @@ int String::WriteUtf8(char* buffer,
string_length,
kMaxRecursion,
previous,
- &previous);
+ &previous,
+ replace_invalid_utf8);
if (utf8_bytes >= 0) {
// Success serializing with recursion.
if ((options & NO_NULL_TERMINATION) == 0 &&
@@ -3942,14 +3954,16 @@ int String::WriteUtf8(char* buffer,
char intermediate[unibrow::Utf8::kMaxEncodedSize];
for (; i < len && pos < capacity; i++) {
i::uc32 c = write_input_buffer.GetNext();
- if (unibrow::Utf16::IsTrailSurrogate(c) &&
- unibrow::Utf16::IsLeadSurrogate(previous)) {
+ if (unibrow::Utf16::IsSurrogatePair(previous, c)) {
// We can't use the intermediate buffer here because the encoding
// of surrogate pairs is done under assumption that you can step
// back and fix the UTF8 stream. Luckily we only need space for one
// more byte, so there is always space.
ASSERT(pos < capacity);
- int written = unibrow::Utf8::Encode(buffer + pos, c, previous);
+ int written = unibrow::Utf8::Encode(buffer + pos,
+ c,
+ previous,
+ replace_invalid_utf8);
ASSERT(written == 1);
pos += written;
nchars++;
@@ -3957,7 +3971,8 @@ int String::WriteUtf8(char* buffer,
int written =
unibrow::Utf8::Encode(intermediate,
c,
- unibrow::Utf16::kNoPreviousCharacter);
+ unibrow::Utf16::kNoPreviousCharacter,
+ replace_invalid_utf8);
if (pos + written <= capacity) {
for (int j = 0; j < written; j++) {
buffer[pos + j] = intermediate[j];
diff -up v8-3.14.5.10/src/unicode.h.riu v8-3.14.5.10/src/unicode.h
--- v8-3.14.5.10/src/unicode.h.riu 2015-09-21 13:38:50.617513839 -0400
+++ v8-3.14.5.10/src/unicode.h 2015-09-21 13:40:32.019667163 -0400
@@ -117,6 +117,9 @@ class Buffer {
class Utf16 {
public:
+ static inline bool IsSurrogatePair(int lead, int trail) {
+ return IsLeadSurrogate(lead) && IsTrailSurrogate(trail);
+ }
static inline bool IsLeadSurrogate(int code) {
if (code == kNoPreviousCharacter) return false;
return (code & 0xfc00) == 0xd800;
@@ -152,13 +155,19 @@ class Utf16 {
class Utf8 {
public:
static inline uchar Length(uchar chr, int previous);
- static inline unsigned Encode(
- char* out, uchar c, int previous);
+ static inline unsigned Encode(char* out,
+ uchar c,
+ int previous,
+ bool replace_invalid = false);
static const byte* ReadBlock(Buffer<const char*> str, byte* buffer,
unsigned capacity, unsigned* chars_read, unsigned* offset);
static uchar CalculateValue(const byte* str,
unsigned length,
unsigned* cursor);
+
+
+ // The unicode replacement character, used to signal invalid unicode
+ // sequences (e.g. an orphan surrogate) when converting to a UTF-8 encoding.
static const uchar kBadChar = 0xFFFD;
static const unsigned kMaxEncodedSize = 4;
static const unsigned kMaxOneByteChar = 0x7f;
@@ -170,6 +179,9 @@ class Utf8 {
// that match are coded as a 4 byte UTF-8 sequence.
static const unsigned kBytesSavedByCombiningSurrogates = 2;
static const unsigned kSizeOfUnmatchedSurrogate = 3;
+ // The maximum size a single UTF-16 code unit may take up when encoded as
+ // UTF-8.
+ static const unsigned kMax16BitCodeUnitSize = 3;
private:
template <unsigned s> friend class Utf8InputBuffer;
diff -up v8-3.14.5.10/src/unicode-inl.h.riu v8-3.14.5.10/src/unicode-inl.h
--- v8-3.14.5.10/src/unicode-inl.h.riu 2015-09-21 13:37:36.002136853 -0400
+++ v8-3.14.5.10/src/unicode-inl.h 2015-09-21 13:38:41.566589411 -0400
@@ -79,7 +79,10 @@ template <class T, int s> int Mapping<T,
}
-unsigned Utf8::Encode(char* str, uchar c, int previous) {
+unsigned Utf8::Encode(char* str,
+ uchar c,
+ int previous,
+ bool replace_invalid) {
static const int kMask = ~(1 << 6);
if (c <= kMaxOneByteChar) {
str[0] = c;
@@ -89,12 +92,16 @@ unsigned Utf8::Encode(char* str, uchar c
str[1] = 0x80 | (c & kMask);
return 2;
} else if (c <= kMaxThreeByteChar) {
- if (Utf16::IsTrailSurrogate(c) &&
- Utf16::IsLeadSurrogate(previous)) {
+ if (Utf16::IsSurrogatePair(previous, c)) {
const int kUnmatchedSize = kSizeOfUnmatchedSurrogate;
return Encode(str - kUnmatchedSize,
Utf16::CombineSurrogatePair(previous, c),
- Utf16::kNoPreviousCharacter) - kUnmatchedSize;
+ Utf16::kNoPreviousCharacter,
+ replace_invalid) - kUnmatchedSize;
+ } else if (replace_invalid &&
+ (Utf16::IsLeadSurrogate(c) ||
+ Utf16::IsTrailSurrogate(c))) {
+ c = kBadChar;
}
str[0] = 0xE0 | (c >> 12);
str[1] = 0x80 | ((c >> 6) & kMask);

View file

@ -0,0 +1,139 @@
From fbff7054a47551387a99244e2cf0631f30406798 Mon Sep 17 00:00:00 2001
From: Trevor Norris <trev.norris@gmail.com>
Date: Tue, 18 Nov 2014 16:37:54 -0800
Subject: [PATCH] v8: add api for aborting on uncaught exception
Add v8::Isolate::SetAbortOnUncaughtException() so the user can be
notified when an uncaught exception has bubbled.
PR-URL: https://github.com/joyent/node/pull/8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
---
include/v8.h | 11 +++++++++++
src/api.cc | 5 +++++
src/isolate.cc | 33 +++++++++++++++++++++++----------
src/isolate.h | 5 +++++
4 files changed, 44 insertions(+), 10 deletions(-)
diff --git a/include/v8.h b/include/v8.h
index 71a0d01..e229ed9 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2842,6 +2842,17 @@ class V8EXPORT Isolate {
static Isolate* GetCurrent();
/**
+ * Custom callback used by embedders to help V8 determine if it should abort
+ * when it throws and no internal handler can catch the exception.
+ * If FLAG_abort_on_uncaught_exception is true, then V8 will abort if either:
+ * - no custom callback is set.
+ * - the custom callback set returns true.
+ * Otherwise it won't abort.
+ */
+ typedef bool (*abort_on_uncaught_exception_t)();
+ void SetAbortOnUncaughtException(abort_on_uncaught_exception_t callback);
+
+ /**
* Methods below this point require holding a lock (using Locker) in
* a multi-threaded environment.
*/
diff --git a/src/api.cc b/src/api.cc
index 96d564f..4b1aa67 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5550,6 +5550,11 @@ void Isolate::Enter() {
isolate->Enter();
}
+void Isolate::SetAbortOnUncaughtException(
+ abort_on_uncaught_exception_t callback) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->SetAbortOnUncaughtException(callback);
+}
void Isolate::Exit() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
diff --git a/src/isolate.cc b/src/isolate.cc
index 5a5293e..0b38616 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1152,18 +1152,26 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
thread_local_top()->pending_message_end_pos_ = location->end_pos();
}
- // If the abort-on-uncaught-exception flag is specified, abort on any
- // exception not caught by JavaScript, even when an external handler is
- // present. This flag is intended for use by JavaScript developers, so
- // print a user-friendly stack trace (not an internal one).
+ // If the abort-on-uncaught-exception flag is specified, and if the
+ // exception is not caught by JavaScript (even when an external handler is
+ // present).
if (fatal_exception_depth == 0 &&
FLAG_abort_on_uncaught_exception &&
(report_exception || can_be_caught_externally)) {
- fatal_exception_depth++;
- fprintf(stderr, "%s\n\nFROM\n",
- *MessageHandler::GetLocalizedMessage(message_obj));
- PrintCurrentStackTrace(stderr);
- OS::Abort();
+ // If the embedder didn't specify a custom uncaught exception callback,
+ // or if the custom callback determined that V8 should abort, then
+ // abort
+ bool should_abort = !abort_on_uncaught_exception_callback_ ||
+ abort_on_uncaught_exception_callback_();
+ if (should_abort) {
+ fatal_exception_depth++;
+ // This flag is intended for use by JavaScript developers, so
+ // print a user-friendly stack trace (not an internal one).
+ fprintf(stderr, "%s\n\nFROM\n",
+ *MessageHandler::GetLocalizedMessage(message_obj));
+ PrintCurrentStackTrace(stderr);
+ OS::Abort();
+ }
}
} else if (location != NULL && !location->script().is_null()) {
// We are bootstrapping and caught an error where the location is set
@@ -1339,6 +1347,10 @@ void Isolate::SetCaptureStackTraceForUncaughtExceptions(
stack_trace_for_uncaught_exceptions_options_ = options;
}
+void Isolate::SetAbortOnUncaughtException(
+ v8::Isolate::abort_on_uncaught_exception_t callback) {
+ abort_on_uncaught_exception_callback_ = callback;
+}
bool Isolate::is_out_of_memory() {
if (has_pending_exception()) {
@@ -1534,7 +1546,8 @@ Isolate::Isolate()
date_cache_(NULL),
context_exit_happened_(false),
deferred_handles_head_(NULL),
- optimizing_compiler_thread_(this) {
+ optimizing_compiler_thread_(this),
+ abort_on_uncaught_exception_callback_(NULL) {
TRACE_ISOLATE(constructor);
memset(isolate_addresses_, 0,
diff --git a/src/isolate.h b/src/isolate.h
index 2769ca7..8719aa1 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -692,6 +692,9 @@ class Isolate {
int frame_limit,
StackTrace::StackTraceOptions options);
+ typedef bool (*abort_on_uncaught_exception_t)();
+ void SetAbortOnUncaughtException(abort_on_uncaught_exception_t callback);
+
// Tells whether the current context has experienced an out of memory
// exception.
bool is_out_of_memory();
@@ -1292,6 +1295,8 @@ class Isolate {
DeferredHandles* deferred_handles_head_;
OptimizingCompilerThread optimizing_compiler_thread_;
+ abort_on_uncaught_exception_t abort_on_uncaught_exception_callback_;
+
friend class ExecutionAccess;
friend class HandleScopeImplementer;
friend class IsolateInitializer;

View file

@ -0,0 +1,137 @@
From 6ebd85e10535dfaa9181842fe73834e51d4d3e6c Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Thu, 27 Nov 2014 07:15:54 +0100
Subject: [PATCH] v8: don't busy loop in cpu profiler thread
Reduce the overhead of the CPU profiler by replacing sched_yield() with
nanosleep() in V8's tick event processor thread. The former only yields
the CPU when there is another process scheduled on the same CPU.
Before this commit, the thread would effectively busy loop and consume
100% CPU time. By forcing a one nanosecond sleep period rounded up to
the task scheduler's granularity (about 50 us on Linux), CPU usage for
the processor thread now hovers around 10-20% for a busy application.
PR-URL: https://github.com/joyent/node/pull/8789
Ref: https://github.com/strongloop/strong-agent/issues/3
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
---
src/platform-freebsd.cc | 5 -----
src/platform-linux.cc | 5 -----
src/platform-macos.cc | 5 -----
src/platform-openbsd.cc | 5 -----
src/platform-posix.cc | 6 ++++++
src/platform-solaris.cc | 5 -----
tools/gyp/v8.gyp | 2 +-
7 files changed, 7 insertions(+), 26 deletions(-)
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index 511759c..5c90c6b 100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -539,11 +539,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
class FreeBSDMutex : public Mutex {
public:
FreeBSDMutex() {
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index beb2cce..3d6b304 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -812,11 +812,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
class LinuxMutex : public Mutex {
public:
LinuxMutex() {
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index a216f6e..e54e3e4 100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -640,11 +640,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
class MacOSMutex : public Mutex {
public:
MacOSMutex() {
diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc
index 408d4dc..72167de 100644
--- a/src/platform-openbsd.cc
+++ b/src/platform-openbsd.cc
@@ -593,11 +593,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
class OpenBSDMutex : public Mutex {
public:
OpenBSDMutex() {
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index 5c3529d..8aecd56 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -392,6 +392,12 @@ void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
}
+void Thread::YieldCPU() {
+ const timespec delay = { 0, 1 };
+ nanosleep(&delay, NULL);
+}
+
+
// ----------------------------------------------------------------------------
// POSIX socket support.
//
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index 07718fe..4e95ecc 100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -527,11 +527,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
class SolarisMutex : public Mutex {
public:
SolarisMutex() {
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index 71cf366..c304925 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -715,7 +715,7 @@
['OS=="solaris"', {
'link_settings': {
'libraries': [
- '-lsocket -lnsl',
+ '-lsocket -lnsl -lrt',
]},
'sources': [
'../../src/platform-solaris.cc',

View file

@ -0,0 +1,30 @@
From 196184d332ba2d2defc56ad0b37653659a7d3ec0 Mon Sep 17 00:00:00 2001
From: "svenpanne@chromium.org" <svenpanne@chromium.org>
Date: Fri, 9 Nov 2012 11:30:05 +0000
Subject: [PATCH] v8: backport codereview.chromium.org/11362182
Keep the number of descriptors below
DescriptorArray::kMaxNumberOfDescriptors even for accessors
Review URL: https://codereview.chromium.org/11362182
---
src/objects.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/objects.cc b/src/objects.cc
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4453,7 +4453,9 @@ MaybeObject* JSObject::DefinePropertyAccessor(String* name,
// to do a lookup, which seems to be a bit of overkill.
Heap* heap = GetHeap();
bool only_attribute_changes = getter->IsNull() && setter->IsNull();
- if (HasFastProperties() && !only_attribute_changes) {
+ if (HasFastProperties() && !only_attribute_changes &&
+ (map()->NumberOfOwnDescriptors() <
+ DescriptorArray::kMaxNumberOfDescriptors)) {
MaybeObject* getterOk = heap->undefined_value();
if (!getter->IsNull()) {
getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes);
--
1.8.5.1

223
v8-3.14.5.10-gcc7.patch Normal file
View file

@ -0,0 +1,223 @@
diff -up v8-3.14.5.10/src/arm/assembler-arm.cc.gcc7 v8-3.14.5.10/src/arm/assembler-arm.cc
diff -up v8-3.14.5.10/src/deoptimizer.cc.gcc7 v8-3.14.5.10/src/deoptimizer.cc
--- v8-3.14.5.10/src/deoptimizer.cc.gcc7 2012-10-22 09:09:53.000000000 -0400
+++ v8-3.14.5.10/src/deoptimizer.cc 2017-02-28 16:55:25.553045035 -0500
@@ -1141,7 +1141,7 @@ bool Deoptimizer::DoOsrTranslateCommand(
}
output->SetRegister(output_reg, static_cast<int32_t>(uint32_value));
}
-
+ // intentional fallthrough
case Translation::DOUBLE_REGISTER: {
// Abort OSR if we don't have a number.
diff -up v8-3.14.5.10/src/ia32/assembler-ia32.cc.gcc7 v8-3.14.5.10/src/ia32/assembler-ia32.cc
--- v8-3.14.5.10/src/ia32/assembler-ia32.cc.gcc7 2017-03-01 10:21:11.271775490 -0500
+++ v8-3.14.5.10/src/ia32/assembler-ia32.cc 2017-03-01 10:21:44.242983779 -0500
@@ -420,6 +420,7 @@ void Assembler::Nop(int bytes) {
switch (bytes) {
case 2:
EMIT(0x66);
+ // intentional fallthrough
case 1:
EMIT(0x90);
return;
@@ -436,6 +437,7 @@ void Assembler::Nop(int bytes) {
return;
case 6:
EMIT(0x66);
+ // intentional fallthrough
case 5:
EMIT(0xf);
EMIT(0x1f);
@@ -456,12 +458,15 @@ void Assembler::Nop(int bytes) {
case 11:
EMIT(0x66);
bytes--;
+ // intentional fallthrough
case 10:
EMIT(0x66);
bytes--;
+ // intentional fallthrough
case 9:
EMIT(0x66);
bytes--;
+ // intentional fallthrough
case 8:
EMIT(0xf);
EMIT(0x1f);
diff -up v8-3.14.5.10/src/ic.cc.gcc7 v8-3.14.5.10/src/ic.cc
--- v8-3.14.5.10/src/ic.cc.gcc7 2012-10-22 09:09:53.000000000 -0400
+++ v8-3.14.5.10/src/ic.cc 2017-02-28 16:55:25.554045011 -0500
@@ -1989,8 +1989,8 @@ void KeyedStoreIC::UpdateCaches(LookupRe
name, receiver, field_index, transition, strict_mode);
break;
}
- // fall through.
}
+ // intentional fallthrough
case NORMAL:
case CONSTANT_FUNCTION:
case CALLBACKS:
diff -up v8-3.14.5.10/src/objects.cc.gcc7 v8-3.14.5.10/src/objects.cc
--- v8-3.14.5.10/src/objects.cc.gcc7 2017-02-28 16:55:25.516045908 -0500
+++ v8-3.14.5.10/src/objects.cc 2017-02-28 16:55:25.555044988 -0500
@@ -10302,7 +10302,7 @@ void JSObject::GetElementsCapacityAndUsa
*used = Smi::cast(JSArray::cast(this)->length())->value();
break;
}
- // Fall through if packing is not guaranteed.
+ // intentional fallthrough
case FAST_HOLEY_SMI_ELEMENTS:
case FAST_HOLEY_ELEMENTS:
backing_store = FixedArray::cast(backing_store_base);
@@ -10324,7 +10324,7 @@ void JSObject::GetElementsCapacityAndUsa
*used = Smi::cast(JSArray::cast(this)->length())->value();
break;
}
- // Fall through if packing is not guaranteed.
+ // intentional fallthrough
case FAST_HOLEY_DOUBLE_ELEMENTS: {
FixedDoubleArray* elms = FixedDoubleArray::cast(elements());
*capacity = elms->length();
diff -up v8-3.14.5.10/src/objects.h.gcc7 v8-3.14.5.10/src/objects.h
--- v8-3.14.5.10/src/objects.h.gcc7 2017-02-28 16:55:25.517045885 -0500
+++ v8-3.14.5.10/src/objects.h 2017-02-28 16:55:25.556044964 -0500
@@ -2785,24 +2785,10 @@ class HashTable: public FixedArray {
USE_CUSTOM_MINIMUM_CAPACITY
};
- // Wrapper methods
- inline uint32_t Hash(Key key) {
- if (Shape::UsesSeed) {
- return Shape::SeededHash(key,
- GetHeap()->HashSeed());
- } else {
- return Shape::Hash(key);
- }
- }
-
- inline uint32_t HashForObject(Key key, Object* object) {
- if (Shape::UsesSeed) {
- return Shape::SeededHashForObject(key,
- GetHeap()->HashSeed(), object);
- } else {
- return Shape::HashForObject(key, object);
- }
- }
+ // Wrapper methods. Defined in src/objects-inl.h
+ // to break a cycle with src/heap/heap.h.
+ inline uint32_t Hash(Key key);
+ inline uint32_t HashForObject(Key key, Object* object);
// Returns the number of elements in the hash table.
int NumberOfElements() {
diff -up v8-3.14.5.10/src/objects-inl.h.gcc7 v8-3.14.5.10/src/objects-inl.h
--- v8-3.14.5.10/src/objects-inl.h.gcc7 2017-02-28 16:55:25.517045885 -0500
+++ v8-3.14.5.10/src/objects-inl.h 2017-02-28 16:55:25.556044964 -0500
@@ -52,6 +52,26 @@
namespace v8 {
namespace internal {
+template<typename Shape, typename Key>
+uint32_t HashTable<Shape, Key>::Hash(Key key) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHash(key,
+ GetHeap()->HashSeed());
+ } else {
+ return Shape::Hash(key);
+ }
+}
+
+template<typename Shape, typename Key>
+uint32_t HashTable<Shape, Key>::HashForObject(Key key, Object* object) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHashForObject(key,
+ GetHeap()->HashSeed(), object);
+ } else {
+ return Shape::HashForObject(key, object);
+ }
+}
+
PropertyDetails::PropertyDetails(Smi* smi) {
value_ = smi->value();
}
diff -up v8-3.14.5.10/src/parser.cc.gcc7 v8-3.14.5.10/src/parser.cc
--- v8-3.14.5.10/src/parser.cc.gcc7 2017-02-28 16:55:25.450047466 -0500
+++ v8-3.14.5.10/src/parser.cc 2017-02-28 16:55:25.557044941 -0500
@@ -3649,8 +3649,7 @@ Expression* Parser::ParsePrimaryExpressi
result = ParseV8Intrinsic(CHECK_OK);
break;
}
- // If we're not allowing special syntax we fall-through to the
- // default case.
+ // intentional fallthrough
default: {
Token::Value tok = Next();
@@ -5376,8 +5375,8 @@ RegExpTree* RegExpParser::ParseDisjuncti
if (ParseIntervalQuantifier(&dummy, &dummy)) {
ReportError(CStrVector("Nothing to repeat") CHECK_FAILED);
}
- // fallthrough
}
+ // intentional fallthrough
default:
builder->AddCharacter(current());
Advance();
diff -up v8-3.14.5.10/src/spaces.h.gcc7 v8-3.14.5.10/src/spaces.h
--- v8-3.14.5.10/src/spaces.h.gcc7 2012-10-22 09:09:53.000000000 -0400
+++ v8-3.14.5.10/src/spaces.h 2017-02-28 16:55:25.557044941 -0500
@@ -2613,15 +2613,15 @@ class PointerChunkIterator BASE_EMBEDDED
return old_pointer_iterator_.next();
}
state_ = kMapState;
- // Fall through.
}
+ // intentional fallthrough
case kMapState: {
if (map_iterator_.has_next()) {
return map_iterator_.next();
}
state_ = kLargeObjectState;
- // Fall through.
}
+ // intentional fallthrough
case kLargeObjectState: {
HeapObject* heap_object;
do {
diff -up v8-3.14.5.10/src/x64/assembler-x64.cc.gcc7 v8-3.14.5.10/src/x64/assembler-x64.cc
--- v8-3.14.5.10/src/x64/assembler-x64.cc.gcc7 2017-03-01 10:19:40.086088012 -0500
+++ v8-3.14.5.10/src/x64/assembler-x64.cc 2017-03-01 10:20:51.859241627 -0500
@@ -1800,6 +1800,7 @@ void Assembler::Nop(int n) {
switch (n) {
case 2:
emit(0x66);
+ // intentional fallthrough
case 1:
emit(0x90);
return;
@@ -1816,6 +1817,7 @@ void Assembler::Nop(int n) {
return;
case 6:
emit(0x66);
+ // intentional fallthrough
case 5:
emit(0x0f);
emit(0x1f);
@@ -1836,12 +1838,15 @@ void Assembler::Nop(int n) {
case 11:
emit(0x66);
n--;
+ // intentional fallthrough
case 10:
emit(0x66);
n--;
+ // intentional fallthrough
case 9:
emit(0x66);
n--;
+ // intentional fallthrough
case 8:
emit(0x0f);
emit(0x1f);

12
v8-3.14.5.10-gcc8.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up v8-3.14.5.10/src/frames.h.gcc8 v8-3.14.5.10/src/frames.h
--- v8-3.14.5.10/src/frames.h.gcc8 2018-05-18 14:41:15.119069125 -0400
+++ v8-3.14.5.10/src/frames.h 2018-05-18 14:42:07.421810155 -0400
@@ -67,7 +67,7 @@ class InnerPointerToCodeCache {
Code* GcSafeCastToCode(HeapObject* object, Address inner_pointer);
void Flush() {
- memset(&cache_[0], 0, sizeof(cache_));
+ memset(static_cast<void*>(&cache_[0]), 0, sizeof(cache_));
}
InnerPointerToCodeCacheEntry* GetCacheEntry(Address inner_pointer);

View file

@ -0,0 +1,33 @@
From 530af9cb8e700e7596b3ec812bad123c9fa06356 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Wed, 30 Jul 2014 15:33:52 -0700
Subject: [PATCH] v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002
---
src/isolate.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/isolate.h b/src/isolate.h
index b90191d..2769ca7 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1392,14 +1392,9 @@ class StackLimitCheck BASE_EMBEDDED {
public:
explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { }
- bool HasOverflowed() const {
+ inline bool HasOverflowed() const {
StackGuard* stack_guard = isolate_->stack_guard();
- // Stack has overflowed in C++ code only if stack pointer exceeds the C++
- // stack guard and the limits are not set to interrupt values.
- // TODO(214): Stack overflows are ignored if a interrupt is pending. This
- // code should probably always use the initial C++ limit.
- return (reinterpret_cast<uintptr_t>(this) < stack_guard->climit()) &&
- stack_guard->IsStackOverflow();
+ return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit();
}
private:
Isolate* isolate_;
--
2.0.3

View file

@ -0,0 +1,43 @@
From 431eb172f97434a3b0868a610bc14d8ff7d9efd9 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Fri, 16 Jan 2015 13:44:42 +0100
Subject: [PATCH] deps: log V8 version in profiler log file
Patch from issue 800293002 authored by ben@strongloop.com
Review URL: https://codereview.chromium.org/806143002
PR-URL: https://github.com/joyent/node/pull/9043
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
---
src/log-utils.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/log-utils.cc b/src/log-utils.cc
index 5e607da..622cc51 100644
--- a/src/log-utils.cc
+++ b/src/log-utils.cc
@@ -29,6 +29,7 @@
#include "log-utils.h"
#include "string-stream.h"
+#include "version.h"
namespace v8 {
namespace internal {
@@ -136,6 +137,14 @@ void Log::Initialize() {
}
}
}
+
+ if (output_handle_ != NULL) {
+ LogMessageBuilder msg(logger_);
+ msg.Append("v8-version,%d,%d,%d,%d,%d\n", Version::GetMajor(),
+ Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
+ Version::IsCandidate());
+ msg.WriteToLogFile();
+ }
}

View file

@ -0,0 +1,16 @@
diff -up v8-3.14.5.10/src/log.cc.builtinnames v8-3.14.5.10/src/log.cc
--- v8-3.14.5.10/src/log.cc.builtinnames 2016-07-06 11:25:12.341766992 -0400
+++ v8-3.14.5.10/src/log.cc 2016-07-06 11:25:41.065609632 -0400
@@ -1485,7 +1485,11 @@ void Logger::LogCodeObject(Object* objec
tag = Logger::STUB_TAG;
break;
case Code::BUILTIN:
- description = "A builtin from the snapshot";
+ description =
+ Isolate::Current()->builtins()->Lookup(code_object->entry());
+ if (description == NULL) {
+ description = "A builtin from the snapshot";
+ }
tag = Logger::BUILTIN_TAG;
break;
case Code::KEYED_LOAD_IC:

17
v8-3.14.5.10-scons3.patch Normal file
View file

@ -0,0 +1,17 @@
Only in v8-3.14.5.10.fixed: obj
Only in v8-3.14.5.10.fixed: .sconsign.dblite
diff -urp v8-3.14.5.10/SConstruct v8-3.14.5.10.fixed/SConstruct
--- v8-3.14.5.10/SConstruct 2019-03-19 13:25:16.413099125 +0100
+++ v8-3.14.5.10.fixed/SConstruct 2019-03-19 13:25:03.288988321 +0100
@@ -1189,7 +1189,7 @@ def AddOptions(options, result):
def GetOptions():
- result = Options()
+ result = Variables()
result.Add('mode', 'compilation mode (debug, release)', 'release')
result.Add('sample', 'build sample (shell, process, lineprocessor)', '')
result.Add('cache', 'directory to use for scons build cache', '')
Only in v8-3.14.5.10.fixed/tools: js2c.pyc
Only in v8-3.14.5.10.fixed/tools: jsmin.pyc
Only in v8-3.14.5.10.fixed/tools: utils.pyc

View file

@ -0,0 +1,44 @@
diff -up v8-3.14.5.10/src/ia32/cpu-ia32.cc.system-valgrind v8-3.14.5.10/src/ia32/cpu-ia32.cc
--- v8-3.14.5.10/src/ia32/cpu-ia32.cc.system-valgrind 2012-01-16 06:42:08.000000000 -0500
+++ v8-3.14.5.10/src/ia32/cpu-ia32.cc 2014-12-02 15:15:07.819525430 -0500
@@ -28,7 +28,7 @@
// CPU specific code for ia32 independent of OS goes here.
#ifdef __GNUC__
-#include "third_party/valgrind/valgrind.h"
+#include <valgrind/valgrind.h>
#endif
#include "v8.h"
@@ -67,8 +67,7 @@ void CPU::FlushICache(void* start, size_
// solution is to run valgrind with --smc-check=all, but this comes at a big
// performance cost. We can notify valgrind to invalidate its cache.
#ifdef VALGRIND_DISCARD_TRANSLATIONS
- unsigned res = VALGRIND_DISCARD_TRANSLATIONS(start, size);
- USE(res);
+ VALGRIND_DISCARD_TRANSLATIONS(start, size);
#endif
}
diff -up v8-3.14.5.10/src/x64/cpu-x64.cc.system-valgrind v8-3.14.5.10/src/x64/cpu-x64.cc
--- v8-3.14.5.10/src/x64/cpu-x64.cc.system-valgrind 2012-02-23 03:45:21.000000000 -0500
+++ v8-3.14.5.10/src/x64/cpu-x64.cc 2014-12-02 15:14:51.289621074 -0500
@@ -28,7 +28,7 @@
// CPU specific code for x64 independent of OS goes here.
#if defined(__GNUC__) && !defined(__MINGW64__)
-#include "third_party/valgrind/valgrind.h"
+#include <valgrind/valgrind.h>
#endif
#include "v8.h"
@@ -67,8 +67,7 @@ void CPU::FlushICache(void* start, size_
// solution is to run valgrind with --smc-check=all, but this comes at a big
// performance cost. We can notify valgrind to invalidate its cache.
#ifdef VALGRIND_DISCARD_TRANSLATIONS
- unsigned res = VALGRIND_DISCARD_TRANSLATIONS(start, size);
- USE(res);
+ VALGRIND_DISCARD_TRANSLATIONS(start, size);
#endif
}

View file

@ -0,0 +1,37 @@
From 0ff51c6e063e3eea9e4d9ea68edc82d935626fc7 Mon Sep 17 00:00:00 2001
From: Julien Gilli <julien.gilli@joyent.com>
Date: Fri, 28 Nov 2014 15:33:35 -0800
Subject: [PATCH] deps: backport 2ad2237 from v8 upstream
Original commit message:
Fix Unhandled ReferenceError in debug-debugger.js
This fixes following exception in Sky on attempt to set a breakpoint
"Unhandled: Uncaught ReferenceError: break_point is not defined"
I think this happens in Sky but not in Chrome because Sky scripts are executed in strict mode.
BUG=None
LOG=N
R=yangguo@chromium.org
Review URL: https://codereview.chromium.org/741683002
Cr-Commit-Position: refs/heads/master@{#25415}
---
src/debug-debugger.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index dfad902..a27961f 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -442,7 +442,7 @@ ScriptBreakPoint.prototype.set = function (script) {
if (position === null) return;
// Create a break point object and set the break point.
- break_point = MakeBreakPoint(position, this);
+ var break_point = MakeBreakPoint(position, this);
break_point.setIgnoreCount(this.ignoreCount());
var actual_position = %SetScriptBreakPoint(script, position, break_point);
if (IS_UNDEFINED(actual_position)) {

View file

@ -0,0 +1,39 @@
From 53b4accb6e5747b156be91a2b90f42607e33a7cc Mon Sep 17 00:00:00 2001
From: Timothy J Fontaine <tjfontaine@gmail.com>
Date: Mon, 4 Aug 2014 13:43:50 -0700
Subject: [PATCH] v8: Fix compliation with GCC 4.8
Supresses a very loud warning from GCC 4.8 about unused typedefs
Original url https://codereview.chromium.org/69413002
---
src/checks.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/checks.h b/src/checks.h
index d0a0c2b..4396ada 100644
--- a/src/checks.h
+++ b/src/checks.h
@@ -230,6 +230,13 @@ inline void CheckNonEqualsHelper(const char* file,
#define CHECK_LE(a, b) CHECK((a) <= (b))
+#if defined(__clang__) || defined(__GNUC__)
+# define V8_UNUSED __attribute__((unused))
+#else
+# define V8_UNUSED
+#endif
+
+
// This is inspired by the static assertion facility in boost. This
// is pretty magical. If it causes you trouble on a platform you may
// find a fix in the boost code.
@@ -248,7 +255,7 @@ template <int> class StaticAssertionHelper { };
#define STATIC_CHECK(test) \
typedef \
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
- SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
+ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) V8_UNUSED
extern bool FLAG_enable_slow_asserts;

View file

@ -0,0 +1,122 @@
From f9ced08de30c37838756e8227bd091f80ad9cafa Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <ben@strongloop.com>
Date: Thu, 24 Apr 2014 04:27:40 +0200
Subject: [PATCH] deps: make v8 use CLOCK_REALTIME_COARSE
Date.now() indirectly calls gettimeofday() on Linux and that's a system
call that is extremely expensive on virtualized systems when the host
operating system has to emulate access to the hardware clock.
Case in point: output from `perf record -c 10000 -e cycles:u -g -i`
for a benchmark/http_simple bytes/8 benchmark with a light load of
50 concurrent clients:
53.69% node node [.] v8::internal::OS::TimeCurrentMillis()
|
--- v8::internal::OS::TimeCurrentMillis()
|
|--99.77%-- v8::internal::Runtime_DateCurrentTime(v8::internal::Arguments, v8::internal::Isolate*)
| 0x23587880618e
That's right - over half of user time spent inside the V8 function that
calls gettimeofday().
Notably, nearly all system time gets attributed to acpi_pm_read(), the
kernel function that reads the ACPI power management timer:
32.49% node [kernel.kallsyms] [k] acpi_pm_read
|
--- acpi_pm_read
|
|--98.40%-- __getnstimeofday
| getnstimeofday
| |
| |--71.61%-- do_gettimeofday
| | sys_gettimeofday
| | system_call_fastpath
| | 0x7fffbbaf6dbc
| | |
| | |--98.72%-- v8::internal::OS::TimeCurrentMillis()
The cost of the gettimeofday() system call is normally measured in
nanoseconds but we were seeing 100 us averages and spikes >= 1000 us.
The numbers were so bad, my initial hunch was that the node process was
continuously getting rescheduled inside the system call...
v8::internal::OS::TimeCurrentMillis()'s most frequent caller is
v8::internal::Runtime_DateCurrentTime(), the V8 run-time function
that's behind Date.now(). The timeout handling logic in lib/http.js
and lib/net.js calls into lib/timers.js and that module will happily
call Date.now() hundreds or even thousands of times per second.
If you saw exports._unrefActive() show up in --prof output a lot,
now you know why.
That's why this commit makes V8 switch over to clock_gettime() on Linux.
In particular, it checks if CLOCK_REALTIME_COARSE is available and has
a resolution <= 1 ms because in that case the clock_gettime() call can
be fully serviced from the vDSO.
It speeds up the aforementioned benchmark by about 100% on the affected
systems and should go a long way toward addressing the latency issues
that StrongLoop customers have been reporting.
This patch will be upstreamed as a CR against V8 3.26. I'm sending it
as a pull request for v0.10 first because that's what our users are
running and because the delta between 3.26 and 3.14 is too big to
reasonably back-port the patch. I'll open a pull request for the
master branch once the CR lands upstream.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
---
src/platform-posix.cc | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index ad74eba..3c86868 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -188,19 +188,37 @@ int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
double OS::TimeCurrentMillis() {
- struct timeval tv;
- if (gettimeofday(&tv, NULL) < 0) return 0.0;
- return (static_cast<double>(tv.tv_sec) * 1000) +
- (static_cast<double>(tv.tv_usec) / 1000);
+ return static_cast<double>(Ticks()) / 1000;
}
int64_t OS::Ticks() {
+#if defined(__linux__)
+ static clockid_t clock_id = static_cast<clockid_t>(-1);
+ struct timespec spec;
+ if (clock_id == static_cast<clockid_t>(-1)) {
+ // CLOCK_REALTIME_COARSE may not be defined by the system headers but
+ // might still be supported by the kernel so use the clock id directly.
+ // Only use CLOCK_REALTIME_COARSE when its granularity <= 1 ms.
+ const clockid_t clock_realtime_coarse = 5;
+ if (clock_getres(clock_realtime_coarse, &spec) == 0 &&
+ spec.tv_nsec <= 1000 * 1000) {
+ clock_id = clock_realtime_coarse;
+ } else {
+ clock_id = CLOCK_REALTIME;
+ }
+ }
+ if (clock_gettime(clock_id, &spec) != 0) {
+ return 0; // Not really possible.
+ }
+ return static_cast<int64_t>(spec.tv_sec) * 1000000 + (spec.tv_nsec / 1000);
+#else
// gettimeofday has microsecond resolution.
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0)
return 0;
return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
+#endif
}
--
1.9.1

View file

@ -0,0 +1,105 @@
From 3530fa9cd09f8db8101c4649cab03bcdf760c434 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Fri, 21 Dec 2012 17:52:00 +0000
Subject: [PATCH] deps: backport 4ed5fde4f from v8 upstream
Original commit message:
Fix x64 MathMinMax for negative untagged int32 arguments.
An untagged int32 has zeros in the upper half even if it is negative.
Using cmpq to compare such numbers will incorrectly ignore the sign.
BUG=164442
R=mvstanton@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11665007
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Signed-off-by: Fedor Indutny <fedor@indutny.com>
---
src/x64/lithium-codegen-x64.cc | 6 ++--
test/mjsunit/regress/regress-164442.js | 45 ++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 3 deletions(-)
create mode 100644 test/mjsunit/regress/regress-164442.js
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index b461e62..ff01f44 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1457,17 +1457,17 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
if (right->IsConstantOperand()) {
Immediate right_imm =
Immediate(ToInteger32(LConstantOperand::cast(right)));
- __ cmpq(left_reg, right_imm);
+ __ cmpl(left_reg, right_imm);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_imm);
} else if (right->IsRegister()) {
Register right_reg = ToRegister(right);
- __ cmpq(left_reg, right_reg);
+ __ cmpl(left_reg, right_reg);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_reg);
} else {
Operand right_op = ToOperand(right);
- __ cmpq(left_reg, right_op);
+ __ cmpl(left_reg, right_op);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_op);
}
diff --git a/test/mjsunit/regress/regress-164442.js b/test/mjsunit/regress/regress-164442.js
new file mode 100644
index 0000000..1160d87
--- /dev/null
+++ b/test/mjsunit/regress/regress-164442.js
@@ -0,0 +1,45 @@
+// Copyright 2012 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+// Should not take a very long time (n^2 algorithms are bad)
+
+
+function ensureNotNegative(x) {
+ return Math.max(0, x | 0);
+}
+
+
+ensureNotNegative(1);
+ensureNotNegative(2);
+
+%OptimizeFunctionOnNextCall(ensureNotNegative);
+
+var r = ensureNotNegative(-1);
+
+assertEquals(0, r);
--
2.0.3

View file

@ -0,0 +1,116 @@
From a960d1707a0038bfa5546c669b5b63c35bdb75c5 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Fri, 2 May 2014 22:44:45 +0400
Subject: [PATCH] deps: backport 23f2736a from v8 upstream
Original text:
Fix corner case in x64 compare stubs.
BUG=v8:2416
Review URL: https://codereview.chromium.org/11413087
fix #7528
---
src/x64/code-stubs-x64.cc | 2 +-
test/mjsunit/regress/regress-2416.js | 75 ++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 test/mjsunit/regress/regress-2416.js
diff --git a/src/x64/code-stubs-x64.cc b/deps/v8/src/x64/code-stubs-x64.cc
index f0f9c5d..9ad0167 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -5580,7 +5580,7 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
__ subq(rdx, rax);
__ j(no_overflow, &done, Label::kNear);
// Correct sign of result in case of overflow.
- __ SmiNot(rdx, rdx);
+ __ not_(rdx);
__ bind(&done);
__ movq(rax, rdx);
}
diff --git a/test/mjsunit/regress/regress-2416.js b/deps/v8/test/mjsunit/regress/regress-2416.js
new file mode 100644
index 0000000..02afeb9
--- /dev/null
+++ b/test/mjsunit/regress/regress-2416.js
@@ -0,0 +1,75 @@
+// Copyright 2012 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+assertFalse(2147483647 < -2147483648)
+assertFalse(2147483647 <= -2147483648)
+assertFalse(2147483647 == -2147483648)
+assertTrue(2147483647 >= -2147483648)
+assertTrue(2147483647 > -2147483648)
+
+assertTrue(-2147483648 < 2147483647)
+assertTrue(-2147483648 <= 2147483647)
+assertFalse(-2147483648 == 2147483647)
+assertFalse(-2147483648 >= 2147483647)
+assertFalse(-2147483648 > 2147483647)
+
+assertFalse(2147483647 < 2147483647)
+assertTrue(2147483647 <= 2147483647)
+assertTrue(2147483647 == 2147483647)
+assertTrue(2147483647 >= 2147483647)
+assertFalse(2147483647 > 2147483647)
+
+assertFalse(-2147483648 < -2147483648)
+assertTrue(-2147483648 <= -2147483648)
+assertTrue(-2147483648 == -2147483648)
+assertTrue(-2147483648 >= -2147483648)
+assertFalse(-2147483648 > -2147483648)
+
+
+assertFalse(1073741823 < -1073741824)
+assertFalse(1073741823 <= -1073741824)
+assertFalse(1073741823 == -1073741824)
+assertTrue(1073741823 >= -1073741824)
+assertTrue(1073741823 > -1073741824)
+
+assertTrue(-1073741824 < 1073741823)
+assertTrue(-1073741824 <= 1073741823)
+assertFalse(-1073741824 == 1073741823)
+assertFalse(-1073741824 >= 1073741823)
+assertFalse(-1073741824 > 1073741823)
+
+assertFalse(1073741823 < 1073741823)
+assertTrue(1073741823 <= 1073741823)
+assertTrue(1073741823 == 1073741823)
+assertTrue(1073741823 >= 1073741823)
+assertFalse(1073741823 > 1073741823)
+
+assertFalse(-1073741824 < -1073741824)
+assertTrue(-1073741824 <= -1073741824)
+assertTrue(-1073741824 == -1073741824)
+assertTrue(-1073741824 >= -1073741824)
+assertFalse(-1073741824 > -1073741824)
--
1.9.3

View file

@ -0,0 +1,134 @@
From 5b1d2144ebd47ea768ca5b3cfcda830433c88efe Mon Sep 17 00:00:00 2001
From: "T.C. Hollingsworth" <tchollingsworth@gmail.com>
Date: Thu, 21 Mar 2013 17:34:19 -0700
Subject: [PATCH] backport fix for CVE-2013-2632 from SVN r13964
---
src/objects-inl.h | 3 ++-
src/objects.h | 7 +++++--
src/parser.cc | 4 ++--
src/parser.h | 5 -----
src/stub-cache.cc | 8 ++++----
5 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ea5a93f..4834fa6 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3500,8 +3500,9 @@ Code::Flags Code::ComputeFlags(Kind kind,
kind == CALL_IC ||
kind == STORE_IC ||
kind == KEYED_STORE_IC);
+ ASSERT(argc <= Code::kMaxArguments);
// Compute the bit mask.
- int bits = KindField::encode(kind)
+ unsigned int bits = KindField::encode(kind)
| ICStateField::encode(ic_state)
| TypeField::encode(type)
| ExtraICStateField::encode(extra_ic_state)
diff --git a/src/objects.h b/src/objects.h
index 755dd42..47d7757 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4180,8 +4180,8 @@ class Code: public HeapObject {
// FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that
// enumeration type has correct value range (see Issue 830 for more details).
enum Flags {
- FLAGS_MIN_VALUE = kMinInt,
- FLAGS_MAX_VALUE = kMaxInt
+ FLAGS_MIN_VALUE = 0,
+ FLAGS_MAX_VALUE = kMaxUInt32
};
#define CODE_KIND_LIST(V) \
@@ -4644,6 +4644,9 @@ class Code: public HeapObject {
// Signed field cannot be encoded using the BitField class.
static const int kArgumentsCountShift = 14;
static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1);
+ static const int kArgumentsBits =
+ PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1;
+ static const int kMaxArguments = (1 << kArgumentsBits) - 1;
// This constant should be encodable in an ARM instruction.
static const int kFlagsNotUsedInLookup =
diff --git a/src/parser.cc b/src/parser.cc
index 03e4b03..6da414a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4243,7 +4243,7 @@ ZoneList<Expression*>* Parser::ParseArguments(bool* ok) {
while (!done) {
Expression* argument = ParseAssignmentExpression(true, CHECK_OK);
result->Add(argument, zone());
- if (result->length() > kMaxNumFunctionParameters) {
+ if (result->length() > Code::kMaxArguments) {
ReportMessageAt(scanner().location(), "too_many_arguments",
Vector<const char*>::empty());
*ok = false;
@@ -4420,7 +4420,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name,
top_scope_->DeclareParameter(param_name, VAR);
num_parameters++;
- if (num_parameters > kMaxNumFunctionParameters) {
+ if (num_parameters > Code::kMaxArguments) {
ReportMessageAt(scanner().location(), "too_many_parameters",
Vector<const char*>::empty());
*ok = false;
diff --git a/src/parser.h b/src/parser.h
index 93fd1b8..e36a9b3 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -449,11 +449,6 @@ class Parser {
Vector<Handle<String> > args);
private:
- // Limit on number of function parameters is chosen arbitrarily.
- // Code::Flags uses only the low 17 bits of num-parameters to
- // construct a hashable id, so if more than 2^17 are allowed, this
- // should be checked.
- static const int kMaxNumFunctionParameters = 32766;
static const int kMaxNumFunctionLocals = 131071; // 2^17-1
enum Mode {
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 4119147..8490c7e 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -617,7 +617,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
Handle<Code> code =
compiler.CompileCallConstant(object, holder, function, name, check);
code->set_check_type(check);
- ASSERT_EQ(flags, code->flags());
+ ASSERT(flags == code->flags());
PROFILE(isolate_,
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -655,7 +655,7 @@ Handle<Code> StubCache::ComputeCallField(int argc,
Handle<Code> code =
compiler.CompileCallField(Handle<JSObject>::cast(object),
holder, index, name);
- ASSERT_EQ(flags, code->flags());
+ ASSERT(flags == code->flags());
PROFILE(isolate_,
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -692,7 +692,7 @@ Handle<Code> StubCache::ComputeCallInterceptor(int argc,
Handle<Code> code =
compiler.CompileCallInterceptor(Handle<JSObject>::cast(object),
holder, name);
- ASSERT_EQ(flags, code->flags());
+ ASSERT(flags == code->flags());
PROFILE(isolate(),
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
@@ -721,7 +721,7 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc,
CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
Handle<Code> code =
compiler.CompileCallGlobal(receiver, holder, cell, function, name);
- ASSERT_EQ(flags, code->flags());
+ ASSERT(flags == code->flags());
PROFILE(isolate(),
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
--
1.8.1.4

View file

@ -0,0 +1,13 @@
diff -up v8-3.14.5.10/src/arm/lithium-codegen-arm.cc.cve20143152 v8-3.14.5.10/src/arm/lithium-codegen-arm.cc
--- v8-3.14.5.10/src/arm/lithium-codegen-arm.cc.cve20143152 2015-04-23 14:51:20.095648219 -0400
+++ v8-3.14.5.10/src/arm/lithium-codegen-arm.cc 2015-04-23 14:53:28.834149299 -0400
@@ -3034,7 +3034,8 @@ MemOperand LCodeGen::PrepareKeyedOperand
return MemOperand(base, scratch0(), LSL, shift_size);
} else {
ASSERT_EQ(-1, shift_size);
- return MemOperand(base, scratch0(), LSR, 1);
+ // key can be negative, so using ASR here.
+ return MemOperand(base, scratch0(), ASR, 1);
}
}

846
v8-314.spec Normal file
View file

@ -0,0 +1,846 @@
# Hi Googlers! If you're looking in here for patches, nifty.
# You (and everyone else) are welcome to use any of my Chromium spec files and
# patches under the terms of the GPLv2 or later.
# You (and everyone else) are welcome to use any of my V8-specific spec files
# and patches under the terms of the BSD license.
# You (and everyone else) may NOT use my spec files or patches under any other
# terms.
# I hate to be a party-pooper here, but I really don't want to help Google
# make a proprietary browser. There are enough of those already.
# All copyrightable work in these spec files and patches is Copyright 2011
# Tom Callaway <spot@fedoraproject.org>
# For the 1.2 branch, we use 0s here
# For 1.3+, we use the three digit versions
# Hey, now there are four digits. What do they mean? Popsicle.
%global somajor 3
%global sominor 14
%global sobuild 5
%global sotiny 10
%global sover %{somajor}.%{sominor}.%{sobuild}
%global truename v8
# You don't really want to turn this on, because the "v8" package has this, and we'd
# conflict for no good reason.
%global with_python 0
Name: %{truename}-314
Version: %{somajor}.%{sominor}.%{sobuild}.%{sotiny}
Release: 17%{?dist}
Summary: JavaScript Engine
License: BSD
URL: https://developers.google.com/v8/
# Once found at http://commondatastorage.googleapis.com/chromium-browser-official/
# Now, we're the canonical source for the tarball. :/
Source0: v8-%{version}.tar.bz2
ExclusiveArch: %{ix86} x86_64 %{arm} mips mipsel ppc ppc64
BuildRequires: scons, readline-devel, libicu-devel
BuildRequires: valgrind-devel
BuildRequires: gcc, gcc-c++
#backport fix for CVE-2013-2634 (RHBZ#924495)
Patch1: v8-3.14.5.8-CVE-2013-2634.patch
#backport fix for CVE-2013-2882 (RHBZ#991116)
Patch2: v8-3.14.5.10-CVE-2013-2882.patch
#backport fix for CVE-2013-6640 (RHBZ#1039889)
Patch3: v8-3.14.5.10-CVE-2013-6640.patch
#backport fix for enumeration for objects with lots of properties
# https://codereview.chromium.org/11362182
Patch4: v8-3.14.5.10-enumeration.patch
#backport fix for CVE-2013-6640 (RHBZ#1059070)
Patch5: v8-3.14.5.10-CVE-2013-6650.patch
#backport only applicable fix for CVE-2014-1704 (RHBZ#1077136)
#the other two patches don't affect this version of v8
Patch6: v8-3.14.5.10-CVE-2014-1704-1.patch
# use clock_gettime() instead of gettimeofday(), which increases performance
# dramatically on virtual machines
# https://github.com/joyent/node/commit/f9ced08de30c37838756e8227bd091f80ad9cafa
# see above link or head of patch for complete rationale
Patch7: v8-3.14.5.10-use-clock_gettime.patch
# fix corner case in x64 compare stubs
# fixes bug resulting in an incorrect result when comparing certain integers
# (e.g. 2147483647 > -2147483648 is false instead of true)
# https://code.google.com/p/v8/issues/detail?id=2416
# https://github.com/joyent/node/issues/7528
Patch8: v8-3.14.5.10-x64-compare-stubs.patch
# backport security fix for memory corruption/stack overflow (RHBZ#1125464)
# https://groups.google.com/d/msg/nodejs/-siJEObdp10/2xcqqmTHiEMJ
# https://github.com/joyent/node/commit/530af9cb8e700e7596b3ec812bad123c9fa06356
Patch9: v8-3.14.5.10-mem-corruption-stack-overflow.patch
# backport bugfix for x64 MathMinMax:
# Fix x64 MathMinMax for negative untagged int32 arguments.
# An untagged int32 has zeros in the upper half even if it is negative.
# Using cmpq to compare such numbers will incorrectly ignore the sign.
# https://github.com/joyent/node/commit/3530fa9cd09f8db8101c4649cab03bcdf760c434
Patch10: v8-3.14.5.10-x64-MathMinMax.patch
# backport bugfix that eliminates unused-local-typedefs warning
# https://github.com/joyent/node/commit/53b4accb6e5747b156be91a2b90f42607e33a7cc
Patch11: v8-3.14.5.10-unused-local-typedefs.patch
# backport security fix: Fix Hydrogen bounds check elimination
# resolves CVE-2013-6668 (RHBZ#1086120)
# https://github.com/joyent/node/commit/fd80a31e0697d6317ce8c2d289575399f4e06d21
Patch12: v8-3.14.5.10-CVE-2013-6668.patch
# backport fix to segfault caused by the above patch
# https://github.com/joyent/node/commit/3122e0eae64c5ab494b29d0a9cadef902d93f1f9
Patch13: v8-3.14.5.10-CVE-2013-6668-segfault.patch
# Use system valgrind header
# https://bugzilla.redhat.com/show_bug.cgi?id=1141483
Patch14: v8-3.14.5.10-system-valgrind.patch
# Fix issues with abort on uncaught exception
# https://github.com/joyent/node/pull/8666
# https://github.com/joyent/node/issues/8631
# https://github.com/joyent/node/issues/8630
Patch15: v8-3.14.5.10-abort-uncaught-exception.patch
# Fix unhandled ReferenceError in debug-debugger.js
# https://github.com/joyent/node/commit/0ff51c6e063e3eea9e4d9ea68edc82d935626fc7
# https://codereview.chromium.org/741683002
Patch16: v8-3.14.5.10-unhandled-ReferenceError.patch
# Don't busy loop in CPU profiler thread
# https://github.com/joyent/node/pull/8789
Patch17: v8-3.14.5.10-busy-loop.patch
# Log V8 version in profiler log file
# (needed for compatibility with profiler tools)
# https://github.com/joyent/node/pull/9043
# https://codereview.chromium.org/806143002
Patch18: v8-3.14.5.10-profiler-log.patch
# Fix CVE in ARM code
# https://bugzilla.redhat.com/show_bug.cgi?id=1101057
# https://codereview.chromium.org/219473002
Patch19: v8-3.4.14-CVE-2014-3152.patch
# Add REPLACE_INVALID_UTF8 handling that nodejs needs
Patch20: v8-3.14.5.10-REPLACE_INVALID_UTF8.patch
# mips support (from debian)
Patch21: 0002_mips.patch
Patch22: 0002_mips_r15102_backport.patch
Patch23: 0002_mips_r19121_backport.patch
# Forced whole instruction cache flushing on Loongson (from debian)
Patch24: 0012_loongson_force_cache_flush.patch
# ppc/ppc64 support (from Ubuntu, who got it from IBM)
# Rediffed from 0099_powerpc_support.patch
Patch25: v8-powerpc-support.patch
# Fix for CVE-2016-1669 (thanks to bhoordhuis)
Patch26: v8-3.14.5.10-CVE-2016-1669.patch
# Report builtins by name
# https://github.com/nodejs/node/commit/5a60e0d904c38c2bdb04785203b1b784967c870d
Patch27: v8-3.14.5.10-report-builtins-by-name.patch
# Fix compile with gcc7
# (thanks to Ben Noordhuis)
Patch28: v8-3.14.5.10-gcc7.patch
# MOAR PPC
Patch29: v8-powerpc-support-SConstruct.patch
# GCC8 HAPPY FUN TIME
Patch30: v8-3.14.5.10-gcc8.patch
# SCONS3 UNHAPPY TIME :(
Patch31: v8-3.14.5.10-scons3.patch
%description
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used
in Google Chrome, the open source browser from Google. V8 implements ECMAScript
as specified in ECMA-262, 3rd edition. This is version 3.14, which is no longer
maintained by Google, but was adopted by a lot of other software.
%package devel
Summary: Development headers and libraries for v8
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development headers and libraries for v8 3.14.
%if 0%{?with_python}
%package python
Summary: Python libraries from v8
Requires: %{name}%{?_isa} = %{version}-%{release}
%description python
Python libraries from v8.
%endif
%prep
%setup -q -n %{truename}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1 -b .system-valgrind
%patch15 -p1 -b .abort-uncaught-exception
%patch16 -p1 -b .unhandled-ReferenceError
%patch17 -p1 -b .busy-loop
%patch18 -p1 -b .profiler-log
%patch19 -p1 -b .cve20143152
%patch20 -p1 -b .riu
%patch21 -p1 -b .mips
%patch22 -p1 -b .r15102
%patch23 -p1 -b .r19121
%patch24 -p1 -b .loongson
%patch25 -p1 -b .ppc
%patch26 -p1 -b .CVE-2016-1669
%patch27 -p1 -b .builtinname
%patch28 -p1 -b .gcc7
%patch29 -p1 -b .ppc-harder
%patch30 -p1 -b .gcc8
%patch31 -p1 -b .scons3
# Do not need this lying about.
rm -rf src/third_party/valgrind
#Patch7 needs -lrt on glibc < 2.17 (RHEL <= 6)
%if (0%{?rhel} > 6 || 0%{?fedora} > 18)
%global lrt %{nil}
%else
%global lrt -lrt
%endif
# -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS %{lrt} -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable -Wno-error=cast-function-type -Wno-error=class-memaccess -fno-delete-null-pointer-checks -Wno-error=array-bounds\'| sed "s/ /',/g" | sed "s/',/', '/g"`
sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
# clear spurious executable bits
find . \( -name \*.cc -o -name \*.h -o -name \*.py \) -a -executable \
|while read FILE ; do
echo $FILE
chmod -x $FILE
done
%build
mkdir -p obj/release/
export GCC_VERSION="44"
# SCons is going away, but for now build with
# I_know_I_should_build_with_GYP=yes
scons library=shared snapshots=on \
%ifarch x86_64
arch=x64 \
%endif
%ifarch ppc64
arch=ppc64 \
%endif
%ifarch ppc
arch=ppc \
%endif
%ifarch armv7hl armv7hnl
armeabi=hard \
%endif
%ifarch armv5tel armv6l armv7l
armeabi=soft \
%endif
visibility=default \
env=CCFLAGS:"-fPIC" \
I_know_I_should_build_with_GYP=yes
%if 0%{?fedora} >= 16
export ICU_LINK_FLAGS=`pkg-config --libs-only-l icu-i18n`
%else
export ICU_LINK_FLAGS=`pkg-config --libs-only-l icu`
%endif
# When will people learn to create versioned shared libraries by default?
# first, lets get rid of the old .so file
rm -rf libv8.so libv8preparser.so
# Now, lets make it right.
g++ $RPM_OPT_FLAGS -fPIC -o libv8preparser.so.%{sover} -shared -Wl,-soname,libv8preparser.so.%{somajor} \
obj/release/allocation.os \
obj/release/bignum.os \
obj/release/bignum-dtoa.os \
obj/release/cached-powers.os \
obj/release/diy-fp.os \
obj/release/dtoa.os \
obj/release/fast-dtoa.os \
obj/release/fixed-dtoa.os \
obj/release/preparse-data.os \
obj/release/preparser-api.os \
obj/release/preparser.os \
obj/release/scanner.os \
obj/release/strtod.os \
obj/release/token.os \
obj/release/unicode.os \
obj/release/utils.os
# "obj/release/preparser-api.os" should not be included in the libv8.so file.
export RELEASE_BUILD_OBJS=`echo obj/release/*.os | sed 's|obj/release/preparser-api.os||g'`
%ifarch %{arm}
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/arm/*.os $ICU_LINK_FLAGS
%endif
%ifarch %{ix86}
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/ia32/*.os $ICU_LINK_FLAGS
%endif
%ifarch x86_64
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/x64/*.os $ICU_LINK_FLAGS
%endif
%ifarch mips
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/mips/*.os $ICU_LINK_FLAGS
%endif
%ifarch mipsel
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/mipsel/*.os $ICU_LINK_FLAGS
%endif
%ifarch ppc ppc64
g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/ppc/*.os $ICU_LINK_FLAGS
%endif
# We need to do this so d8 can link against it.
ln -sf libv8.so.%{sover} libv8.so
ln -sf libv8preparser.so.%{sover} libv8preparser.so
# This will fail to link d8 because it doesn't use the icu libs.
# Don't build d8 shared. Stupid Google. Hate.
# SCons is going away, but for now build with
# I_know_I_should_build_with_GYP=yes
scons d8 \
I_know_I_should_build_with_GYP=yes \
%ifarch x86_64
arch=x64 \
%endif
%ifarch armv7hl armv7hnl
armeabi=hard \
%endif
%ifarch armv5tel armv6l armv7l
armeabi=soft \
%endif
%ifarch ppc64
arch=ppc64 \
%endif
%ifarch ppc
arch=ppc \
%endif
snapshots=on console=readline visibility=default || :
# library=shared snapshots=on console=readline visibility=default || :
# Sigh. I f*****g hate scons.
# But gyp is worse.
# rm -rf d8
# g++ $RPM_OPT_FLAGS -o d8 obj/release/d8.os -lreadline -lpthread -L. -lv8 $ICU_LINK_FLAGS
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_includedir}/v8-3.14/
mkdir -p %{buildroot}%{_libdir}
install -p include/*.h %{buildroot}%{_includedir}/v8-3.14/
install -p libv8.so.%{sover} %{buildroot}%{_libdir}
install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
install -p -m0755 d8 %{buildroot}%{_bindir}/d8-314
pushd %{buildroot}%{_libdir}
ln -sf libv8.so.%{sover} libv8.so
ln -sf libv8.so.%{sover} libv8.so.%{somajor}
ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
ln -sf libv8preparser.so.%{sover} libv8preparser.so
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor}
popd
chmod -x %{buildroot}%{_includedir}/v8-3.14/v8*.h
mkdir -p %{buildroot}%{_includedir}/v8-3.14/v8/extensions/
install -p src/extensions/*.h %{buildroot}%{_includedir}/v8-3.14/v8/extensions/
chmod -x %{buildroot}%{_includedir}/v8-3.14/v8/extensions/*.h
%if 0%{?with_python}
# install Python JS minifier scripts for nodejs
install -d %{buildroot}%{python_sitelib}
sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/jsmin.py
sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/js2c.py
install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/
install -p -m0744 tools/js2c.py %{buildroot}%{python_sitelib}/
chmod -R -x %{buildroot}%{python_sitelib}/*.py*
%endif
%ldconfig_scriptlets
%files
%doc AUTHORS ChangeLog
%license LICENSE
%{_bindir}/d8-314
%{_libdir}/*.so.*
%files devel
%{_includedir}/v8-3.14/
%{_libdir}/*.so
%if 0%{?with_python}
%files python
%{python2_sitelib}/j*.py*
%endif
%changelog
* Wed Mar 20 2019 Lubomir Rintel <lkundrak@v3.sk> - 3.14.5.10-17
- Fix build with newer SConstruct & GCC
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.14.5.10-16
- Rebuild for readline 8.0
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 23 2019 Pete Walter <pwalter@fedoraproject.org> - 3.14.5.10-14
- Rebuild for ICU 63
* Tue Jul 24 2018 Tom Callaway <spot@fedoraproject.org> - 3.14.5.10-13
- add BuildRequires: gcc, gcc-c++
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Pete Walter <pwalter@fedoraproject.org> - 3.14.5.10-11
- Rebuild for ICU 62
* Fri May 18 2018 Tom Callaway <spot@fedoraproject.org> - 3.14.5.10-10
- fix build of this dinosaur with gcc8, mostly by telling the compiler to ignore all the nasty code errors
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Nov 30 2017 Pete Walter <pwalter@fedoraproject.org> - 3.14.5.10-8
- Rebuild for ICU 60.1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Feb 28 2017 Tom Callaway <spot@fedoraproject.org> - 3.14.5.10-5
- fix FTBFS (thanks to Ben Noordhuis)
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.5.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Jul 25 2016 Tom Callaway <spot@fedoraproject.org> - 3.14.5.10-3
- drop epoch (new package, doesn't need it)
* Wed Jul 6 2016 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-2
- apply fixes from nodejs for CVE-2016-1669 and reporting builtins by name
* Tue Jun 7 2016 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-1
- make into v8-314 package
* Mon Jun 06 2016 Vít Ondruch <vondruch@redhat.com> - 1:3.14.5.10-24
- Use "-fno-delete-null-pointer-checks" to workaround GCC 6.x compatibility
(rhbz#1331480, rhbz#1331458).
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.14.5.10-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Oct 28 2015 David Tardon <dtardon@redhat.com> - 1:3.14.5.10-22
- rebuild for ICU 56.1
* Mon Sep 21 2015 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-21
- add REPLACE_INVALID_UTF8 code needed for nodejs
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.14.5.10-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Jun 8 2015 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-19
- split off python subpackage (bz 959145)
* Thu Apr 23 2015 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-18
- backport security fix for ARM - CVE-2014-3152
* Thu Feb 19 2015 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-17
- backports for nodejs 0.10.36
* Mon Jan 26 2015 David Tardon <dtardon@redhat.com> - 1:3.14.5.10-16
- rebuild for ICU 54.1
* Tue Dec 2 2014 Tom Callaway <spot@fedoraproject.org> - 1:3.14.5.10-15
- use system valgrind header (bz1141483)
* Wed Sep 17 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-14
- backport bugfix that eliminates unused-local-typedefs warning
- backport security fix: Fix Hydrogen bounds check elimination (CVE-2013-6668; RHBZ#1086120)
- backport fix to segfault caused by the above patch
* Tue Aug 26 2014 David Tardon <dtardon@redhat.com> - 1:3.14.5.10-13
- rebuild for ICU 53.1
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.14.5.10-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Thu Jul 31 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-11
- backport security fix for memory corruption and stack overflow (RHBZ#1125464)
https://groups.google.com/d/msg/nodejs/-siJEObdp10/2xcqqmTHiEMJ
- backport bug fix for x64 MathMinMax for negative untagged int32 arguments.
https://github.com/joyent/node/commit/3530fa9cd09f8db8101c4649cab03bcdf760c434
* Thu Jun 19 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-10
- fix corner case in integer comparisons (v8 bug#2416; nodejs bug#7528)
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.14.5.10-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat May 03 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-8
- use clock_gettime() instead of gettimeofday(), which increases V8 performance
dramatically on virtual machines
* Tue Mar 18 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-7
- backport fix for unsigned integer arithmetic (RHBZ#1077136; CVE-2014-1704)
* Mon Feb 24 2014 Tomas Hrcka <thrcka@redhat.com> - 1:3.14.5.10-6
- Backport fix for incorrect handling of popular pages (RHBZ#1059070; CVE-2013-6640)
* Fri Feb 14 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-5
- rebuild for icu-52
* Mon Jan 27 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-4
- backport fix for enumeration for objects with lots of properties
* Fri Dec 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-3
- backport fix for out-of-bounds read DoS (RHBZ#1039889; CVE-2013-6640)
* Fri Aug 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-2
- backport fix for remote DoS or unspecified other impact via type confusion
(RHBZ#991116; CVE-2013-2882)
* Wed May 29 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.10-1
- new upstream release 3.14.5.10
* Mon May 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1:3.14.5.8-2
- Fix ownership of include directory (#958729)
* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.14.5.8-1
- new upstream release 3.14.5.8
- backport security fix for remote DoS via crafted javascript (RHBZ#924495; CVE-2013-2632)
* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 1:3.14.5.7-3
- Update to v8 3.14.5.7 for Node.js 0.10.0
* Sat Jan 26 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.13.7.5-2
- rebuild for icu-50
- ignore new GCC 4.8 warning
* Tue Dec 4 2012 Tom Callaway <spot@fedoraproject.org> - 1:3.13.7.5-1
- update to 3.13.7.5 (needed for chromium 23)
- Resolves multiple security issues (CVE-2012-5120, CVE-2012-5128)
- d8 is now using a static libv8, resolves bz 881973)
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.10.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jul 6 2012 Tom Callaway <spot@fedoraproject.org> 1:3.10.8-1
- update to 3.10.8 (chromium 20)
* Tue Jun 12 2012 Tom Callaway <spot@fedoraproject.org> 1:3.9.24-1
- update to 3.9.24 (chromium 19)
* Mon Apr 23 2012 Thomas Spura <tomspur@fedoraproject.org> 1:3.7.12.6
- rebuild for icu-49
* Fri Mar 30 2012 Dennis Gilmore <dennis@ausil.us> 1:3.7.12-5
- make sure the right arm abi is used in the second call of scons
* Thu Mar 29 2012 Dennis Gilmore <dennis@ausil.us> 1:3.7.12-4
- use correct arm macros
- use the correct abis for hard and soft float
* Tue Mar 20 2012 Tom Callaway <spot@fedoraproject.org> 3.7.12-3
- merge changes from Fedora spec file, sync, add epoch
* Fri Feb 17 2012 Tom Callaway <spot@fedoraproject.org> 3.7.12-2
- add -Wno-error=strict-overflow for gcc 4.7 (hack, hack, hack)
* Mon Feb 13 2012 Tom Callaway <spot@fedoraproject.org> 3.7.12-1
- update to 3.7.12
* Thu Nov 3 2011 Tom Callaway <spot@fedoraproject.org> 3.5.10-1
- update to 3.5.10
* Mon Sep 26 2011 Tom Callaway <spot@fedoraproject.org> 3.4.14-2
- final 3.4.14 tag
- include JavaScript minifier scripts in -devel
* Fri Jun 10 2011 Tom Callaway <spot@fedoraproject.org> 3.2.10-1
- tag 3.2.10
* Thu Apr 28 2011 Tom Callaway <spot@fedoraproject.org> 3.1.8-1
- "stable" v8 match for "stable" chromium (tag 3.1.8)
* Tue Feb 22 2011 Tom Callaway <spot@fedoraproject.org> 3.1.5-1.20110222svn6902
- update to 3.1.5
- enable experimental i18n icu stuff for chromium
* Tue Jan 11 2011 Tom Callaway <spot@fedoraproject.org> 3.0.7-1.20110111svn6276
- update to 3.0.7
* Tue Dec 14 2010 Tom "spot" Callaway <tcallawa@redhat.com> 3.0.0-2.20101209svn5957
- fix sloppy code where NULL is used
* Thu Dec 9 2010 Tom "spot" Callaway <tcallawa@redhat.com> 3.0.0-1.20101209svn5957
- update to 3.0.0
* Fri Oct 22 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.5.1-1.20101022svn5692
- update to 2.5.1
- fix another fwrite with no return checking case
* Thu Oct 14 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.5.0-1.20101014svn5625
- update to 2.5.0
* Mon Oct 4 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.4.8-1.20101004svn5585
- update to 2.4.8
* Tue Sep 14 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.4.3-1.20100914svn5450
- update to 2.4.3
* Tue Aug 31 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.11-1.20100831svn5385
- update to svn5385
* Fri Aug 27 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.11-1.20100827svn5365
- update to 2.3.11, svn5365
* Tue Aug 24 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.10-1.20100824svn5332
- update to 2.3.10, svn5332
* Wed Aug 18 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.9-1.20100819svn5308
- update to 2.3.9, svn5308
* Wed Aug 11 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.7-1.20100812svn5251
- update to svn5251
* Wed Aug 11 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.7-1.20100811svn5248
- update to 2.3.7, svn5248
* Tue Aug 10 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.6-1.20100809svn5217
- update to 2.3.6, svn5217
* Fri Aug 6 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.5-1.20100806svn5198
- update to 2.3.5, svn5198
* Mon Jul 26 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.3-1.20100726svn5134
- update to 2.3.3, svn5134
* Fri Jul 16 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.3.0-1.20100716svn5088
- update to 2.3.0, svn5088
* Tue Jul 6 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.22-1.20100706svn5023
- update to 2.2.22, svn5023
* Fri Jul 2 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.21-1.20100702svn5010
- update to svn5010
* Wed Jun 30 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.21-1.20100630svn4993
- update to 2.2.21, svn4993
- include checkout script
* Thu Jun 3 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.14-1.20100603svn4792
- update to 2.2.14, svn4792
* Tue Jun 1 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.13-1.20100601svn4772
- update to 2.2.13, svn4772
* Thu May 27 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.12-1.20100527svn4747
- update to 2.2.12, svn4747
* Tue May 25 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.11-1.20100525svn4718
- update to 2.2.11, svn4718
* Thu May 20 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-1.20100520svn4684
- update to svn4684
* Mon May 17 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-1.20100517svn4664
- update to 2.2.10, svn4664
* Thu May 13 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.9-1.20100513svn4653
- update to svn4653
* Mon May 10 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.9-1.20100510svn4636
- update to 2.2.9, svn4636
* Tue May 4 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.7-1.20100504svn4581
- update to 2.2.7, svn4581
* Mon Apr 19 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.3-1.20100419svn4440
- update to 2.2.3, svn4440
* Tue Apr 13 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.2-1.20100413svn4397
- update to 2.2.2, svn4397
* Thu Apr 8 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.1-1.20100408svn4359
- update to 2.2.1, svn4359
* Mon Mar 29 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.0-1.20100329svn4309
- update to 2.2.0, svn4309
* Thu Mar 25 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.1.8-1.20100325svn4273
- update to 2.1.8, svn4273
* Mon Mar 22 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.1.5-1.20100322svn4204
- update to 2.1.5, svn4204
* Mon Mar 15 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.1.4-1.20100315svn4129
- update to 2.1.4, svn4129
* Wed Mar 10 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.1.0-1.20100310svn4088
- update to 2.1.3, svn4088
* Thu Feb 18 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.1.0-1.20100218svn3902
- update to 2.1.0, svn3902
* Fri Jan 22 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.6-1.20100122svn3681
- update to 2.0.6, svn3681
* Tue Dec 29 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.5-1.20091229svn3528
- svn3528
* Mon Dec 21 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.5-1.20091221svn3511
- update to 2.0.5, svn3511
* Wed Dec 9 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.3-1.20091209svn3443
- update to 2.0.3, svn3443
* Tue Nov 24 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.2-1.20091124svn3353
- update to 2.0.2, svn3353
* Wed Nov 18 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.0.0-1.20091118svn3334
- update to 2.0.0, svn3334
* Tue Oct 27 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.16-1.20091027svn3152
- update to 1.3.16, svn3152
* Tue Oct 13 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.15-1.20091013svn3058
- update to svn3058
* Thu Oct 8 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.15-1.20091008svn3036
- update to 1.3.15, svn3036
* Tue Sep 29 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.13-1.20090929svn2985
- update to svn2985
- drop unused parameter patch, figured out how to work around it with optflag mangling
- have I mentioned lately that scons is garbage?
* Mon Sep 28 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.13-1.20090928svn2980
- update to 1.3.13, svn2980
* Wed Sep 16 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.11-1.20090916svn2903
- update to 1.3.11, svn2903
* Wed Sep 9 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.9-1.20090909svn2862
- update to 1.3.9, svn2862
* Thu Aug 27 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.8-1.20090827svn2777
- update to 1.3.8, svn2777
* Mon Aug 24 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.6-1.20090824svn2747
- update to 1.3.6, svn2747
* Tue Aug 18 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.4-1.20090818svn2708
- update to svn2708, build and package d8
* Fri Aug 14 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.4-1.20090814svn2692
- update to 1.3.4, svn2692
* Wed Aug 12 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.3-1.20090812svn2669
- update to 1.3.3, svn2669
* Mon Aug 10 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.2-1.20090810svn2658
- update to svn2658
* Fri Aug 7 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.2-1.20090807svn2653
- update to svn2653
* Wed Aug 5 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.2-1.20090805svn2628
- update to 1.3.2, svn2628
* Mon Aug 3 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.1-1.20090803svn2607
- update to svn2607
* Fri Jul 31 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.1-1.20090731svn2602
- update to svn2602
* Thu Jul 30 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.1-1.20090730svn2592
- update to 1.3.1, svn 2592
* Mon Jul 27 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.3.0-1.20090727svn2543
- update to 1.3.0, svn 2543
* Fri Jul 24 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.14-1.20090724svn2534
- update to svn2534
* Mon Jul 20 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.14-1.20090720svn2510
- update to svn2510
* Thu Jul 16 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.14-1.20090716svn2488
- update to svn2488
* Wed Jul 15 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.14-1.20090715svn2477
- update to 1.2.14, svn2477
* Mon Jul 13 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.13-1.20090713svn2434
- update to svn2434
* Sat Jul 11 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.13-1.20090711svn2430
- update to 1.2.13, svn2430
* Wed Jul 8 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.12-1.20090708svn2391
- update to 1.2.12, svn2391
* Sat Jul 4 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.11-1.20090704svn2356
- update to 1.2.11, svn2356
* Fri Jun 26 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.9-1.20090626svn2284
- update to svn2284
* Wed Jun 24 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.9-1.20090624svn2262
- update to 1.2.9, svn2262
* Thu Jun 18 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.7-2.20090618svn2219
- fix unused-parameter patch
* Thu Jun 18 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.7-1.20090618svn2219
- update to 1.2.8, svn2219
* Mon Jun 8 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.7-2.20090608svn2123
- fix gcc44 compile for Fedora 11
* Mon Jun 8 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.7-1.20090608svn2123
- update to 1.2.7, svn2123
* Thu May 28 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.2.5-1.20090528svn2072
- update to newer svn checkout
* Sun Feb 22 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.0.1-1.20090222svn1332
- update to newer svn checkout
* Sun Sep 14 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2-2.20080914svn300
- make a versioned shared library properly
* Sun Sep 14 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2-1.20080914svn300
- Initial package for Fedora

File diff suppressed because it is too large Load diff

57926
v8-powerpc-support.patch Normal file

File diff suppressed because it is too large Load diff