Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into net2
Browse files Browse the repository at this point in the history
Conflicts:
	src/node.cc
  • Loading branch information
ry committed Mar 15, 2010
2 parents 96f08cf + 6befc72 commit cbfd4da
Show file tree
Hide file tree
Showing 128 changed files with 108,355 additions and 1,429 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -58,3 +58,4 @@ Arlo Breault <arlolra@gmail.com>
Kris Kowal <kris.kowal@cixar.com>
Jacek Becela <jacek.becela@gmail.com>
Rob Ellis <kazoomer@gmail.com>
Tim-Smart <timehAndGod@gmail.com>
24 changes: 23 additions & 1 deletion ChangeLog
@@ -1,4 +1,26 @@
2010.03.05, Version 0.1.31
2010.03.12, Version 0.1.32

* Optimize event emitter for single listener

* Add process.evalcx, require.registerExtension (Tim Smart)

* Replace --cflags with --vars

* Fix bugs in fs.create*Stream (Felix Geisendörfer)

* Deprecate process.mixin, process.unloop

* Remove the 'Error: (no message)' exceptions, print stack
trace instead

* INI parser bug fixes (Isaac Schlueter)

* FreeBSD fixes (Vanilla Hsu)

* Upgrade to V8 2.1.3, WAF 1.5.14a, libev


2010.03.05, Version 0.1.31, 39b63dfe1737d46a8c8818c92773ef181fd174b3

* API: - Move process.watchFile into fs module
- Move process.inherits to sys
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/ChangeLog
@@ -1,3 +1,10 @@
2010-03-10: Version 2.1.4

Fixed code cache lookup for keyed IC's (issue http://crbug.com/37853).

Performance improvements on all platforms.


2010-03-10: Version 2.1.3

Added API method for context-disposal notifications.
Expand Down
8 changes: 8 additions & 0 deletions deps/v8/include/v8.h
Expand Up @@ -2421,6 +2421,14 @@ class V8EXPORT V8 {
*/
static int GetLogLines(int from_pos, char* dest_buf, int max_size);

/**
* The minimum allowed size for a log lines buffer. If the size of
* the buffer given will not be enough to hold a line of the maximum
* length, an attempt to find a log line end in GetLogLines will
* fail, and an empty result will be returned.
*/
static const int kMinimumSizeForLogLinesBuffer = 2048;

/**
* Retrieve the V8 thread id of the calling thread.
*
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/SConscript
Expand Up @@ -63,6 +63,7 @@ SOURCES = {
full-codegen.cc
func-name-inferrer.cc
global-handles.cc
grisu3.cc
handles.cc
hashmap.cc
heap-profiler.cc
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/api.cc
Expand Up @@ -3580,6 +3580,7 @@ int V8::GetActiveProfilerModules() {

int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) {
#ifdef ENABLE_LOGGING_AND_PROFILING
ASSERT(max_size >= kMinimumSizeForLogLinesBuffer);
return i::Logger::GetLogLines(from_pos, dest_buf, max_size);
#endif
return 0;
Expand Down
18 changes: 10 additions & 8 deletions deps/v8/src/arm/codegen-arm.cc
Expand Up @@ -2709,18 +2709,20 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
Comment cmnt(masm_, "[ ObjectLiteral");

// Load the function of this activation.
__ ldr(r2, frame_->Function());
__ ldr(r3, frame_->Function());
// Literal array.
__ ldr(r2, FieldMemOperand(r2, JSFunction::kLiteralsOffset));
__ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
// Literal index.
__ mov(r1, Operand(Smi::FromInt(node->literal_index())));
__ mov(r2, Operand(Smi::FromInt(node->literal_index())));
// Constant properties.
__ mov(r0, Operand(node->constant_properties()));
frame_->EmitPushMultiple(3, r2.bit() | r1.bit() | r0.bit());
__ mov(r1, Operand(node->constant_properties()));
// Should the object literal have fast elements?
__ mov(r0, Operand(Smi::FromInt(node->fast_elements() ? 1 : 0)));
frame_->EmitPushMultiple(4, r3.bit() | r2.bit() | r1.bit() | r0.bit());
if (node->depth() > 1) {
frame_->CallRuntime(Runtime::kCreateObjectLiteral, 3);
frame_->CallRuntime(Runtime::kCreateObjectLiteral, 4);
} else {
frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 3);
frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
}
frame_->EmitPush(r0); // save the result
for (int i = 0; i < node->properties()->length(); i++) {
Expand Down Expand Up @@ -3597,7 +3599,7 @@ void CodeGenerator::GenerateArgumentsLength(ZoneList<Expression*>* args) {
}


void CodeGenerator::GenerateArgumentsAccess(ZoneList<Expression*>* args) {
void CodeGenerator::GenerateArguments(ZoneList<Expression*>* args) {
VirtualFrame::SpilledScope spilled_scope;
ASSERT(args->length() == 1);

Expand Down
13 changes: 7 additions & 6 deletions deps/v8/src/arm/codegen-arm.h
Expand Up @@ -197,6 +197,10 @@ class CodeGenerator: public AstVisitor {

static const int kUnknownIntValue = -1;

// If the name is an inline runtime function call return the number of
// expected arguments. Otherwise return -1.
static int InlineRuntimeCallArgumentsCount(Handle<String> name);

private:
// Construction/Destruction
explicit CodeGenerator(MacroAssembler* masm);
Expand Down Expand Up @@ -326,6 +330,7 @@ class CodeGenerator: public AstVisitor {
struct InlineRuntimeLUT {
void (CodeGenerator::*method)(ZoneList<Expression*>*);
const char* name;
int nargs;
};

static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name);
Expand Down Expand Up @@ -360,7 +365,7 @@ class CodeGenerator: public AstVisitor {

// Support for arguments.length and arguments[?].
void GenerateArgumentsLength(ZoneList<Expression*>* args);
void GenerateArgumentsAccess(ZoneList<Expression*>* args);
void GenerateArguments(ZoneList<Expression*>* args);

// Support for accessing the class and value fields of an object.
void GenerateClassOf(ZoneList<Expression*>* args);
Expand Down Expand Up @@ -396,14 +401,10 @@ class CodeGenerator: public AstVisitor {
// Fast support for number to string.
void GenerateNumberToString(ZoneList<Expression*>* args);

// Fast support for Math.pow().
// Fast call to math functions.
void GenerateMathPow(ZoneList<Expression*>* args);

// Fast call to sine function.
void GenerateMathSin(ZoneList<Expression*>* args);
void GenerateMathCos(ZoneList<Expression*>* args);

// Fast support for Math.pow().
void GenerateMathSqrt(ZoneList<Expression*>* args);

// Simple condition analysis.
Expand Down
15 changes: 8 additions & 7 deletions deps/v8/src/arm/full-codegen-arm.cc
Expand Up @@ -783,15 +783,16 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {

void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
Comment cmnt(masm_, "[ ObjectLiteral");
__ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ ldr(r2, FieldMemOperand(r2, JSFunction::kLiteralsOffset));
__ mov(r1, Operand(Smi::FromInt(expr->literal_index())));
__ mov(r0, Operand(expr->constant_properties()));
__ stm(db_w, sp, r2.bit() | r1.bit() | r0.bit());
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
__ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
__ mov(r1, Operand(expr->constant_properties()));
__ mov(r0, Operand(Smi::FromInt(expr->fast_elements() ? 1 : 0)));
__ stm(db_w, sp, r3.bit() | r2.bit() | r1.bit() | r0.bit());
if (expr->depth() > 1) {
__ CallRuntime(Runtime::kCreateObjectLiteral, 3);
__ CallRuntime(Runtime::kCreateObjectLiteral, 4);
} else {
__ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3);
__ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
}

// If result_saved is true the result is on top of the stack. If
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/arm/macro-assembler-arm.cc
Expand Up @@ -280,9 +280,9 @@ void MacroAssembler::RecordWrite(Register object, Register offset,
// Clobber all input registers when running with the debug-code flag
// turned on to provoke errors.
if (FLAG_debug_code) {
mov(object, Operand(bit_cast<int32_t>(kZapValue)));
mov(offset, Operand(bit_cast<int32_t>(kZapValue)));
mov(scratch, Operand(bit_cast<int32_t>(kZapValue)));
mov(object, Operand(BitCast<int32_t>(kZapValue)));
mov(offset, Operand(BitCast<int32_t>(kZapValue)));
mov(scratch, Operand(BitCast<int32_t>(kZapValue)));
}
}

Expand Down
117 changes: 105 additions & 12 deletions deps/v8/src/arm/stub-cache-arm.cc
Expand Up @@ -815,6 +815,104 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
}


Object* CallStubCompiler::CompileArrayPushCall(Object* object,
JSObject* holder,
JSFunction* function,
String* name,
CheckType check) {
// ----------- S t a t e -------------
// -- r2 : name
// -- lr : return address
// -----------------------------------

// TODO(639): faster implementation.
ASSERT(check == RECEIVER_MAP_CHECK);

Label miss;

// Get the receiver from the stack
const int argc = arguments().immediate();
__ ldr(r1, MemOperand(sp, argc * kPointerSize));

// Check that the receiver isn't a smi.
__ tst(r1, Operand(kSmiTagMask));
__ b(eq, &miss);

// Check that the maps haven't changed.
CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);

if (object->IsGlobalObject()) {
__ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
__ str(r3, MemOperand(sp, argc * kPointerSize));
}

__ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
argc + 1,
1);

// Handle call cache miss.
__ bind(&miss);
Handle<Code> ic = ComputeCallMiss(arguments().immediate());
__ Jump(ic, RelocInfo::CODE_TARGET);

// Return the generated code.
String* function_name = NULL;
if (function->shared()->name()->IsString()) {
function_name = String::cast(function->shared()->name());
}
return GetCode(CONSTANT_FUNCTION, function_name);
}


Object* CallStubCompiler::CompileArrayPopCall(Object* object,
JSObject* holder,
JSFunction* function,
String* name,
CheckType check) {
// ----------- S t a t e -------------
// -- r2 : name
// -- lr : return address
// -----------------------------------

// TODO(642): faster implementation.
ASSERT(check == RECEIVER_MAP_CHECK);

Label miss;

// Get the receiver from the stack
const int argc = arguments().immediate();
__ ldr(r1, MemOperand(sp, argc * kPointerSize));

// Check that the receiver isn't a smi.
__ tst(r1, Operand(kSmiTagMask));
__ b(eq, &miss);

// Check that the maps haven't changed.
CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);

if (object->IsGlobalObject()) {
__ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
__ str(r3, MemOperand(sp, argc * kPointerSize));
}

__ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
argc + 1,
1);

// Handle call cache miss.
__ bind(&miss);
Handle<Code> ic = ComputeCallMiss(arguments().immediate());
__ Jump(ic, RelocInfo::CODE_TARGET);

// Return the generated code.
String* function_name = NULL;
if (function->shared()->name()->IsString()) {
function_name = String::cast(function->shared()->name());
}
return GetCode(CONSTANT_FUNCTION, function_name);
}


Object* CallStubCompiler::CompileCallConstant(Object* object,
JSObject* holder,
JSFunction* function,
Expand All @@ -824,6 +922,13 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
// -- r2 : name
// -- lr : return address
// -----------------------------------
SharedFunctionInfo* function_info = function->shared();
if (function_info->HasCustomCallGenerator()) {
CustomCallGenerator generator =
ToCData<CustomCallGenerator>(function_info->function_data());
return generator(this, object, holder, function, name, check);
}

Label miss;

// Get the receiver from the stack
Expand Down Expand Up @@ -916,18 +1021,6 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
break;
}

case JSARRAY_HAS_FAST_ELEMENTS_CHECK:
CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
// Make sure object->HasFastElements().
// Get the elements array of the object.
__ ldr(r3, FieldMemOperand(r1, JSObject::kElementsOffset));
// Check that the object is in fast mode (not dictionary).
__ ldr(r0, FieldMemOperand(r3, HeapObject::kMapOffset));
__ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
__ cmp(r0, ip);
__ b(ne, &miss);
break;

default:
UNREACHABLE();
}
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/arm/virtual-frame-arm.h
Expand Up @@ -364,6 +364,8 @@ class VirtualFrame : public ZoneObject {
// the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
inline void Nip(int num_dropped);

inline void SetTypeForLocalAt(int index, NumberInfo info);

private:
static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset;
Expand Down

0 comments on commit cbfd4da

Please sign in to comment.