Commit 09c63bc9 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Revert r18131 and r18139 "Clean up in the CallStubCompiler".

and "Fix register usage."

TBR=verwaest@chromium.org

Review URL: https://codereview.chromium.org/96573002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d778f708
......@@ -1229,7 +1229,7 @@ void MacroAssembler::InvokeFunction(Register fun,
}
void MacroAssembler::InvokeFunction(Register function,
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
......@@ -1238,10 +1238,8 @@ void MacroAssembler::InvokeFunction(Register function,
// You can't call a function without a valid frame.
ASSERT(flag == JUMP_FUNCTION || has_frame());
// Contract with called JS functions requires that function is passed in r1.
ASSERT(function.is(r1));
// Get the function and setup the context.
Move(r1, function);
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
// We call indirectly through the code field in the function to
......@@ -1252,17 +1250,6 @@ void MacroAssembler::InvokeFunction(Register function,
}
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind) {
Move(r1, function);
InvokeFunction(r1, expected, actual, flag, call_wrapper, call_kind);
}
void MacroAssembler::IsObjectJSObjectType(Register heap_object,
Register map,
Register scratch,
......
......@@ -613,13 +613,6 @@ class MacroAssembler: public Assembler {
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Register function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
......
This diff is collapsed.
......@@ -2636,7 +2636,7 @@ void MacroAssembler::InvokeFunction(Register fun,
}
void MacroAssembler::InvokeFunction(Register fun,
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
......@@ -2645,25 +2645,18 @@ void MacroAssembler::InvokeFunction(Register fun,
// You can't call a function without a valid frame.
ASSERT(flag == JUMP_FUNCTION || has_frame());
ASSERT(fun.is(edi));
// Get the function and setup the context.
LoadHeapObject(edi, function);
mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
// We call indirectly through the code field in the function to
// allow recompilation to take effect without changing any of the
// call sites.
InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
expected, actual, flag, call_wrapper, call_kind);
}
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind) {
LoadHeapObject(edi, function);
InvokeFunction(edi, expected, actual, flag, call_wrapper, call_kind);
}
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
......
......@@ -349,13 +349,6 @@ class MacroAssembler: public Assembler {
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Register function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
......
This diff is collapsed.
......@@ -1128,69 +1128,12 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
#define __ ACCESS_MASM(masm())
CallKind CallStubCompiler::call_kind() {
return CallICBase::Contextual::decode(extra_state_)
? CALL_AS_FUNCTION
: CALL_AS_METHOD;
}
void CallStubCompiler::HandlerFrontendFooter(Label* miss) {
__ bind(miss);
GenerateMissBranch();
}
void CallStubCompiler::GenerateJumpFunctionIgnoreReceiver(
Handle<JSFunction> function) {
ParameterCount expected(function);
__ InvokeFunction(function, expected, arguments(),
JUMP_FUNCTION, NullCallWrapper(), call_kind());
}
void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
Handle<JSFunction> function) {
PatchGlobalProxy(object);
GenerateJumpFunctionIgnoreReceiver(function);
}
void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
Register actual_closure,
Handle<JSFunction> function) {
PatchGlobalProxy(object);
ParameterCount expected(function);
__ InvokeFunction(actual_closure, expected, arguments(),
JUMP_FUNCTION, NullCallWrapper(), call_kind());
}
Handle<Code> CallStubCompiler::CompileCallConstant(
Handle<Object> object,
Handle<JSObject> holder,
Handle<Name> name,
CheckType check,
Handle<JSFunction> function) {
if (HasCustomCallGenerator(function)) {
Handle<Code> code = CompileCustomCall(object, holder,
Handle<Cell>::null(),
function, Handle<String>::cast(name),
Code::FAST);
// A null handle means bail out to the regular compiler code below.
if (!code.is_null()) return code;
}
Label miss;
HandlerFrontendHeader(object, holder, name, check, &miss);
GenerateJumpFunction(object, function);
HandlerFrontendFooter(&miss);
// Return the generated code.
return GetCode(function);
}
Register LoadStubCompiler::HandlerFrontendHeader(
Handle<Type> type,
Register object_reg,
......
......@@ -919,17 +919,7 @@ class CallStubCompiler: public StubCompiler {
Label* miss);
void HandlerFrontendFooter(Label* miss);
void GenerateJumpFunctionIgnoreReceiver(Handle<JSFunction> function);
void GenerateJumpFunction(Handle<Object> object,
Handle<JSFunction> function);
void GenerateJumpFunction(Handle<Object> object,
Register function,
Label* miss);
// Use to call |actual_closure|, a closure with the same shared function info
// as |function|.
void GenerateJumpFunction(Handle<Object> object,
Register actual_closure,
Handle<JSFunction> function);
void CompileHandlerBackend(Handle<JSFunction> function);
Handle<Code> CompileCallConstant(Handle<Object> object,
Handle<JSObject> holder,
......@@ -978,8 +968,6 @@ class CallStubCompiler: public StubCompiler {
Handle<JSFunction> function,
Handle<String> name);
CallKind call_kind();
Handle<Code> GetCode(Code::StubType type, Handle<Name> name);
Handle<Code> GetCode(Handle<JSFunction> function);
......@@ -993,8 +981,6 @@ class CallStubCompiler: public StubCompiler {
Handle<JSFunction> function,
Label* miss);
void GenerateFunctionCheck(Register function, Register scratch, Label* miss);
// Generates a jump to CallIC miss stub.
void GenerateMissBranch();
......
......@@ -3601,7 +3601,7 @@ void MacroAssembler::InvokeFunction(Register function,
}
void MacroAssembler::InvokeFunction(Register function,
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
......@@ -3610,27 +3610,18 @@ void MacroAssembler::InvokeFunction(Register function,
// You can't call a function without a valid frame.
ASSERT(flag == JUMP_FUNCTION || has_frame());
ASSERT(function.is(rdi));
movq(rsi, FieldOperand(function, JSFunction::kContextOffset));
// Advances rdx to the end of the Code object header, to the start of
// the executable code.
movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
// Get the function and setup the context.
Move(rdi, function);
movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
// We call indirectly through the code field in the function to
// allow recompilation to take effect without changing any of the
// call sites.
movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind);
}
void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind) {
Move(rdi, function);
InvokeFunction(rdi, expected, actual, flag, call_wrapper, call_kind);
}
void MacroAssembler::InvokePrologue(const ParameterCount& expected,
const ParameterCount& actual,
Handle<Code> code_constant,
......
......@@ -371,13 +371,6 @@ class MacroAssembler: public Assembler {
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Register function,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper,
CallKind call_kind);
void InvokeFunction(Handle<JSFunction> function,
const ParameterCount& expected,
const ParameterCount& actual,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment