- update node to 0.4.4 with various patches from chrome to make this build
This commit is contained in:
parent
96efc8eba7
commit
c5d1b1f208
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.7 2011/03/02 06:29:44 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.8 2011/03/30 19:54:29 jasper Exp $
|
||||
|
||||
# XXX:
|
||||
# - Needs __ARM_NR_cacheflush (or the like) to work on arm-based ports.
|
||||
@ -8,7 +8,7 @@ ONLY_FOR_ARCHS= amd64 i386
|
||||
|
||||
COMMENT= V8 JavaScript for clients and servers
|
||||
|
||||
DISTNAME= node-v0.2.6
|
||||
DISTNAME= node-v0.4.4
|
||||
PKGNAME= ${DISTNAME:S/v//g}
|
||||
|
||||
CATEGORIES= www devel
|
||||
@ -27,7 +27,7 @@ MODULES= lang/python
|
||||
|
||||
VMEM_WARNING= Yes
|
||||
|
||||
WANTLIB += c crypto execinfo ev kvm m pthread ssl stdc++ z
|
||||
WANTLIB += c crypto execinfo ev kvm m pthread ssl stdc++ util
|
||||
|
||||
LIB_DEPENDS= devel/libev \
|
||||
devel/libexecinfo
|
||||
@ -37,7 +37,7 @@ CONFIGURE_ARGS+= --shared-libev-libpath="${LOCALBASE}/lib" \
|
||||
--shared-libev-include="${LOCALBASE}/include"
|
||||
|
||||
MODPY_ADJ_FILES=wscript \
|
||||
bin/node-waf \
|
||||
tools/node-waf \
|
||||
tools/waf-light
|
||||
|
||||
NO_REGRESS= Yes
|
||||
@ -46,10 +46,6 @@ SUBST_VARS+= CFLAGS
|
||||
|
||||
MAKE_ENV+= CXX=c++ CCFLAGS+="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
|
||||
|
||||
post-extract:
|
||||
rm -f ${WRKSRC}/deps/v8/src/SConscript.orig \
|
||||
${WRKSRC}/deps/v8/src/platform.h.orig
|
||||
|
||||
pre-configure:
|
||||
${SUBST_CMD} ${WRKSRC}/wscript \
|
||||
${WRKSRC}/tools/wafadmin/Tools/python.py
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (node-v0.2.6.tar.gz) = scUM60O+4bIhviELe8eiFg==
|
||||
RMD160 (node-v0.2.6.tar.gz) = exdTJ5vy9vx8TS7KIBQI6F052qk=
|
||||
SHA1 (node-v0.2.6.tar.gz) = bHeRUoPrgZFMw57OB7Qd6bXWDDk=
|
||||
SHA256 (node-v0.2.6.tar.gz) = 6X/pyB/0tWmumg1G5koFcqHxcSk1c6W1KQvMOZahlwE=
|
||||
SIZE (node-v0.2.6.tar.gz) = 4010320
|
||||
MD5 (node-v0.4.4.tar.gz) = ds2U7JtyEpbtOQgbhDnvpQ==
|
||||
RMD160 (node-v0.4.4.tar.gz) = T0alI3B8S5sr9K8oyybUQeeY8xs=
|
||||
SHA1 (node-v0.4.4.tar.gz) = nsZBfRT9p8QRXnigWQe0r+LwSGs=
|
||||
SHA256 (node-v0.4.4.tar.gz) = 6kQwkJYBNAyz6K2xVWn6z+yk4dWRKfGTIlRTW7S/Phc=
|
||||
SIZE (node-v0.4.4.tar.gz) = 4995935
|
||||
|
@ -1,10 +1,10 @@
|
||||
$OpenBSD: patch-deps_v8_SConstruct,v 1.1 2010/12/29 12:24:39 jasper Exp $
|
||||
$OpenBSD: patch-deps_v8_SConstruct,v 1.2 2011/03/30 19:54:29 jasper Exp $
|
||||
|
||||
Don't link with -lpthread but use -pthread instead.
|
||||
|
||||
--- deps/v8/SConstruct.orig Wed Dec 29 13:06:58 2010
|
||||
+++ deps/v8/SConstruct Wed Dec 29 13:07:25 2010
|
||||
@@ -361,7 +361,8 @@ MKSNAPSHOT_EXTRA_FLAGS = {
|
||||
--- deps/v8/SConstruct.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/SConstruct Sat Mar 26 14:32:08 2011
|
||||
@@ -369,7 +369,8 @@ MKSNAPSHOT_EXTRA_FLAGS = {
|
||||
'LINKFLAGS': ['-mt']
|
||||
},
|
||||
'os:openbsd': {
|
||||
|
132
www/node/patches/patch-deps_v8_src_platform-openbsd_cc
Normal file
132
www/node/patches/patch-deps_v8_src_platform-openbsd_cc
Normal file
@ -0,0 +1,132 @@
|
||||
$OpenBSD: patch-deps_v8_src_platform-openbsd_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/platform-openbsd.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/platform-openbsd.cc Wed Mar 30 21:21:02 2011
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
|
||||
+// Copyright 2006-2008 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:
|
||||
@@ -164,6 +164,7 @@ void* OS::Allocate(const size_t requested,
|
||||
|
||||
|
||||
void OS::Free(void* buf, const size_t length) {
|
||||
+ // TODO(1240712): munmap has a return value which is ignored here.
|
||||
int result = munmap(buf, length);
|
||||
USE(result);
|
||||
ASSERT(result == 0);
|
||||
@@ -197,13 +198,7 @@ void OS::Abort() {
|
||||
|
||||
|
||||
void OS::DebugBreak() {
|
||||
-#if (defined(__arm__) || defined(__thumb__))
|
||||
-# if defined(CAN_USE_ARMV5_INSTRUCTIONS)
|
||||
- asm("bkpt 0");
|
||||
-# endif
|
||||
-#else
|
||||
asm("int $3");
|
||||
-#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -309,8 +304,30 @@ void OS::SignalCodeMovingGC() {
|
||||
|
||||
|
||||
int OS::StackWalk(Vector<OS::StackFrame> frames) {
|
||||
- UNIMPLEMENTED();
|
||||
- return 1;
|
||||
+ int frames_size = frames.length();
|
||||
+ ScopedVector<void*> addresses(frames_size);
|
||||
+
|
||||
+ int frames_count = backtrace(addresses.start(), frames_size);
|
||||
+
|
||||
+ char** symbols = backtrace_symbols(addresses.start(), frames_count);
|
||||
+ if (symbols == NULL) {
|
||||
+ return kStackWalkError;
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < frames_count; i++) {
|
||||
+ frames[i].address = addresses[i];
|
||||
+ // Format a text representation of the frame based on the information
|
||||
+ // available.
|
||||
+ SNPrintF(MutableCStrVector(frames[i].text, kStackWalkMaxTextLen),
|
||||
+ "%s",
|
||||
+ symbols[i]);
|
||||
+ // Make sure line termination is in place.
|
||||
+ frames[i].text[kStackWalkMaxTextLen - 1] = '\0';
|
||||
+ }
|
||||
+
|
||||
+ free(symbols);
|
||||
+
|
||||
+ return frames_count;
|
||||
}
|
||||
|
||||
|
||||
@@ -502,6 +519,16 @@ class OpenBSDMutex : public Mutex {
|
||||
return result;
|
||||
}
|
||||
|
||||
+ virtual bool TryLock() {
|
||||
+ int result = pthread_mutex_trylock(&mutex_);
|
||||
+ // Return false if the lock is busy and locking failed.
|
||||
+ if (result == EBUSY) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ ASSERT(result == 0); // Verify no other errors.
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
private:
|
||||
pthread_mutex_t mutex_; // Pthread mutex for POSIX platforms.
|
||||
};
|
||||
@@ -571,18 +598,37 @@ Semaphore* OS::CreateSemaphore(int count) {
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
|
||||
static Sampler* active_sampler_ = NULL;
|
||||
+static pthread_t vm_tid_ = 0;
|
||||
|
||||
+typedef struct sigcontext ucontext_t;
|
||||
+
|
||||
static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
|
||||
USE(info);
|
||||
if (signal != SIGPROF) return;
|
||||
- if (active_sampler_ == NULL) return;
|
||||
+ if (active_sampler_ == NULL || !active_sampler_->IsActive()) return;
|
||||
+ if (vm_tid_ != pthread_self()) return;
|
||||
|
||||
- TickSample sample;
|
||||
+ TickSample sample_obj;
|
||||
+ TickSample* sample = CpuProfiler::TickSampleEvent();
|
||||
+ if (sample == NULL) sample = &sample_obj;
|
||||
|
||||
- // We always sample the VM state.
|
||||
- sample.state = VMState::current_state();
|
||||
+ // Extracting the sample from the context is extremely machine dependent.
|
||||
+ ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
|
||||
+ sample->state = Top::current_vm_state();
|
||||
|
||||
- active_sampler_->Tick(&sample);
|
||||
+#if V8_HOST_ARCH_IA32
|
||||
+ sample->pc = reinterpret_cast<Address>(ucontext->sc_eip);
|
||||
+ sample->sp = reinterpret_cast<Address>(ucontext->sc_esp);
|
||||
+ sample->fp = reinterpret_cast<Address>(ucontext->sc_ebp);
|
||||
+#elif V8_HOST_ARCH_X64
|
||||
+ sample->pc = reinterpret_cast<Address>(ucontext->sc_rip);
|
||||
+ sample->sp = reinterpret_cast<Address>(ucontext->sc_rsp);
|
||||
+ sample->fp = reinterpret_cast<Address>(ucontext->sc_rbp);
|
||||
+#else
|
||||
+ UNIMPLEMENTED();
|
||||
+#endif
|
||||
+ active_sampler_->SampleStack(sample);
|
||||
+ active_sampler_->Tick(sample);
|
||||
}
|
||||
|
||||
|
||||
@@ -616,6 +662,7 @@ void Sampler::Start() {
|
||||
// There can only be one active sampler at the time on POSIX
|
||||
// platforms.
|
||||
if (active_sampler_ != NULL) return;
|
||||
+ vm_tid_ = pthread_self();
|
||||
|
||||
// Request profiling signals.
|
||||
struct sigaction sa;
|
99
www/node/patches/patch-deps_v8_src_x64_code-stubs-x64_cc
Normal file
99
www/node/patches/patch-deps_v8_src_x64_code-stubs-x64_cc
Normal file
@ -0,0 +1,99 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_code-stubs-x64_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/code-stubs-x64.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/code-stubs-x64.cc Wed Mar 30 21:21:20 2011
|
||||
@@ -2244,11 +2244,14 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAss
|
||||
Label slow;
|
||||
__ JumpIfNotSmi(rdx, &slow);
|
||||
|
||||
- // Check if the calling frame is an arguments adaptor frame.
|
||||
+ // Check if the calling frame is an arguments adaptor frame. We look at the
|
||||
+ // context offset, and if the frame is not a regular one, then we find a
|
||||
+ // Smi instead of the context. We can't use SmiCompare here, because that
|
||||
+ // only works for comparing two smis.
|
||||
Label adaptor;
|
||||
__ movq(rbx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
||||
- __ SmiCompare(Operand(rbx, StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(rbx, StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(equal, &adaptor);
|
||||
|
||||
// Check index against formal parameters count limit passed in
|
||||
@@ -2303,8 +2306,8 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssem
|
||||
// Check if the calling frame is an arguments adaptor frame.
|
||||
Label adaptor_frame, try_allocate, runtime;
|
||||
__ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
||||
- __ SmiCompare(Operand(rdx, StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(rdx, StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(equal, &adaptor_frame);
|
||||
|
||||
// Get the length from the frame.
|
||||
@@ -4082,8 +4085,8 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
||||
// Look at the length of the result of adding the two strings.
|
||||
STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue / 2);
|
||||
__ SmiAdd(rbx, rbx, rcx);
|
||||
- // Use the runtime system when adding two one character strings, as it
|
||||
- // contains optimizations for this specific case using the symbol table.
|
||||
+ // Use the symbol table when adding two one character strings, as it
|
||||
+ // helps later optimizations to return a symbol here.
|
||||
__ SmiCompare(rbx, Smi::FromInt(2));
|
||||
__ j(not_equal, &longer_than_two);
|
||||
|
||||
@@ -4435,15 +4438,14 @@ void StringHelper::GenerateTwoCharacterSymbolTableProb
|
||||
FieldOperand(symbol_table, SymbolTable::kCapacityOffset));
|
||||
__ decl(mask);
|
||||
|
||||
- Register undefined = scratch4;
|
||||
- __ LoadRoot(undefined, Heap::kUndefinedValueRootIndex);
|
||||
+ Register map = scratch4;
|
||||
|
||||
// Registers
|
||||
// chars: two character string, char 1 in byte 0 and char 2 in byte 1.
|
||||
// hash: hash of two character string (32-bit int)
|
||||
// symbol_table: symbol table
|
||||
// mask: capacity mask (32-bit int)
|
||||
- // undefined: undefined value
|
||||
+ // map: -
|
||||
// scratch: -
|
||||
|
||||
// Perform a number of probes in the symbol table.
|
||||
@@ -4458,7 +4460,7 @@ void StringHelper::GenerateTwoCharacterSymbolTableProb
|
||||
}
|
||||
__ andl(scratch, mask);
|
||||
|
||||
- // Load the entry from the symble table.
|
||||
+ // Load the entry from the symbol table.
|
||||
Register candidate = scratch; // Scratch register contains candidate.
|
||||
STATIC_ASSERT(SymbolTable::kEntrySize == 1);
|
||||
__ movq(candidate,
|
||||
@@ -4468,9 +4470,17 @@ void StringHelper::GenerateTwoCharacterSymbolTableProb
|
||||
SymbolTable::kElementsStartOffset));
|
||||
|
||||
// If entry is undefined no string with this hash can be found.
|
||||
- __ cmpq(candidate, undefined);
|
||||
+ NearLabel is_string;
|
||||
+ __ CmpObjectType(candidate, ODDBALL_TYPE, map);
|
||||
+ __ j(not_equal, &is_string);
|
||||
+
|
||||
+ __ CompareRoot(candidate, Heap::kUndefinedValueRootIndex);
|
||||
__ j(equal, not_found);
|
||||
+ // Must be null (deleted entry).
|
||||
+ __ jmp(&next_probe[i]);
|
||||
|
||||
+ __ bind(&is_string);
|
||||
+
|
||||
// If length is not 2 the string is not a candidate.
|
||||
__ SmiCompare(FieldOperand(candidate, String::kLengthOffset),
|
||||
Smi::FromInt(2));
|
||||
@@ -4481,8 +4491,7 @@ void StringHelper::GenerateTwoCharacterSymbolTableProb
|
||||
Register temp = kScratchRegister;
|
||||
|
||||
// Check that the candidate is a non-external ascii string.
|
||||
- __ movq(temp, FieldOperand(candidate, HeapObject::kMapOffset));
|
||||
- __ movzxbl(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
|
||||
+ __ movzxbl(temp, FieldOperand(map, Map::kInstanceTypeOffset));
|
||||
__ JumpIfInstanceTypeIsNotSequentialAscii(
|
||||
temp, temp, &next_probe[i]);
|
||||
|
164
www/node/patches/patch-deps_v8_src_x64_codegen-x64_cc
Normal file
164
www/node/patches/patch-deps_v8_src_x64_codegen-x64_cc
Normal file
@ -0,0 +1,164 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_codegen-x64_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/codegen-x64.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/codegen-x64.cc Wed Mar 30 21:21:29 2011
|
||||
@@ -760,7 +760,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest
|
||||
__ AbortIfNotNumber(value.reg());
|
||||
}
|
||||
// Smi => false iff zero.
|
||||
- __ SmiCompare(value.reg(), Smi::FromInt(0));
|
||||
+ __ Cmp(value.reg(), Smi::FromInt(0));
|
||||
if (value.is_smi()) {
|
||||
value.Unuse();
|
||||
dest->Split(not_zero);
|
||||
@@ -788,7 +788,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest
|
||||
dest->false_target()->Branch(equal);
|
||||
|
||||
// Smi => false iff zero.
|
||||
- __ SmiCompare(value.reg(), Smi::FromInt(0));
|
||||
+ __ Cmp(value.reg(), Smi::FromInt(0));
|
||||
dest->false_target()->Branch(equal);
|
||||
Condition is_smi = masm_->CheckSmi(value.reg());
|
||||
dest->true_target()->Branch(is_smi);
|
||||
@@ -1030,7 +1030,7 @@ void CodeGenerator::GenericBinaryOperation(BinaryOpera
|
||||
true, overwrite_mode);
|
||||
} else {
|
||||
// Set the flags based on the operation, type and loop nesting level.
|
||||
- // Bit operations always assume they likely operate on Smis. Still only
|
||||
+ // Bit operations always assume they likely operate on smis. Still only
|
||||
// generate the inline Smi check code if this operation is part of a loop.
|
||||
// For all other operations only inline the Smi check code for likely smis
|
||||
// if the operation is part of a loop.
|
||||
@@ -2102,7 +2102,7 @@ void CodeGenerator::Comparison(AstNode* node,
|
||||
if (cc == equal) {
|
||||
Label comparison_done;
|
||||
__ SmiCompare(FieldOperand(left_side.reg(), String::kLengthOffset),
|
||||
- Smi::FromInt(1));
|
||||
+ Smi::FromInt(1));
|
||||
__ j(not_equal, &comparison_done);
|
||||
uint8_t char_value =
|
||||
static_cast<uint8_t>(String::cast(*right_val)->Get(0));
|
||||
@@ -2288,7 +2288,7 @@ void CodeGenerator::ConstantSmiComparison(Condition cc
|
||||
// CompareStub and the inline code both support all values of cc.
|
||||
}
|
||||
// Implement comparison against a constant Smi, inlining the case
|
||||
- // where both sides are Smis.
|
||||
+ // where both sides are smis.
|
||||
left_side->ToRegister();
|
||||
Register left_reg = left_side->reg();
|
||||
Smi* constant_smi = Smi::cast(*right_side->handle());
|
||||
@@ -2298,7 +2298,6 @@ void CodeGenerator::ConstantSmiComparison(Condition cc
|
||||
__ AbortIfNotSmi(left_reg);
|
||||
}
|
||||
// Test smi equality and comparison by signed int comparison.
|
||||
- // Both sides are smis, so we can use an Immediate.
|
||||
__ SmiCompare(left_reg, constant_smi);
|
||||
left_side->Unuse();
|
||||
right_side->Unuse();
|
||||
@@ -2308,7 +2307,7 @@ void CodeGenerator::ConstantSmiComparison(Condition cc
|
||||
JumpTarget is_smi;
|
||||
if (cc == equal) {
|
||||
// We can do the equality comparison before the smi check.
|
||||
- __ SmiCompare(left_reg, constant_smi);
|
||||
+ __ Cmp(left_reg, constant_smi);
|
||||
dest->true_target()->Branch(equal);
|
||||
Condition left_is_smi = masm_->CheckSmi(left_reg);
|
||||
dest->false_target()->Branch(left_is_smi);
|
||||
@@ -2569,8 +2568,8 @@ void CodeGenerator::CallApplyLazy(Expression* applican
|
||||
// adaptor frame below it.
|
||||
Label invoke, adapted;
|
||||
__ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
||||
- __ SmiCompare(Operand(rdx, StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(rdx, StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(equal, &adapted);
|
||||
|
||||
// No arguments adaptor frame. Copy fixed number of arguments.
|
||||
@@ -3851,7 +3850,7 @@ void CodeGenerator::VisitForInStatement(ForInStatement
|
||||
__ movq(rbx, rax);
|
||||
|
||||
// If the property has been removed while iterating, we just skip it.
|
||||
- __ SmiCompare(rbx, Smi::FromInt(0));
|
||||
+ __ Cmp(rbx, Smi::FromInt(0));
|
||||
node->continue_target()->Branch(equal);
|
||||
|
||||
end_del_check.Bind();
|
||||
@@ -6192,15 +6191,15 @@ void CodeGenerator::GenerateIsConstructCall(ZoneList<E
|
||||
|
||||
// Skip the arguments adaptor frame if it exists.
|
||||
Label check_frame_marker;
|
||||
- __ SmiCompare(Operand(fp.reg(), StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(not_equal, &check_frame_marker);
|
||||
__ movq(fp.reg(), Operand(fp.reg(), StandardFrameConstants::kCallerFPOffset));
|
||||
|
||||
// Check the marker in the calling frame.
|
||||
__ bind(&check_frame_marker);
|
||||
- __ SmiCompare(Operand(fp.reg(), StandardFrameConstants::kMarkerOffset),
|
||||
- Smi::FromInt(StackFrame::CONSTRUCT));
|
||||
+ __ Cmp(Operand(fp.reg(), StandardFrameConstants::kMarkerOffset),
|
||||
+ Smi::FromInt(StackFrame::CONSTRUCT));
|
||||
fp.Unuse();
|
||||
destination()->Split(equal);
|
||||
}
|
||||
@@ -6220,8 +6219,8 @@ void CodeGenerator::GenerateArgumentsLength(ZoneList<E
|
||||
|
||||
// Check if the calling frame is an arguments adaptor frame.
|
||||
__ movq(fp.reg(), Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
||||
- __ SmiCompare(Operand(fp.reg(), StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Arguments adaptor case: Read the arguments length from the
|
||||
@@ -6777,8 +6776,8 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expr
|
||||
// Fetch the map and check if array is in fast case.
|
||||
// Check that object doesn't require security checks and
|
||||
// has no indexed interceptor.
|
||||
- __ CmpObjectType(object.reg(), FIRST_JS_OBJECT_TYPE, tmp1.reg());
|
||||
- deferred->Branch(below);
|
||||
+ __ CmpObjectType(object.reg(), JS_ARRAY_TYPE, tmp1.reg());
|
||||
+ deferred->Branch(not_equal);
|
||||
__ testb(FieldOperand(tmp1.reg(), Map::kBitFieldOffset),
|
||||
Immediate(KeyedLoadIC::kSlowCaseBitFieldMask));
|
||||
deferred->Branch(not_zero);
|
||||
@@ -6820,7 +6819,7 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expr
|
||||
|
||||
Label done;
|
||||
__ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done);
|
||||
- // Possible optimization: do a check that both values are Smis
|
||||
+ // Possible optimization: do a check that both values are smis
|
||||
// (or them and test against Smi mask.)
|
||||
|
||||
__ movq(tmp2.reg(), tmp1.reg());
|
||||
@@ -8508,12 +8507,6 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_t
|
||||
__ CmpObjectType(receiver.reg(), JS_ARRAY_TYPE, kScratchRegister);
|
||||
deferred->Branch(not_equal);
|
||||
|
||||
- // Check that the key is within bounds. Both the key and the length of
|
||||
- // the JSArray are smis. Use unsigned comparison to handle negative keys.
|
||||
- __ SmiCompare(FieldOperand(receiver.reg(), JSArray::kLengthOffset),
|
||||
- key.reg());
|
||||
- deferred->Branch(below_equal);
|
||||
-
|
||||
// Get the elements array from the receiver and check that it is not a
|
||||
// dictionary.
|
||||
__ movq(tmp.reg(),
|
||||
@@ -8541,6 +8534,14 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_t
|
||||
__ cmpq(FieldOperand(tmp.reg(), HeapObject::kMapOffset),
|
||||
kScratchRegister);
|
||||
deferred->Branch(not_equal);
|
||||
+
|
||||
+ // Check that the key is within bounds. Both the key and the length of
|
||||
+ // the JSArray are smis (because the fixed array check above ensures the
|
||||
+ // elements are in fast case). Use unsigned comparison to handle negative
|
||||
+ // keys.
|
||||
+ __ SmiCompare(FieldOperand(receiver.reg(), JSArray::kLengthOffset),
|
||||
+ key.reg());
|
||||
+ deferred->Branch(below_equal);
|
||||
|
||||
// Store the value.
|
||||
SmiIndex index =
|
43
www/node/patches/patch-deps_v8_src_x64_full-codegen-x64_cc
Normal file
43
www/node/patches/patch-deps_v8_src_x64_full-codegen-x64_cc
Normal file
@ -0,0 +1,43 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_full-codegen-x64_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/full-codegen-x64.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/full-codegen-x64.cc Wed Mar 30 21:21:39 2011
|
||||
@@ -991,7 +991,7 @@ void FullCodeGenerator::VisitForInStatement(ForInState
|
||||
__ push(rcx); // Enumerable.
|
||||
__ push(rbx); // Current entry.
|
||||
__ InvokeBuiltin(Builtins::FILTER_KEY, CALL_FUNCTION);
|
||||
- __ SmiCompare(rax, Smi::FromInt(0));
|
||||
+ __ Cmp(rax, Smi::FromInt(0));
|
||||
__ j(equal, loop_statement.continue_target());
|
||||
__ movq(rbx, rax);
|
||||
|
||||
@@ -2498,15 +2498,15 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<E
|
||||
|
||||
// Skip the arguments adaptor frame if it exists.
|
||||
Label check_frame_marker;
|
||||
- __ SmiCompare(Operand(rax, StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(rax, StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(not_equal, &check_frame_marker);
|
||||
__ movq(rax, Operand(rax, StandardFrameConstants::kCallerFPOffset));
|
||||
|
||||
// Check the marker in the calling frame.
|
||||
__ bind(&check_frame_marker);
|
||||
- __ SmiCompare(Operand(rax, StandardFrameConstants::kMarkerOffset),
|
||||
- Smi::FromInt(StackFrame::CONSTRUCT));
|
||||
+ __ Cmp(Operand(rax, StandardFrameConstants::kMarkerOffset),
|
||||
+ Smi::FromInt(StackFrame::CONSTRUCT));
|
||||
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
|
||||
Split(equal, if_true, if_false, fall_through);
|
||||
|
||||
@@ -2560,8 +2560,8 @@ void FullCodeGenerator::EmitArgumentsLength(ZoneList<E
|
||||
|
||||
// Check if the calling frame is an arguments adaptor frame.
|
||||
__ movq(rbx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
|
||||
- __ SmiCompare(Operand(rbx, StandardFrameConstants::kContextOffset),
|
||||
- Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
+ __ Cmp(Operand(rbx, StandardFrameConstants::kContextOffset),
|
||||
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Arguments adaptor case: Read the arguments length from the
|
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_lithium-codegen-x64_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/lithium-codegen-x64.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/lithium-codegen-x64.cc Wed Mar 30 21:21:52 2011
|
||||
@@ -1210,7 +1210,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
|
||||
__ j(equal, true_label);
|
||||
__ CompareRoot(reg, Heap::kFalseValueRootIndex);
|
||||
__ j(equal, false_label);
|
||||
- __ SmiCompare(reg, Smi::FromInt(0));
|
||||
+ __ Cmp(reg, Smi::FromInt(0));
|
||||
__ j(equal, false_label);
|
||||
__ JumpIfSmi(reg, true_label);
|
||||
|
124
www/node/patches/patch-deps_v8_src_x64_macro-assembler-x64_cc
Normal file
124
www/node/patches/patch-deps_v8_src_x64_macro-assembler-x64_cc
Normal file
@ -0,0 +1,124 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_macro-assembler-x64_cc,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/macro-assembler-x64.cc.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/macro-assembler-x64.cc Wed Mar 30 21:22:01 2011
|
||||
@@ -111,7 +111,7 @@ void MacroAssembler::RecordWrite(Register object,
|
||||
ASSERT(!object.is(rsi) && !value.is(rsi) && !index.is(rsi));
|
||||
|
||||
// First, check if a write barrier is even needed. The tests below
|
||||
- // catch stores of Smis and stores into young gen.
|
||||
+ // catch stores of smis and stores into young gen.
|
||||
Label done;
|
||||
JumpIfSmi(value, &done);
|
||||
|
||||
@@ -140,7 +140,7 @@ void MacroAssembler::RecordWrite(Register object,
|
||||
ASSERT(!object.is(rsi) && !value.is(rsi) && !address.is(rsi));
|
||||
|
||||
// First, check if a write barrier is even needed. The tests below
|
||||
- // catch stores of Smis and stores into young gen.
|
||||
+ // catch stores of smis and stores into young gen.
|
||||
Label done;
|
||||
JumpIfSmi(value, &done);
|
||||
|
||||
@@ -824,12 +824,26 @@ void MacroAssembler::SmiTest(Register src) {
|
||||
}
|
||||
|
||||
|
||||
-void MacroAssembler::SmiCompare(Register dst, Register src) {
|
||||
- cmpq(dst, src);
|
||||
+void MacroAssembler::SmiCompare(Register smi1, Register smi2) {
|
||||
+ if (FLAG_debug_code) {
|
||||
+ AbortIfNotSmi(smi1);
|
||||
+ AbortIfNotSmi(smi2);
|
||||
+ }
|
||||
+ cmpq(smi1, smi2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::SmiCompare(Register dst, Smi* src) {
|
||||
+ if (FLAG_debug_code) {
|
||||
+ AbortIfNotSmi(dst);
|
||||
+ }
|
||||
+ // Actually, knowing the register is a smi doesn't enable any optimizations
|
||||
+ // with the current tagging scheme.
|
||||
+ Cmp(dst, src);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void MacroAssembler::Cmp(Register dst, Smi* src) {
|
||||
ASSERT(!dst.is(kScratchRegister));
|
||||
if (src->value() == 0) {
|
||||
testq(dst, dst);
|
||||
@@ -841,20 +855,41 @@ void MacroAssembler::SmiCompare(Register dst, Smi* src
|
||||
|
||||
|
||||
void MacroAssembler::SmiCompare(Register dst, const Operand& src) {
|
||||
+ if (FLAG_debug_code) {
|
||||
+ AbortIfNotSmi(dst);
|
||||
+ AbortIfNotSmi(src);
|
||||
+ }
|
||||
cmpq(dst, src);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::SmiCompare(const Operand& dst, Register src) {
|
||||
+ if (FLAG_debug_code) {
|
||||
+ AbortIfNotSmi(dst);
|
||||
+ AbortIfNotSmi(src);
|
||||
+ }
|
||||
cmpq(dst, src);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::SmiCompare(const Operand& dst, Smi* src) {
|
||||
+ if (FLAG_debug_code) {
|
||||
+ AbortIfNotSmi(dst);
|
||||
+ }
|
||||
cmpl(Operand(dst, kSmiShift / kBitsPerByte), Immediate(src->value()));
|
||||
}
|
||||
|
||||
|
||||
+void MacroAssembler::Cmp(const Operand& dst, Smi* src) {
|
||||
+ // The Operand cannot use the smi register, since we may use the scratch
|
||||
+ // register to get around the lack of 64 bit immediates in the instruction
|
||||
+ // set.
|
||||
+ Register smi_reg = GetSmiConstant(src);
|
||||
+ ASSERT(!dst.AddressUsesRegister(smi_reg));
|
||||
+ cmpq(dst, smi_reg);
|
||||
+}
|
||||
+
|
||||
+
|
||||
void MacroAssembler::SmiCompareInteger32(const Operand& dst, Register src) {
|
||||
cmpl(Operand(dst, kSmiShift / kBitsPerByte), src);
|
||||
}
|
||||
@@ -1339,7 +1374,7 @@ void MacroAssembler::Move(const Operand& dst, Handle<O
|
||||
|
||||
void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
|
||||
if (source->IsSmi()) {
|
||||
- SmiCompare(dst, Smi::cast(*source));
|
||||
+ Cmp(dst, Smi::cast(*source));
|
||||
} else {
|
||||
Move(kScratchRegister, source);
|
||||
cmpq(dst, kScratchRegister);
|
||||
@@ -1349,7 +1384,7 @@ void MacroAssembler::Cmp(Register dst, Handle<Object>
|
||||
|
||||
void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) {
|
||||
if (source->IsSmi()) {
|
||||
- SmiCompare(dst, Smi::cast(*source));
|
||||
+ Cmp(dst, Smi::cast(*source));
|
||||
} else {
|
||||
ASSERT(source->IsHeapObject());
|
||||
movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
|
||||
@@ -1719,7 +1754,12 @@ void MacroAssembler::AbortIfSmi(Register object) {
|
||||
|
||||
|
||||
void MacroAssembler::AbortIfNotSmi(Register object) {
|
||||
- NearLabel ok;
|
||||
+ Condition is_smi = CheckSmi(object);
|
||||
+ Assert(is_smi, "Operand is not a smi");
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void MacroAssembler::AbortIfNotSmi(const Operand& object) {
|
||||
Condition is_smi = CheckSmi(object);
|
||||
Assert(is_smi, "Operand is not a smi");
|
||||
}
|
32
www/node/patches/patch-deps_v8_src_x64_macro-assembler-x64_h
Normal file
32
www/node/patches/patch-deps_v8_src_x64_macro-assembler-x64_h
Normal file
@ -0,0 +1,32 @@
|
||||
$OpenBSD: patch-deps_v8_src_x64_macro-assembler-x64_h,v 1.1 2011/03/30 19:54:29 jasper Exp $
|
||||
--- deps/v8/src/x64/macro-assembler-x64.h.orig Sat Mar 26 09:48:02 2011
|
||||
+++ deps/v8/src/x64/macro-assembler-x64.h Wed Mar 30 21:22:09 2011
|
||||
@@ -263,8 +263,9 @@ class MacroAssembler: public Assembler {
|
||||
int power);
|
||||
|
||||
|
||||
- // Simple comparison of smis.
|
||||
- void SmiCompare(Register dst, Register src);
|
||||
+ // Simple comparison of smis. Both sides must be known smis to use these,
|
||||
+ // otherwise use Cmp.
|
||||
+ void SmiCompare(Register smi1, Register smi2);
|
||||
void SmiCompare(Register dst, Smi* src);
|
||||
void SmiCompare(Register dst, const Operand& src);
|
||||
void SmiCompare(const Operand& dst, Register src);
|
||||
@@ -594,6 +595,8 @@ class MacroAssembler: public Assembler {
|
||||
void Move(const Operand& dst, Handle<Object> source);
|
||||
void Cmp(Register dst, Handle<Object> source);
|
||||
void Cmp(const Operand& dst, Handle<Object> source);
|
||||
+ void Cmp(Register dst, Smi* src);
|
||||
+ void Cmp(const Operand& dst, Smi* src);
|
||||
void Push(Handle<Object> source);
|
||||
|
||||
// Emit code to discard a non-negative number of pointer-sized elements
|
||||
@@ -667,6 +670,7 @@ class MacroAssembler: public Assembler {
|
||||
|
||||
// Abort execution if argument is not a smi. Used in debug code.
|
||||
void AbortIfNotSmi(Register object);
|
||||
+ void AbortIfNotSmi(const Operand& object);
|
||||
|
||||
// Abort execution if argument is a string. Used in debug code.
|
||||
void AbortIfNotString(Register object);
|
@ -1,19 +1,13 @@
|
||||
$OpenBSD: patch-wscript,v 1.3 2011/01/03 10:50:51 jasper Exp $
|
||||
$OpenBSD: patch-wscript,v 1.4 2011/03/30 19:54:29 jasper Exp $
|
||||
|
||||
- OpenBSD can also use libkvm and libexecinfo.
|
||||
- OpenBSD can also use libexecinfo.
|
||||
- Don't append EV_MULTIPLICITY_EV was it breaks the build with using the
|
||||
shared libev with an undefined reference to ev_rt_now.
|
||||
- Adjust some paths.
|
||||
|
||||
--- wscript.orig Fri Dec 31 06:00:01 2010
|
||||
+++ wscript Mon Jan 3 11:03:56 2011
|
||||
@@ -155,7 +155,7 @@ def configure(conf):
|
||||
conf.env.append_value("CCFLAGS", "-rdynamic")
|
||||
conf.env.append_value("LINKFLAGS_DL", "-rdynamic")
|
||||
|
||||
- if sys.platform.startswith("freebsd"):
|
||||
+ if sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd"):
|
||||
conf.check(lib='kvm', uselib_store='KVM')
|
||||
|
||||
#if Options.options.debug:
|
||||
@@ -164,7 +164,7 @@ def configure(conf):
|
||||
--- wscript.orig Sat Mar 26 09:48:02 2011
|
||||
+++ wscript Wed Mar 30 21:39:43 2011
|
||||
@@ -280,7 +280,7 @@ def configure(conf):
|
||||
if Options.options.efence:
|
||||
conf.check(lib='efence', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='EFENCE')
|
||||
|
||||
@ -22,17 +16,29 @@ $OpenBSD: patch-wscript,v 1.3 2011/01/03 10:50:51 jasper Exp $
|
||||
if not conf.check(lib="execinfo",
|
||||
includes=['/usr/include', '/usr/local/include'],
|
||||
libpath=['/usr/lib', '/usr/local/lib'],
|
||||
@@ -576,11 +577,10 @@ def build(bld):
|
||||
@@ -460,8 +460,10 @@ def configure(conf):
|
||||
# LFS
|
||||
conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
|
||||
conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
|
||||
- conf.env.append_value('CPPFLAGS', '-DEV_MULTIPLICITY=0')
|
||||
|
||||
+# Disabled, see http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/18924
|
||||
+# conf.env.append_value('CPPFLAGS', '-DEV_MULTIPLICITY=0')
|
||||
+
|
||||
# Makes select on windows support more than 64 FDs
|
||||
if sys.platform.startswith("win32"):
|
||||
conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');
|
||||
@@ -906,11 +908,10 @@ def build(bld):
|
||||
# Only install the man page if it exists.
|
||||
# Do 'make doc install' to build and install it.
|
||||
if os.path.exists('doc/node.1'):
|
||||
- bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1')
|
||||
+ bld.install_files('${PREFIX}/man/man1/', 'doc/node.1')
|
||||
|
||||
bld.install_files('${PREFIX}/bin/', 'bin/*', chmod=0755)
|
||||
- bld.install_files('${PREFIX}/lib/node/wafadmin', 'tools/wafadmin/*.py')
|
||||
- bld.install_files('${PREFIX}/lib/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
|
||||
+ bld.install_files('${PREFIX}/lib/node/wafadmin', 'tools/wafadmin/Node.py')
|
||||
bld.install_files('${PREFIX}/bin/', 'tools/node-waf', chmod=0755)
|
||||
- bld.install_files('${LIBDIR}/node/wafadmin', 'tools/wafadmin/*.py')
|
||||
- bld.install_files('${LIBDIR}/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
|
||||
+ bld.install_files('${LIBDIR}/node/wafadmin', 'tools/wafadmin/Node.py')
|
||||
|
||||
def shutdown():
|
||||
Options.options.debug
|
||||
# create a pkg-config(1) file
|
||||
node_conf = bld.new_task_gen('subst', before="cxx")
|
||||
|
@ -1,6 +1,5 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2010/12/28 18:19:28 jasper Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.2 2011/03/30 19:54:29 jasper Exp $
|
||||
@bin bin/node
|
||||
bin/node-repl
|
||||
bin/node-waf
|
||||
include/node/
|
||||
include/node/config.h
|
||||
@ -12,9 +11,13 @@ include/node/node_events.h
|
||||
include/node/node_object_wrap.h
|
||||
include/node/node_version.h
|
||||
include/node/v8-debug.h
|
||||
include/node/v8-preparser.h
|
||||
include/node/v8-profiler.h
|
||||
include/node/v8-testing.h
|
||||
include/node/v8.h
|
||||
include/node/v8stdint.h
|
||||
lib/node/
|
||||
lib/node/wafadmin/
|
||||
lib/node/wafadmin/Node.py
|
||||
lib/pkgconfig/nodejs.pc
|
||||
@man man/man1/node.1
|
||||
|
Loading…
Reference in New Issue
Block a user