X87: The IC exposes a register definition.

port r22011

original commit message:
  Centralize a register definition in an IC that provides:
  1) symbolic names for the register (like, edx == receiver)
  2) defines ordering when passed on the stack

  Code that implements or uses the IC should use this definition instead of "knowing" what the registers are. Or at least have the definition to validate it's assumptions.

  As a side effect of avoiding runtime static initializers (enforced by tools/check-static-initializers.sh, neat), I gave ownership of the registers array to CodeStubInterfaceDescriptor. This prompted a cleanup of that struct

BUG=
R=weiliang.lin@intel.com

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8313c523
This diff is collapsed.
......@@ -199,7 +199,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
intptr_t handler =
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler());
int params = descriptor->GetHandlerParameterCount();
output_frame->SetRegister(eax.code(), params);
output_frame->SetRegister(ebx.code(), handler);
......
......@@ -1025,6 +1025,19 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
}
// IC register specifications
const Register LoadIC::ReceiverRegister() { return edx; }
const Register LoadIC::NameRegister() { return ecx; }
const Register KeyedLoadIC::ReceiverRegister() {
return LoadIC::ReceiverRegister();
}
const Register KeyedLoadIC::NameRegister() { return LoadIC::NameRegister(); }
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- ecx : key
......
......@@ -1282,14 +1282,18 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
Register* LoadStubCompiler::registers() {
// receiver, name, scratch1, scratch2, scratch3, scratch4.
static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg };
Register receiver = LoadIC::ReceiverRegister();
Register name = LoadIC::NameRegister();
static Register registers[] = { receiver, name, ebx, eax, edi, no_reg };
return registers;
}
Register* KeyedLoadStubCompiler::registers() {
// receiver, name, scratch1, scratch2, scratch3, scratch4.
static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg };
Register receiver = KeyedLoadIC::ReceiverRegister();
Register name = KeyedLoadIC::NameRegister();
static Register registers[] = { receiver, name, ebx, eax, edi, no_reg };
return registers;
}
......
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