Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 426633002: Encapsulate type in the PropertyHandlerCompiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/ic.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index 55376071472930e2f51e39b51f309e30f9851319..4b63c5f2024456be5121a3fb772fe37880b7de87 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -693,10 +693,10 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm,
Register PropertyHandlerCompiler::CheckPrototypes(
- Handle<HeapType> type, Register object_reg, Handle<JSObject> holder,
- Register holder_reg, Register scratch1, Register scratch2,
- Handle<Name> name, Label* miss, PrototypeCheckType check) {
- Handle<Map> receiver_map(IC::TypeToMap(*type, isolate()));
+ Register object_reg, Handle<JSObject> holder, Register holder_reg,
+ Register scratch1, Register scratch2, Handle<Name> name, Label* miss,
+ PrototypeCheckType check) {
+ Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));
// Make sure there's no overlap between holder and object registers.
ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
@@ -708,8 +708,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
int depth = 0;
Handle<JSObject> current = Handle<JSObject>::null();
- if (type->IsConstant()) current =
- Handle<JSObject>::cast(type->AsConstant()->Value());
+ if (type()->IsConstant())
+ current = Handle<JSObject>::cast(type()->AsConstant()->Value());
Handle<JSObject> prototype = Handle<JSObject>::null();
Handle<Map> current_map = receiver_map;
Handle<Map> holder_map(holder->map());
@@ -824,14 +824,13 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
}
-Register NamedLoadHandlerCompiler::CallbackFrontend(Handle<HeapType> type,
- Register object_reg,
+Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
Handle<JSObject> holder,
Handle<Name> name,
Handle<Object> callback) {
Label miss;
- Register reg = FrontendHeader(type, object_reg, holder, name, &miss);
+ Register reg = FrontendHeader(object_reg, holder, name, &miss);
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
ASSERT(!reg.is(scratch2()));
@@ -944,9 +943,8 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
- Register holder_reg, Handle<Object> object,
- Handle<JSObject> interceptor_holder, LookupResult* lookup,
- Handle<Name> name) {
+ Register holder_reg, Handle<JSObject> interceptor_holder,
+ LookupResult* lookup, Handle<Name> name) {
ASSERT(interceptor_holder->HasNamedInterceptor());
ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
@@ -959,10 +957,12 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
compile_followup_inline = true;
} else if (lookup->type() == CALLBACKS &&
lookup->GetCallbackObject()->IsExecutableAccessorInfo()) {
- ExecutableAccessorInfo* callback =
- ExecutableAccessorInfo::cast(lookup->GetCallbackObject());
- compile_followup_inline = callback->getter() != NULL &&
- callback->IsCompatibleReceiver(*object);
+ Handle<ExecutableAccessorInfo> callback(
+ ExecutableAccessorInfo::cast(lookup->GetCallbackObject()));
+ compile_followup_inline =
+ callback->getter() != NULL &&
+ ExecutableAccessorInfo::IsCompatibleReceiverType(isolate(), callback,
+ type());
}
}
@@ -1044,8 +1044,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
- Register holder_reg =
- Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name);
+ Register holder_reg = Frontend(receiver(), holder, name);
__ pop(scratch1()); // remove the return address
__ push(receiver());
@@ -1173,8 +1172,8 @@ Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic(
Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
- Handle<HeapType> type, Handle<JSObject> last, Handle<Name> name) {
- NonexistentFrontend(type, last, name);
+ Handle<JSObject> last, Handle<Name> name) {
+ NonexistentFrontend(last, name);
// Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value.
@@ -1257,25 +1256,26 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
- Handle<HeapType> type, Handle<GlobalObject> global,
- Handle<PropertyCell> cell, Handle<Name> name, bool is_dont_delete) {
+ Handle<GlobalObject> global, Handle<PropertyCell> cell, Handle<Name> name,
+ bool is_dont_delete) {
Label miss;
- FrontendHeader(type, receiver(), global, name, &miss);
+ FrontendHeader(receiver(), global, name, &miss);
// Get the value from the cell.
+ Register result = StoreIC::ValueRegister();
if (masm()->serializer_enabled()) {
- __ mov(eax, Immediate(cell));
- __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset));
+ __ mov(result, Immediate(cell));
+ __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
} else {
- __ mov(eax, Operand::ForCell(cell));
+ __ mov(result, Operand::ForCell(cell));
}
// Check for deleted property if property can actually be deleted.
if (!is_dont_delete) {
- __ cmp(eax, factory()->the_hole_value());
+ __ cmp(result, factory()->the_hole_value());
__ j(equal, &miss);
} else if (FLAG_debug_code) {
- __ cmp(eax, factory()->the_hole_value());
+ __ cmp(result, factory()->the_hole_value());
__ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
}
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/ic.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698