Revision: 22856
Author: [email protected]
Date: Tue Aug 5 10:27:10 2014 UTC
Log: Remove special frontend for callbacks with slow-mode holders.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/436273002
http://code.google.com/p/v8/source/detail?r=22856
Modified:
/branches/bleeding_edge/src/arm/stub-cache-arm.cc
/branches/bleeding_edge/src/arm64/stub-cache-arm64.cc
/branches/bleeding_edge/src/ia32/stub-cache-ia32.cc
/branches/bleeding_edge/src/ic.cc
/branches/bleeding_edge/src/mips/stub-cache-mips.cc
/branches/bleeding_edge/src/mips64/stub-cache-mips64.cc
/branches/bleeding_edge/src/stub-cache.cc
/branches/bleeding_edge/src/stub-cache.h
/branches/bleeding_edge/src/x64/stub-cache-x64.cc
/branches/bleeding_edge/src/x87/stub-cache-x87.cc
=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Tue Aug 5 10:27:10
2014 UTC
@@ -836,50 +836,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- DCHECK(!reg.is(scratch4()));
-
- // Load the properties dictionary.
- Register dictionary = scratch4();
- __ ldr(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch3 contains the
- // pointer into the dictionary. Check that the value is the callback.
- Register pointer = scratch3();
- const int kElementsStartOffset = NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ ldr(scratch2(), FieldMemOperand(pointer, kValueOffset));
- __ cmp(scratch2(), Operand(callback));
- __ b(ne, &miss);
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/arm64/stub-cache-arm64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/arm64/stub-cache-arm64.cc Tue Aug 5
10:27:10 2014 UTC
@@ -792,51 +792,6 @@
__ Bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
- // FrontendHeader can return its result into scratch1() so do not
- // use it.
- Register scratch2 = this->scratch2();
- Register scratch3 = this->scratch3();
- Register dictionary = this->scratch4();
- DCHECK(!AreAliased(reg, scratch2, scratch3, dictionary));
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- // Load the properties dictionary.
- __ Ldr(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2,
- scratch3);
- __ Bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch3 contains the
- // pointer into the dictionary. Check that the value is the callback.
- Register pointer = scratch3;
- const int kElementsStartOffset = NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ Ldr(scratch2, FieldMemOperand(pointer, kValueOffset));
- __ Cmp(scratch2, Operand(callback));
- __ B(ne, &miss);
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Tue Aug 5 10:27:10
2014 UTC
@@ -805,63 +805,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- Register dictionary = scratch1();
- bool must_preserve_dictionary_reg = reg.is(dictionary);
-
- // Load the properties dictionary.
- if (must_preserve_dictionary_reg) {
- __ push(dictionary);
- }
- __ mov(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done, pop_and_miss;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &pop_and_miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&pop_and_miss);
- if (must_preserve_dictionary_reg) {
- __ pop(dictionary);
- }
- __ jmp(&miss);
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch2 contains the
- // index into the dictionary. Check that the value is the callback.
- Register index = scratch2();
- const int kElementsStartOffset =
- NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ mov(scratch3(),
- Operand(dictionary, index, times_4, kValueOffset -
kHeapObjectTag));
- if (must_preserve_dictionary_reg) {
- __ pop(dictionary);
- }
- __ cmp(scratch3(), callback);
- __ j(not_equal, &miss);
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/ic.cc Mon Aug 4 11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/ic.cc Tue Aug 5 10:27:10 2014 UTC
@@ -1001,14 +1001,13 @@
type)) {
return slow_stub();
}
- if (holder->IsGlobalObject()) return slow_stub();
+ if (!holder->HasFastProperties()) return slow_stub();
return compiler.CompileLoadCallback(name, info);
}
if (accessors->IsAccessorPair()) {
Handle<Object>
getter(Handle<AccessorPair>::cast(accessors)->getter(),
isolate());
if (!getter->IsJSFunction()) return slow_stub();
- if (holder->IsGlobalObject()) return slow_stub();
if (!holder->HasFastProperties()) return slow_stub();
Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
if (!object->IsJSObject() && !function->IsBuiltin() &&
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Mon Aug 4 14:30:01
2014 UTC
+++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Tue Aug 5 10:27:10
2014 UTC
@@ -835,49 +835,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- DCHECK(!reg.is(scratch4()));
-
- // Load the properties dictionary.
- Register dictionary = scratch4();
- __ lw(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch3 contains the
- // pointer into the dictionary. Check that the value is the callback.
- Register pointer = scratch3();
- const int kElementsStartOffset = NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ lw(scratch2(), FieldMemOperand(pointer, kValueOffset));
- __ Branch(&miss, ne, scratch2(), Operand(callback));
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/mips64/stub-cache-mips64.cc Mon Aug 4
14:30:01 2014 UTC
+++ /branches/bleeding_edge/src/mips64/stub-cache-mips64.cc Tue Aug 5
10:27:10 2014 UTC
@@ -839,49 +839,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- DCHECK(!reg.is(scratch4()));
-
- // Load the properties dictionary.
- Register dictionary = scratch4();
- __ ld(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch3 contains the
- // pointer into the dictionary. Check that the value is the callback.
- Register pointer = scratch3();
- const int kElementsStartOffset = NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ ld(scratch2(), FieldMemOperand(pointer, kValueOffset));
- __ Branch(&miss, ne, scratch2(), Operand(callback));
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/stub-cache.cc Mon Aug 4 11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/stub-cache.cc Tue Aug 5 10:27:10 2014 UTC
@@ -870,7 +870,7 @@
Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
Handle<Name> name, Handle<ExecutableAccessorInfo> callback) {
- Register reg = CallbackFrontend(receiver(), name, callback);
+ Register reg = Frontend(receiver(), name);
GenerateLoadCallback(reg, callback);
return GetCode(kind(), Code::FAST, name);
}
@@ -879,8 +879,7 @@
Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
Handle<Name> name, const CallOptimization& call_optimization) {
DCHECK(call_optimization.is_simple_api_call());
- Handle<JSFunction> callback = call_optimization.constant_function();
- CallbackFrontend(receiver(), name, callback);
+ Frontend(receiver(), name);
Handle<Map> receiver_map = IC::TypeToMap(*type(), isolate());
GenerateFastApiCall(
masm(), call_optimization, receiver_map,
@@ -912,26 +911,18 @@
void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor(
Register interceptor_reg, Handle<Name> name, LookupResult* lookup) {
Handle<JSObject> real_named_property_holder(lookup->holder());
+
+ set_type_for_object(holder());
+ set_holder(real_named_property_holder);
+ Register reg = Frontend(interceptor_reg, name);
+
if (lookup->IsField()) {
- FieldIndex field = lookup->GetFieldIndex();
- if (holder().is_identical_to(real_named_property_holder)) {
- GenerateLoadField(interceptor_reg, field, lookup->representation());
- } else {
- set_type_for_object(holder());
- set_holder(real_named_property_holder);
- Register reg = Frontend(interceptor_reg, name);
- GenerateLoadField(reg, field, lookup->representation());
- }
+ GenerateLoadField(reg, lookup->GetFieldIndex(),
lookup->representation());
} else {
- // We found CALLBACKS property in prototype chain of interceptor's
holder.
DCHECK(lookup->type() == CALLBACKS);
Handle<ExecutableAccessorInfo> callback(
ExecutableAccessorInfo::cast(lookup->GetCallbackObject()));
DCHECK(callback->getter() != NULL);
-
- set_type_for_object(holder());
- set_holder(real_named_property_holder);
- Register reg = CallbackFrontend(interceptor_reg, name, callback);
GenerateLoadCallback(reg, callback);
}
}
=======================================
--- /branches/bleeding_edge/src/stub-cache.h Mon Aug 4 11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/stub-cache.h Tue Aug 5 10:27:10 2014 UTC
@@ -518,8 +518,6 @@
virtual void FrontendFooter(Handle<Name> name, Label* miss);
private:
- Register CallbackFrontend(Register object_reg, Handle<Name> name,
- Handle<Object> callback);
Handle<Code> CompileLoadNonexistent(Handle<Name> name);
void GenerateLoadField(Register reg,
FieldIndex field,
=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Tue Aug 5 10:27:10
2014 UTC
@@ -746,54 +746,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- DCHECK(!reg.is(scratch4()));
-
- // Load the properties dictionary.
- Register dictionary = scratch4();
- __ movp(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch3 contains the
- // index into the dictionary. Check that the value is the callback.
- Register index = scratch3();
- const int kElementsStartOffset =
- NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ movp(scratch2(),
- Operand(dictionary, index, times_pointer_size,
- kValueOffset - kHeapObjectTag));
- __ Move(scratch3(), callback, RelocInfo::EMBEDDED_OBJECT);
- __ cmpp(scratch2(), scratch3());
- __ j(not_equal, &miss);
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
=======================================
--- /branches/bleeding_edge/src/x87/stub-cache-x87.cc Tue Aug 5 03:24:18
2014 UTC
+++ /branches/bleeding_edge/src/x87/stub-cache-x87.cc Tue Aug 5 10:27:10
2014 UTC
@@ -804,63 +804,6 @@
__ bind(&success);
}
}
-
-
-Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
- Handle<Name> name,
- Handle<Object>
callback) {
- Label miss;
-
- Register reg = FrontendHeader(object_reg, name, &miss);
-
- if (!holder()->HasFastProperties()) {
- DCHECK(!holder()->IsGlobalObject());
- DCHECK(!reg.is(scratch2()));
- DCHECK(!reg.is(scratch3()));
- Register dictionary = scratch1();
- bool must_preserve_dictionary_reg = reg.is(dictionary);
-
- // Load the properties dictionary.
- if (must_preserve_dictionary_reg) {
- __ push(dictionary);
- }
- __ mov(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset));
-
- // Probe the dictionary.
- Label probe_done, pop_and_miss;
- NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
- &pop_and_miss,
- &probe_done,
- dictionary,
- this->name(),
- scratch2(),
- scratch3());
- __ bind(&pop_and_miss);
- if (must_preserve_dictionary_reg) {
- __ pop(dictionary);
- }
- __ jmp(&miss);
- __ bind(&probe_done);
-
- // If probing finds an entry in the dictionary, scratch2 contains the
- // index into the dictionary. Check that the value is the callback.
- Register index = scratch2();
- const int kElementsStartOffset =
- NameDictionary::kHeaderSize +
- NameDictionary::kElementsStartIndex * kPointerSize;
- const int kValueOffset = kElementsStartOffset + kPointerSize;
- __ mov(scratch3(),
- Operand(dictionary, index, times_4, kValueOffset -
kHeapObjectTag));
- if (must_preserve_dictionary_reg) {
- __ pop(dictionary);
- }
- __ cmp(scratch3(), callback);
- __ j(not_equal, &miss);
- }
-
- FrontendFooter(name, &miss);
- return reg;
-}
void NamedLoadHandlerCompiler::GenerateLoadField(
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.