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

Unified Diff: src/ic/x87/handler-compiler-x87.cc

Issue 2357323003: [ic][ia32][x87] Don't push/pop value/slot/vector in store handlers. (Closed)
Patch Set: Created 4 years, 3 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/ic/x64/handler-compiler-x64.cc ('k') | src/ic/x87/ic-compiler-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/x87/handler-compiler-x87.cc
diff --git a/src/ic/x87/handler-compiler-x87.cc b/src/ic/x87/handler-compiler-x87.cc
index 6096b7574306a0f39478425b32bc9e92a59af792..5eca3dc0cb7bc0d07d9943f0d2dd4e359d5c17c5 100644
--- a/src/ic/x87/handler-compiler-x87.cc
+++ b/src/ic/x87/handler-compiler-x87.cc
@@ -171,13 +171,10 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ add(esp, Immediate(StoreWithVectorDescriptor::kStackArgumentsCount *
kPointerSize));
}
-
- // receiver
+ // Write the receiver and arguments to stack frame.
__ push(receiver);
- // Write the arguments to stack frame.
if (is_store) {
- DCHECK(!receiver.is(store_parameter));
- DCHECK(!scratch.is(store_parameter));
+ DCHECK(!AreAliased(receiver, scratch, store_parameter));
__ push(store_parameter);
}
__ push(scratch);
@@ -274,8 +271,13 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder,
int accessor_index, int expected_arguments, Register scratch) {
// ----------- S t a t e -------------
- // -- esp[0] : return address
+ // -- esp[12] : value
+ // -- esp[8] : slot
+ // -- esp[4] : vector
+ // -- esp[0] : return address
// -----------------------------------
+ __ LoadParameterFromStack<Descriptor>(value(), Descriptor::kValue);
+
{
FrameScope scope(masm, StackFrame::INTERNAL);
@@ -631,11 +633,21 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
__ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor);
}
+void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() {
+ // Zap register aliases of the arguments passed on the stack to ensure they
+ // are properly loaded by the handler (debug-only).
+ STATIC_ASSERT(Descriptor::kPassLastArgsOnStack);
+ STATIC_ASSERT(Descriptor::kStackArgumentsCount == 3);
+ __ mov(Descriptor::ValueRegister(), Immediate(kDebugZapValue));
+ __ mov(Descriptor::SlotRegister(), Immediate(kDebugZapValue));
+ __ mov(Descriptor::VectorRegister(), Immediate(kDebugZapValue));
+}
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback,
LanguageMode language_mode) {
Register holder_reg = Frontend(name);
+ __ LoadParameterFromStack<Descriptor>(value(), Descriptor::kValue);
__ pop(scratch1()); // remove the return address
// Discard stack arguments.
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/ic/x87/ic-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698