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

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

Issue 422023003: Encapsulate the holder in the PropertyHolderCompilers (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/arm/stub-cache-arm.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/stub-cache-arm64.cc
diff --git a/src/arm64/stub-cache-arm64.cc b/src/arm64/stub-cache-arm64.cc
index 20431d6c09c2b1c86ccdc5a5c42e4314438fc316..1dca4f5c49e63bfe488a017a156a19f7679baba5 100644
--- a/src/arm64/stub-cache-arm64.cc
+++ b/src/arm64/stub-cache-arm64.cc
@@ -265,10 +265,10 @@ void NamedStoreHandlerCompiler::GenerateNegativeHolderLookup(
// may be clobbered. Upon branch to miss_label, the receiver and name registers
// have their original values.
void NamedStoreHandlerCompiler::GenerateStoreTransition(
- MacroAssembler* masm, Handle<JSObject> object, LookupResult* lookup,
- Handle<Map> transition, Handle<Name> name, Register receiver_reg,
- Register storage_reg, Register value_reg, Register scratch1,
- Register scratch2, Register scratch3, Label* miss_label, Label* slow) {
+ MacroAssembler* masm, LookupResult* lookup, Handle<Map> transition,
+ Handle<Name> name, Register receiver_reg, Register storage_reg,
+ Register value_reg, Register scratch1, Register scratch2, Register scratch3,
+ Label* miss_label, Label* slow) {
Label exit;
ASSERT(!AreAliased(receiver_reg, storage_reg, value_reg,
@@ -325,12 +325,12 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
NoReg, MUTABLE);
}
- // Stub never generated for non-global objects that require access checks.
- ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
+ // Stub never generated for objects that require access checks.
+ ASSERT(!transition->is_access_check_needed());
// Perform map transition for the receiver if necessary.
- if ((details.type() == FIELD) &&
- (object->map()->unused_property_fields() == 0)) {
+ if (details.type() == FIELD &&
+ Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) {
// The properties must be extended before we can store the value.
// We jump to a runtime call that extends the properties array.
__ Mov(scratch1, Operand(transition));
@@ -369,7 +369,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
// Adjust for the number of properties stored in the object. Even in the
// face of a transition we can use the old map here because the size of the
// object and the number of in-object properties is not going to change.
- index -= object->map()->inobject_properties();
+ index -= transition->inobject_properties();
// TODO(verwaest): Share this code as a code stub.
SmiCheck smi_check = representation.IsTagged()
@@ -377,7 +377,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
Register prop_reg = representation.IsDouble() ? storage_reg : value_reg;
if (index < 0) {
// Set the property straight into the object.
- int offset = object->map()->instance_size() + (index * kPointerSize);
+ int offset = transition->instance_size() + (index * kPointerSize);
__ Str(prop_reg, FieldMemOperand(receiver_reg, offset));
if (!representation.IsSmi()) {
@@ -682,8 +682,8 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm,
Register PropertyHandlerCompiler::CheckPrototypes(
- Register object_reg, Handle<JSObject> holder, Register holder_reg,
- Register scratch1, Register scratch2, Handle<Name> name, Label* miss,
+ Register object_reg, Register holder_reg, Register scratch1,
+ Register scratch2, Handle<Name> name, Label* miss,
PrototypeCheckType check) {
Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));
@@ -701,7 +701,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
}
Handle<JSObject> prototype = Handle<JSObject>::null();
Handle<Map> current_map = receiver_map;
- Handle<Map> holder_map(holder->map());
+ Handle<Map> holder_map(holder()->map());
// Traverse the prototype chain and check the maps in the prototype chain for
// fast and global objects or do negative lookup for normal objects.
while (!current_map.is_identical_to(holder_map)) {
@@ -818,12 +818,11 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<JSObject> holder,
Handle<Name> name,
Handle<Object> callback) {
Label miss;
- Register reg = FrontendHeader(object_reg, holder, name, &miss);
+ Register reg = FrontendHeader(object_reg, name, &miss);
// FrontendHeader can return its result into scratch1() so do not
// use it.
Register scratch2 = this->scratch2();
@@ -831,7 +830,8 @@ Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
Register dictionary = this->scratch4();
ASSERT(!AreAliased(reg, scratch2, scratch3, dictionary));
- if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
+ if (!holder()->HasFastProperties()) {
+ ASSERT(holder()->IsGlobalObject());
// Load the properties dictionary.
__ Ldr(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset));
@@ -863,8 +863,7 @@ Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
void NamedLoadHandlerCompiler::GenerateLoadField(
- Register reg, Handle<JSObject> holder, FieldIndex field,
- Representation representation) {
+ Register reg, FieldIndex field, Representation representation) {
__ Mov(receiver(), reg);
LoadFieldStub stub(isolate(), field);
GenerateTailCall(masm(), stub.GetCode());
@@ -932,13 +931,13 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
}
-void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
- Register holder_reg, Handle<JSObject> interceptor_holder,
- LookupResult* lookup, Handle<Name> name) {
+void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg,
+ LookupResult* lookup,
+ Handle<Name> name) {
ASSERT(!AreAliased(receiver(), this->name(),
scratch1(), scratch2(), scratch3()));
- ASSERT(interceptor_holder->HasNamedInterceptor());
- ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
+ ASSERT(holder()->HasNamedInterceptor());
+ ASSERT(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
// So far the most popular follow ups for interceptor loads are FIELD
// and CALLBACKS, so inline only them, other cases may be added later.
@@ -967,7 +966,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
// the holder and it is needed should the interceptor return without any
// result. The CALLBACKS case needs the receiver to be passed into C++ code,
// the FIELD case might cause a miss during the prototype check.
- bool must_perfrom_prototype_check = *interceptor_holder != lookup->holder();
+ bool must_perfrom_prototype_check = *holder() != lookup->holder();
bool must_preserve_receiver_reg = !receiver().Is(holder_reg) &&
(lookup->type() == CALLBACKS || must_perfrom_prototype_check);
@@ -984,7 +983,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
// interceptor's holder has been compiled before (see a caller
// of this method.)
CompileCallLoadPropertyWithInterceptor(
- masm(), receiver(), holder_reg, this->name(), interceptor_holder,
+ masm(), receiver(), holder_reg, this->name(), holder(),
IC::kLoadPropertyWithInterceptorOnly);
// Check if interceptor provided a value for property. If it's
@@ -1004,12 +1003,12 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
}
// Leave the internal frame.
}
- GenerateLoadPostInterceptor(holder_reg, interceptor_holder, name, lookup);
+ GenerateLoadPostInterceptor(holder_reg, name, lookup);
} else { // !compile_followup_inline
// Call the runtime system to load the interceptor.
// Check that the maps haven't changed.
- PushInterceptorArguments(
- masm(), receiver(), holder_reg, this->name(), interceptor_holder);
+ PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
+ holder());
ExternalReference ref =
ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor),
@@ -1021,10 +1020,10 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
- Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name,
+ Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback");
- Register holder_reg = Frontend(receiver(), holder, name);
+ Register holder_reg = Frontend(receiver(), name);
// Stub never generated for non-global objects that require access checks.
ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
@@ -1097,7 +1096,7 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
- Handle<JSObject> object, Handle<Name> name) {
+ Handle<Name> name) {
Label miss;
ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreInterceptor");
@@ -1115,8 +1114,8 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
- Handle<JSObject> last, Handle<Name> name) {
- NonexistentFrontend(last, name);
+ Handle<Name> name) {
+ NonexistentFrontend(name);
// Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value.
@@ -1205,10 +1204,9 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
- 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;
- FrontendHeader(receiver(), global, name, &miss);
+ FrontendHeader(receiver(), name, &miss);
// Get the value from the cell.
Register result = StoreIC::ValueRegister();
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698