X87: Restructure the IC / Handler compilers

port r22622.

original commit message:
  Restructure the IC / Handler compilers.

BUG=
R=weiliang.lin@intel.com

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

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22658 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 31dd24fe
...@@ -558,22 +558,14 @@ void MathPowStub::Generate(MacroAssembler* masm) { ...@@ -558,22 +558,14 @@ void MathPowStub::Generate(MacroAssembler* masm) {
void FunctionPrototypeStub::Generate(MacroAssembler* masm) { void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- ecx : name
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
Label miss; Label miss;
Register receiver = LoadIC::ReceiverRegister();
if (kind() == Code::KEYED_LOAD_IC) { NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax,
__ cmp(ecx, Immediate(isolate()->factory()->prototype_string())); ebx, &miss);
__ j(not_equal, &miss);
}
StubCompiler::GenerateLoadFunctionPrototype(masm, edx, eax, ebx, &miss);
__ bind(&miss); __ bind(&miss);
StubCompiler::TailCallBuiltin( PropertyAccessCompiler::TailCallBuiltin(
masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
} }
......
...@@ -114,12 +114,9 @@ static void ProbeTable(Isolate* isolate, ...@@ -114,12 +114,9 @@ static void ProbeTable(Isolate* isolate,
} }
void StubCompiler::GenerateDictionaryNegativeLookup(MacroAssembler* masm, void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
Label* miss_label, MacroAssembler* masm, Label* miss_label, Register receiver,
Register receiver, Handle<Name> name, Register scratch0, Register scratch1) {
Handle<Name> name,
Register scratch0,
Register scratch1) {
ASSERT(name->IsUniqueName()); ASSERT(name->IsUniqueName());
ASSERT(!receiver.is(scratch0)); ASSERT(!receiver.is(scratch0));
Counters* counters = masm->isolate()->counters(); Counters* counters = masm->isolate()->counters();
...@@ -233,21 +230,8 @@ void StubCache::GenerateProbe(MacroAssembler* masm, ...@@ -233,21 +230,8 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
} }
void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
int index, MacroAssembler* masm, int index, Register prototype, Label* miss) {
Register prototype) {
__ LoadGlobalFunction(index, prototype);
__ LoadGlobalFunctionInitialMap(prototype, prototype);
// Load the prototype from the initial map.
__ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
}
void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
MacroAssembler* masm,
int index,
Register prototype,
Label* miss) {
// Get the global function with the given index. // Get the global function with the given index.
Handle<JSFunction> function( Handle<JSFunction> function(
JSFunction::cast(masm->isolate()->native_context()->get(index))); JSFunction::cast(masm->isolate()->native_context()->get(index)));
...@@ -266,52 +250,15 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( ...@@ -266,52 +250,15 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
} }
void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
Register receiver, MacroAssembler* masm, Register receiver, Register scratch1,
Register scratch, Register scratch2, Label* miss_label) {
Label* miss_label) {
// Check that the receiver isn't a smi.
__ JumpIfSmi(receiver, miss_label);
// Check that the object is a JS array.
__ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch);
__ j(not_equal, miss_label);
// Load length directly from the JS array.
__ mov(eax, FieldOperand(receiver, JSArray::kLengthOffset));
__ ret(0);
}
void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
Register receiver,
Register scratch1,
Register scratch2,
Label* miss_label) {
__ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
__ mov(eax, scratch1); __ mov(eax, scratch1);
__ ret(0); __ ret(0);
} }
void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
Register dst,
Register src,
bool inobject,
int index,
Representation representation) {
ASSERT(!representation.IsDouble());
int offset = index * kPointerSize;
if (!inobject) {
// Calculate the offset into the properties array.
offset = offset + FixedArray::kHeaderSize;
__ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset));
src = dst;
}
__ mov(dst, FieldOperand(src, offset));
}
static void PushInterceptorArguments(MacroAssembler* masm, static void PushInterceptorArguments(MacroAssembler* masm,
Register receiver, Register receiver,
Register holder, Register holder,
...@@ -351,14 +298,10 @@ static void CompileCallLoadPropertyWithInterceptor( ...@@ -351,14 +298,10 @@ static void CompileCallLoadPropertyWithInterceptor(
// This function uses push() to generate smaller, faster code than // This function uses push() to generate smaller, faster code than
// the version above. It is an optimization that should will be removed // the version above. It is an optimization that should will be removed
// when api call ICs are generated in hydrogen. // when api call ICs are generated in hydrogen.
void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, void PropertyHandlerCompiler::GenerateFastApiCall(
const CallOptimization& optimization, MacroAssembler* masm, const CallOptimization& optimization,
Handle<Map> receiver_map, Handle<Map> receiver_map, Register receiver, Register scratch_in,
Register receiver, bool is_store, int argc, Register* values) {
Register scratch_in,
bool is_store,
int argc,
Register* values) {
// Copy return value. // Copy return value.
__ pop(scratch_in); __ pop(scratch_in);
// receiver // receiver
...@@ -428,9 +371,9 @@ void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, ...@@ -428,9 +371,9 @@ void StubCompiler::GenerateFastApiCall(MacroAssembler* masm,
} }
void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, void NamedStoreHandlerCompiler::GenerateRestoreName(MacroAssembler* masm,
Label* label, Label* label,
Handle<Name> name) { Handle<Name> name) {
if (!label->is_unused()) { if (!label->is_unused()) {
__ bind(label); __ bind(label);
__ mov(this->name(), Immediate(name)); __ mov(this->name(), Immediate(name));
...@@ -441,11 +384,9 @@ void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, ...@@ -441,11 +384,9 @@ void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm,
// Generate code to check that a global property cell is empty. Create // Generate code to check that a global property cell is empty. Create
// the property cell at compilation time if no cell exists for the // the property cell at compilation time if no cell exists for the
// property. // property.
void StubCompiler::GenerateCheckPropertyCell(MacroAssembler* masm, void PropertyHandlerCompiler::GenerateCheckPropertyCell(
Handle<JSGlobalObject> global, MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
Handle<Name> name, Register scratch, Label* miss) {
Register scratch,
Label* miss) {
Handle<PropertyCell> cell = Handle<PropertyCell> cell =
JSGlobalObject::EnsurePropertyCell(global, name); JSGlobalObject::EnsurePropertyCell(global, name);
ASSERT(cell->value()->IsTheHole()); ASSERT(cell->value()->IsTheHole());
...@@ -461,12 +402,9 @@ void StubCompiler::GenerateCheckPropertyCell(MacroAssembler* masm, ...@@ -461,12 +402,9 @@ void StubCompiler::GenerateCheckPropertyCell(MacroAssembler* masm,
} }
void StoreStubCompiler::GenerateNegativeHolderLookup( void NamedStoreHandlerCompiler::GenerateNegativeHolderLookup(
MacroAssembler* masm, MacroAssembler* masm, Handle<JSObject> holder, Register holder_reg,
Handle<JSObject> holder, Handle<Name> name, Label* miss) {
Register holder_reg,
Handle<Name> name,
Label* miss) {
if (holder->IsJSGlobalObject()) { if (holder->IsJSGlobalObject()) {
GenerateCheckPropertyCell( GenerateCheckPropertyCell(
masm, Handle<JSGlobalObject>::cast(holder), name, scratch1(), miss); masm, Handle<JSGlobalObject>::cast(holder), name, scratch1(), miss);
...@@ -479,19 +417,11 @@ void StoreStubCompiler::GenerateNegativeHolderLookup( ...@@ -479,19 +417,11 @@ void StoreStubCompiler::GenerateNegativeHolderLookup(
// Receiver_reg is preserved on jumps to miss_label, but may be destroyed if // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if
// store is successful. // store is successful.
void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, void NamedStoreHandlerCompiler::GenerateStoreTransition(
Handle<JSObject> object, MacroAssembler* masm, Handle<JSObject> object, LookupResult* lookup,
LookupResult* lookup, Handle<Map> transition, Handle<Name> name, Register receiver_reg,
Handle<Map> transition, Register storage_reg, Register value_reg, Register scratch1,
Handle<Name> name, Register scratch2, Register unused, Label* miss_label, Label* slow) {
Register receiver_reg,
Register storage_reg,
Register value_reg,
Register scratch1,
Register scratch2,
Register unused,
Label* miss_label,
Label* slow) {
int descriptor = transition->LastAdded(); int descriptor = transition->LastAdded();
DescriptorArray* descriptors = transition->instance_descriptors(); DescriptorArray* descriptors = transition->instance_descriptors();
PropertyDetails details = descriptors->GetDetails(descriptor); PropertyDetails details = descriptors->GetDetails(descriptor);
...@@ -647,15 +577,10 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -647,15 +577,10 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
// Both name_reg and receiver_reg are preserved on jumps to miss_label, // Both name_reg and receiver_reg are preserved on jumps to miss_label,
// but may be destroyed if store is successful. // but may be destroyed if store is successful.
void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, void NamedStoreHandlerCompiler::GenerateStoreField(
Handle<JSObject> object, MacroAssembler* masm, Handle<JSObject> object, LookupResult* lookup,
LookupResult* lookup, Register receiver_reg, Register name_reg, Register value_reg,
Register receiver_reg, Register scratch1, Register scratch2, Label* miss_label) {
Register name_reg,
Register value_reg,
Register scratch1,
Register scratch2,
Label* miss_label) {
// Stub never generated for non-global objects that require access // Stub never generated for non-global objects that require access
// checks. // checks.
ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
...@@ -757,7 +682,8 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, ...@@ -757,7 +682,8 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
} }
void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm,
Handle<Code> code) {
__ jmp(code, RelocInfo::CODE_TARGET); __ jmp(code, RelocInfo::CODE_TARGET);
} }
...@@ -766,15 +692,10 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { ...@@ -766,15 +692,10 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
Register StubCompiler::CheckPrototypes(Handle<HeapType> type, Register PropertyHandlerCompiler::CheckPrototypes(
Register object_reg, Handle<HeapType> type, Register object_reg, Handle<JSObject> holder,
Handle<JSObject> holder, Register holder_reg, Register scratch1, Register scratch2,
Register holder_reg, Handle<Name> name, Label* miss, PrototypeCheckType check) {
Register scratch1,
Register scratch2,
Handle<Name> name,
Label* miss,
PrototypeCheckType check) {
Handle<Map> receiver_map(IC::TypeToMap(*type, isolate())); Handle<Map> receiver_map(IC::TypeToMap(*type, isolate()));
// Make sure there's no overlap between holder and object registers. // Make sure there's no overlap between holder and object registers.
...@@ -881,7 +802,7 @@ Register StubCompiler::CheckPrototypes(Handle<HeapType> type, ...@@ -881,7 +802,7 @@ Register StubCompiler::CheckPrototypes(Handle<HeapType> type,
} }
void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
if (!miss->is_unused()) { if (!miss->is_unused()) {
Label success; Label success;
__ jmp(&success); __ jmp(&success);
...@@ -892,7 +813,7 @@ void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { ...@@ -892,7 +813,7 @@ void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
} }
void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
if (!miss->is_unused()) { if (!miss->is_unused()) {
Label success; Label success;
__ jmp(&success); __ jmp(&success);
...@@ -903,15 +824,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { ...@@ -903,15 +824,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
} }
Register LoadStubCompiler::CallbackHandlerFrontend( Register NamedLoadHandlerCompiler::CallbackFrontend(Handle<HeapType> type,
Handle<HeapType> type, Register object_reg,
Register object_reg, Handle<JSObject> holder,
Handle<JSObject> holder, Handle<Name> name,
Handle<Name> name, Handle<Object> callback) {
Handle<Object> callback) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); Register reg = FrontendHeader(type, object_reg, holder, name, &miss);
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
ASSERT(!reg.is(scratch2())); ASSERT(!reg.is(scratch2()));
...@@ -957,24 +877,22 @@ Register LoadStubCompiler::CallbackHandlerFrontend( ...@@ -957,24 +877,22 @@ Register LoadStubCompiler::CallbackHandlerFrontend(
__ j(not_equal, &miss); __ j(not_equal, &miss);
} }
HandlerFrontendFooter(name, &miss); FrontendFooter(name, &miss);
return reg; return reg;
} }
void LoadStubCompiler::GenerateLoadField(Register reg, void NamedLoadHandlerCompiler::GenerateLoadField(
Handle<JSObject> holder, Register reg, Handle<JSObject> holder, FieldIndex field,
FieldIndex field, Representation representation) {
Representation representation) {
if (!reg.is(receiver())) __ mov(receiver(), reg); if (!reg.is(receiver())) __ mov(receiver(), reg);
LoadFieldStub stub(isolate(), field); LoadFieldStub stub(isolate(), field);
GenerateTailCall(masm(), stub.GetCode()); GenerateTailCall(masm(), stub.GetCode());
} }
void LoadStubCompiler::GenerateLoadCallback( void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Register reg, Handle<ExecutableAccessorInfo> callback) {
Handle<ExecutableAccessorInfo> callback) {
// Insert additional parameters into the stack frame above return address. // Insert additional parameters into the stack frame above return address.
ASSERT(!scratch3().is(reg)); ASSERT(!scratch3().is(reg));
__ pop(scratch3()); // Get return address to place it below. __ pop(scratch3()); // Get return address to place it below.
...@@ -1018,18 +936,16 @@ void LoadStubCompiler::GenerateLoadCallback( ...@@ -1018,18 +936,16 @@ void LoadStubCompiler::GenerateLoadCallback(
} }
void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
// Return the constant value. // Return the constant value.
__ LoadObject(eax, value); __ LoadObject(eax, value);
__ ret(0); __ ret(0);
} }
void LoadStubCompiler::GenerateLoadInterceptor( void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
Register holder_reg, Register holder_reg, Handle<Object> object,
Handle<Object> object, Handle<JSObject> interceptor_holder, LookupResult* lookup,
Handle<JSObject> interceptor_holder,
LookupResult* lookup,
Handle<Name> name) { Handle<Name> name) {
ASSERT(interceptor_holder->HasNamedInterceptor()); ASSERT(interceptor_holder->HasNamedInterceptor());
ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
...@@ -1124,13 +1040,11 @@ void LoadStubCompiler::GenerateLoadInterceptor( ...@@ -1124,13 +1040,11 @@ void LoadStubCompiler::GenerateLoadInterceptor(
} }
Handle<Code> StoreStubCompiler::CompileStoreCallback( Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name,
Handle<JSObject> holder,
Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) { Handle<ExecutableAccessorInfo> callback) {
Register holder_reg = HandlerFrontend( Register holder_reg =
IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name);
__ pop(scratch1()); // remove the return address __ pop(scratch1()); // remove the return address
__ push(receiver()); __ push(receiver());
...@@ -1154,10 +1068,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -1154,10 +1068,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void StoreStubCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Handle<HeapType> type,
Register receiver,
Handle<JSFunction> setter) { Handle<JSFunction> setter) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- esp[0] : return address // -- esp[0] : return address
...@@ -1201,9 +1113,8 @@ void StoreStubCompiler::GenerateStoreViaSetter( ...@@ -1201,9 +1113,8 @@ void StoreStubCompiler::GenerateStoreViaSetter(
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
Handle<Code> StoreStubCompiler::CompileStoreInterceptor( Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
Handle<JSObject> object, Handle<JSObject> object, Handle<Name> name) {
Handle<Name> name) {
__ pop(scratch1()); // remove the return address __ pop(scratch1()); // remove the return address
__ push(receiver()); __ push(receiver());
__ push(this->name()); __ push(this->name());
...@@ -1220,7 +1131,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( ...@@ -1220,7 +1131,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
} }
void StoreStubCompiler::GenerateStoreArrayLength() { void NamedStoreHandlerCompiler::GenerateStoreArrayLength() {
// Prepare tail call to StoreIC_ArrayLength. // Prepare tail call to StoreIC_ArrayLength.
__ pop(scratch1()); // remove the return address __ pop(scratch1()); // remove the return address
__ push(receiver()); __ push(receiver());
...@@ -1234,9 +1145,8 @@ void StoreStubCompiler::GenerateStoreArrayLength() { ...@@ -1234,9 +1145,8 @@ void StoreStubCompiler::GenerateStoreArrayLength() {
} }
Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( Handle<Code> PropertyICCompiler::CompileIndexedStorePolymorphic(
MapHandleList* receiver_maps, MapHandleList* receiver_maps, CodeHandleList* handler_stubs,
CodeHandleList* handler_stubs,
MapHandleList* transitioned_maps) { MapHandleList* transitioned_maps) {
Label miss; Label miss;
__ JumpIfSmi(receiver(), &miss, Label::kNear); __ JumpIfSmi(receiver(), &miss, Label::kNear);
...@@ -1257,15 +1167,13 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( ...@@ -1257,15 +1167,13 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
TailCallBuiltin(masm(), MissBuiltin(kind())); TailCallBuiltin(masm(), MissBuiltin(kind()));
// Return the generated code. // Return the generated code.
return GetICCode( return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
} }
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type, Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
Handle<JSObject> last, Handle<HeapType> type, Handle<JSObject> last, Handle<Name> name) {
Handle<Name> name) { NonexistentFrontend(type, last, name);
NonexistentHandlerFrontend(type, last, name);
// Return undefined if maps of the full prototype chain are still the // Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value. // same and no global property with this name contains a value.
...@@ -1277,16 +1185,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type, ...@@ -1277,16 +1185,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
} }
Register* LoadStubCompiler::registers() { Register* PropertyAccessCompiler::load_calling_convention() {
// receiver, name, scratch1, scratch2, scratch3, scratch4.
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. // receiver, name, scratch1, scratch2, scratch3, scratch4.
Register receiver = LoadIC::ReceiverRegister(); Register receiver = LoadIC::ReceiverRegister();
Register name = LoadIC::NameRegister(); Register name = LoadIC::NameRegister();
...@@ -1295,12 +1194,7 @@ Register* KeyedLoadStubCompiler::registers() { ...@@ -1295,12 +1194,7 @@ Register* KeyedLoadStubCompiler::registers() {
} }
Register StoreStubCompiler::value() { Register* PropertyAccessCompiler::store_calling_convention() {
return StoreIC::ValueRegister();
}
Register* StoreStubCompiler::registers() {
// receiver, name, scratch1, scratch2, scratch3. // receiver, name, scratch1, scratch2, scratch3.
Register receiver = StoreIC::ReceiverRegister(); Register receiver = StoreIC::ReceiverRegister();
Register name = StoreIC::NameRegister(); Register name = StoreIC::NameRegister();
...@@ -1309,7 +1203,7 @@ Register* StoreStubCompiler::registers() { ...@@ -1309,7 +1203,7 @@ Register* StoreStubCompiler::registers() {
} }
Register* KeyedStoreStubCompiler::registers() { Register* PropertyAccessCompiler::keyed_store_calling_convention() {
// receiver, name, scratch1/map, scratch2, scratch3. // receiver, name, scratch1/map, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister(); Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister(); Register name = KeyedStoreIC::NameRegister();
...@@ -1319,14 +1213,16 @@ Register* KeyedStoreStubCompiler::registers() { ...@@ -1319,14 +1213,16 @@ Register* KeyedStoreStubCompiler::registers() {
} }
Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); }
#undef __ #undef __
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
Handle<HeapType> type, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register receiver, Handle<JSFunction> getter) {
Handle<JSFunction> getter) {
{ {
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
...@@ -1359,15 +1255,12 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -1359,15 +1255,12 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
Handle<Code> LoadStubCompiler::CompileLoadGlobal( Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
Handle<HeapType> type, Handle<HeapType> type, Handle<GlobalObject> global,
Handle<GlobalObject> global, Handle<PropertyCell> cell, Handle<Name> name, bool is_dont_delete) {
Handle<PropertyCell> cell,
Handle<Name> name,
bool is_dont_delete) {
Label miss; Label miss;
HandlerFrontendHeader(type, receiver(), global, name, &miss); FrontendHeader(type, receiver(), global, name, &miss);
// Get the value from the cell. // Get the value from the cell.
if (masm()->serializer_enabled()) { if (masm()->serializer_enabled()) {
__ mov(eax, Immediate(cell)); __ mov(eax, Immediate(cell));
...@@ -1390,19 +1283,18 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal( ...@@ -1390,19 +1283,18 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
// The code above already loads the result into the return register. // The code above already loads the result into the return register.
__ ret(0); __ ret(0);
HandlerFrontendFooter(name, &miss); FrontendFooter(name, &miss);
// Return the generated code. // Return the generated code.
return GetCode(kind(), Code::NORMAL, name); return GetCode(kind(), Code::NORMAL, name);
} }
Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
TypeHandleList* types, CodeHandleList* handlers,
CodeHandleList* handlers, Handle<Name> name,
Handle<Name> name, Code::StubType type,
Code::StubType type, IcCheckType check) {
IcCheckType check) {
Label miss; Label miss;
if (check == PROPERTY && if (check == PROPERTY &&
...@@ -1443,7 +1335,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( ...@@ -1443,7 +1335,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
// Return the generated code. // Return the generated code.
InlineCacheState state = InlineCacheState state =
number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC;
return GetICCode(kind(), type, name, state); return GetCode(kind(), type, name, state);
} }
...@@ -1451,7 +1343,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( ...@@ -1451,7 +1343,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( void IndexedHandlerCompiler::GenerateLoadDictionaryElement(
MacroAssembler* masm) { MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- ecx : key // -- ecx : key
......
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