Removed InvokeJSFlags enum, we already have InvokeFlag for the same purpose.

Review URL: http://codereview.chromium.org/6880321

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2011-04-29 20:07:41 +00:00
parent 238349f2a7
commit b60baa0b70
10 changed files with 41 additions and 52 deletions

View File

@ -584,7 +584,7 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
__ IncrementCounter(counters->string_ctor_conversions(), 1, r3, r4); __ IncrementCounter(counters->string_ctor_conversions(), 1, r3, r4);
__ EnterInternalFrame(); __ EnterInternalFrame();
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::TO_STRING, CALL_JS); __ InvokeBuiltin(Builtins::TO_STRING, CALL_FUNCTION);
__ LeaveInternalFrame(); __ LeaveInternalFrame();
__ pop(function); __ pop(function);
__ mov(argument, r0); __ mov(argument, r0);
@ -1270,7 +1270,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ push(r0); __ push(r0);
__ push(r2); __ push(r2);
__ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
__ mov(r2, r0); __ mov(r2, r0);
__ pop(r0); __ pop(r0);
@ -1378,7 +1378,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ push(r0); __ push(r0);
__ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_JS); __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
// Check the stack for overflow. We are not trying need to catch // Check the stack for overflow. We are not trying need to catch
// interruptions (e.g. debug break and preemption) here, so the "real stack // interruptions (e.g. debug break and preemption) here, so the "real stack
@ -1396,7 +1396,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ ldr(r1, MemOperand(fp, kFunctionOffset)); __ ldr(r1, MemOperand(fp, kFunctionOffset));
__ push(r1); __ push(r1);
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_JS); __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION);
// End of stack check. // End of stack check.
// Push current limit and index. // Push current limit and index.
@ -1442,7 +1442,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
// r0: receiver // r0: receiver
__ bind(&call_to_object); __ bind(&call_to_object);
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
__ b(&push_receiver); __ b(&push_receiver);
// Use the current global receiver object as the receiver. // Use the current global receiver object as the receiver.

View File

@ -79,7 +79,7 @@ void ToNumberStub::Generate(MacroAssembler* masm) {
__ bind(&call_builtin); __ bind(&call_builtin);
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_JS); __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION);
} }
@ -1599,7 +1599,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
// Call the native; it returns -1 (less), 0 (equal), or 1 (greater) // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
// tagged as a small integer. // tagged as a small integer.
__ InvokeBuiltin(native, JUMP_JS); __ InvokeBuiltin(native, JUMP_FUNCTION);
} }
@ -1965,10 +1965,10 @@ void TypeRecordingUnaryOpStub::GenerateGenericCodeFallback(
__ push(r0); __ push(r0);
switch (op_) { switch (op_) {
case Token::SUB: case Token::SUB:
__ InvokeBuiltin(Builtins::UNARY_MINUS, JUMP_JS); __ InvokeBuiltin(Builtins::UNARY_MINUS, JUMP_FUNCTION);
break; break;
case Token::BIT_NOT: case Token::BIT_NOT:
__ InvokeBuiltin(Builtins::BIT_NOT, JUMP_JS); __ InvokeBuiltin(Builtins::BIT_NOT, JUMP_FUNCTION);
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
@ -2902,37 +2902,37 @@ void TypeRecordingBinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) {
GenerateRegisterArgsPush(masm); GenerateRegisterArgsPush(masm);
switch (op_) { switch (op_) {
case Token::ADD: case Token::ADD:
__ InvokeBuiltin(Builtins::ADD, JUMP_JS); __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION);
break; break;
case Token::SUB: case Token::SUB:
__ InvokeBuiltin(Builtins::SUB, JUMP_JS); __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION);
break; break;
case Token::MUL: case Token::MUL:
__ InvokeBuiltin(Builtins::MUL, JUMP_JS); __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION);
break; break;
case Token::DIV: case Token::DIV:
__ InvokeBuiltin(Builtins::DIV, JUMP_JS); __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION);
break; break;
case Token::MOD: case Token::MOD:
__ InvokeBuiltin(Builtins::MOD, JUMP_JS); __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION);
break; break;
case Token::BIT_OR: case Token::BIT_OR:
__ InvokeBuiltin(Builtins::BIT_OR, JUMP_JS); __ InvokeBuiltin(Builtins::BIT_OR, JUMP_FUNCTION);
break; break;
case Token::BIT_AND: case Token::BIT_AND:
__ InvokeBuiltin(Builtins::BIT_AND, JUMP_JS); __ InvokeBuiltin(Builtins::BIT_AND, JUMP_FUNCTION);
break; break;
case Token::BIT_XOR: case Token::BIT_XOR:
__ InvokeBuiltin(Builtins::BIT_XOR, JUMP_JS); __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_FUNCTION);
break; break;
case Token::SAR: case Token::SAR:
__ InvokeBuiltin(Builtins::SAR, JUMP_JS); __ InvokeBuiltin(Builtins::SAR, JUMP_FUNCTION);
break; break;
case Token::SHR: case Token::SHR:
__ InvokeBuiltin(Builtins::SHR, JUMP_JS); __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION);
break; break;
case Token::SHL: case Token::SHL:
__ InvokeBuiltin(Builtins::SHL, JUMP_JS); __ InvokeBuiltin(Builtins::SHL, JUMP_FUNCTION);
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
@ -3821,11 +3821,11 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
if (HasArgsInRegisters()) { if (HasArgsInRegisters()) {
__ Push(r0, r1); __ Push(r0, r1);
} }
__ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_JS); __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
} else { } else {
__ EnterInternalFrame(); __ EnterInternalFrame();
__ Push(r0, r1); __ Push(r0, r1);
__ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_JS); __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION);
__ LeaveInternalFrame(); __ LeaveInternalFrame();
__ cmp(r0, Operand(0)); __ cmp(r0, Operand(0));
__ LoadRoot(r0, Heap::kTrueValueRootIndex, eq); __ LoadRoot(r0, Heap::kTrueValueRootIndex, eq);
@ -4476,7 +4476,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
__ bind(&receiver_is_value); __ bind(&receiver_is_value);
__ EnterInternalFrame(); __ EnterInternalFrame();
__ push(r1); __ push(r1);
__ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
__ LeaveInternalFrame(); __ LeaveInternalFrame();
__ str(r0, MemOperand(sp, argc_ * kPointerSize)); __ str(r0, MemOperand(sp, argc_ * kPointerSize));
@ -5777,7 +5777,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
if (call_builtin.is_linked()) { if (call_builtin.is_linked()) {
__ bind(&call_builtin); __ bind(&call_builtin);
__ InvokeBuiltin(builtin_id, JUMP_JS); __ InvokeBuiltin(builtin_id, JUMP_FUNCTION);
} }
} }

View File

@ -915,7 +915,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ b(hs, &done_convert); __ b(hs, &done_convert);
__ bind(&convert); __ bind(&convert);
__ push(r0); __ push(r0);
__ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
__ bind(&done_convert); __ bind(&done_convert);
__ push(r0); __ push(r0);
@ -1039,7 +1039,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// just skip it. // just skip it.
__ push(r1); // Enumerable. __ push(r1); // Enumerable.
__ push(r3); // Current entry. __ push(r3); // Current entry.
__ InvokeBuiltin(Builtins::FILTER_KEY, CALL_JS); __ InvokeBuiltin(Builtins::FILTER_KEY, CALL_FUNCTION);
__ mov(r3, Operand(r0), SetCC); __ mov(r3, Operand(r0), SetCC);
__ b(eq, loop_statement.continue_target()); __ b(eq, loop_statement.continue_target());
@ -3700,7 +3700,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
VisitForStackValue(prop->key()); VisitForStackValue(prop->key());
__ mov(r1, Operand(Smi::FromInt(strict_mode_flag()))); __ mov(r1, Operand(Smi::FromInt(strict_mode_flag())));
__ push(r1); __ push(r1);
__ InvokeBuiltin(Builtins::DELETE, CALL_JS); __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
context()->Plug(r0); context()->Plug(r0);
} }
} else if (var != NULL) { } else if (var != NULL) {
@ -3712,7 +3712,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
__ mov(r1, Operand(var->name())); __ mov(r1, Operand(var->name()));
__ mov(r0, Operand(Smi::FromInt(kNonStrictMode))); __ mov(r0, Operand(Smi::FromInt(kNonStrictMode)));
__ Push(r2, r1, r0); __ Push(r2, r1, r0);
__ InvokeBuiltin(Builtins::DELETE, CALL_JS); __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
context()->Plug(r0); context()->Plug(r0);
} else if (var->AsSlot() != NULL && } else if (var->AsSlot() != NULL &&
var->AsSlot()->type() != Slot::LOOKUP) { var->AsSlot()->type() != Slot::LOOKUP) {
@ -4140,7 +4140,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
switch (op) { switch (op) {
case Token::IN: case Token::IN:
VisitForStackValue(expr->right()); VisitForStackValue(expr->right());
__ InvokeBuiltin(Builtins::IN, CALL_JS); __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
__ LoadRoot(ip, Heap::kTrueValueRootIndex); __ LoadRoot(ip, Heap::kTrueValueRootIndex);
__ cmp(r0, ip); __ cmp(r0, ip);

View File

@ -4256,7 +4256,7 @@ void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
SafepointGenerator safepoint_generator(this, SafepointGenerator safepoint_generator(this,
pointers, pointers,
env->deoptimization_index()); env->deoptimization_index());
__ InvokeBuiltin(Builtins::DELETE, CALL_JS, &safepoint_generator); __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator);
} }
@ -4272,7 +4272,7 @@ void LCodeGen::DoIn(LIn* instr) {
SafepointGenerator safepoint_generator(this, SafepointGenerator safepoint_generator(this,
pointers, pointers,
env->deoptimization_index()); env->deoptimization_index());
__ InvokeBuiltin(Builtins::IN, CALL_JS, &safepoint_generator); __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, &safepoint_generator);
} }

View File

@ -2313,15 +2313,15 @@ MaybeObject* MacroAssembler::TryJumpToExternalReference(
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flags, InvokeFlag flag,
CallWrapper* call_wrapper) { CallWrapper* call_wrapper) {
GetBuiltinEntry(r2, id); GetBuiltinEntry(r2, id);
if (flags == CALL_JS) { if (flag == CALL_FUNCTION) {
if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(r2)); if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(r2));
Call(r2); Call(r2);
if (call_wrapper != NULL) call_wrapper->AfterCall(); if (call_wrapper != NULL) call_wrapper->AfterCall();
} else { } else {
ASSERT(flags == JUMP_JS); ASSERT(flag == JUMP_FUNCTION);
Jump(r2); Jump(r2);
} }
} }

View File

@ -55,12 +55,6 @@ static inline Operand SmiUntagOperand(Register object) {
const Register cp = { 8 }; // JavaScript context pointer const Register cp = { 8 }; // JavaScript context pointer
const Register roots = { 10 }; // Roots array pointer. const Register roots = { 10 }; // Roots array pointer.
enum InvokeJSFlags {
CALL_JS,
JUMP_JS
};
// Flags used for the AllocateInNewSpace functions. // Flags used for the AllocateInNewSpace functions.
enum AllocationFlags { enum AllocationFlags {
// No special flags. // No special flags.
@ -807,7 +801,7 @@ class MacroAssembler: public Assembler {
// Invoke specified builtin JavaScript function. Adds an entry to // Invoke specified builtin JavaScript function. Adds an entry to
// the unresolved list if the name does not resolve. // the unresolved list if the name does not resolve.
void InvokeBuiltin(Builtins::JavaScript id, void InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flags, InvokeFlag flag,
CallWrapper* call_wrapper = NULL); CallWrapper* call_wrapper = NULL);
// Store the code object for the given builtin in the target register and // Store the code object for the given builtin in the target register and

View File

@ -2641,14 +2641,14 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flags, InvokeFlag flag,
PostCallGenerator* post_call_generator) { PostCallGenerator* post_call_generator) {
GetBuiltinEntry(t9, id); GetBuiltinEntry(t9, id);
if (flags == CALL_JS) { if (flag == CALL_FUNCTION) {
Call(t9); Call(t9);
if (post_call_generator != NULL) post_call_generator->Generate(); if (post_call_generator != NULL) post_call_generator->Generate();
} else { } else {
ASSERT(flags == JUMP_JS); ASSERT(flag == JUMP_FUNCTION);
Jump(t9); Jump(t9);
} }
} }

View File

@ -59,11 +59,6 @@ const Register fp = s8_fp; // Alias fp
const Register condReg1 = s4; const Register condReg1 = s4;
const Register condReg2 = s5; const Register condReg2 = s5;
enum InvokeJSFlags {
CALL_JS,
JUMP_JS
};
// Flags used for the AllocateInNewSpace functions. // Flags used for the AllocateInNewSpace functions.
enum AllocationFlags { enum AllocationFlags {
@ -775,7 +770,7 @@ DECLARE_NOTARGET_PROTOTYPE(Ret)
// Invoke specified builtin JavaScript function. Adds an entry to // Invoke specified builtin JavaScript function. Adds an entry to
// the unresolved list if the name does not resolve. // the unresolved list if the name does not resolve.
void InvokeBuiltin(Builtins::JavaScript id, void InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flags, InvokeFlag flag,
PostCallGenerator* post_call_generator = NULL); PostCallGenerator* post_call_generator = NULL);
// Store the code object for the given builtin in the target register and // Store the code object for the given builtin in the target register and

View File

@ -128,7 +128,7 @@ void VirtualFrame::DebugBreak() {
void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flags, InvokeFlag flag,
int arg_count) { int arg_count) {
UNIMPLEMENTED_MIPS(); UNIMPLEMENTED_MIPS();
} }

View File

@ -295,7 +295,7 @@ class VirtualFrame : public ZoneObject {
// Invoke builtin given the number of arguments it expects on (and // Invoke builtin given the number of arguments it expects on (and
// removes from) the stack. // removes from) the stack.
void InvokeBuiltin(Builtins::JavaScript id, void InvokeBuiltin(Builtins::JavaScript id,
InvokeJSFlags flag, InvokeFlag flag,
int arg_count); int arg_count);
// Call load IC. Receiver is on the stack and is consumed. Result is returned // Call load IC. Receiver is on the stack and is consumed. Result is returned