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

Unified Diff: src/ia32/macro-assembler-ia32.h

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/ia32/code-stubs-ia32.cc ('k') | src/ic/arm/handler-compiler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.h
diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h
index 08cc7ceb64d66d7abe5448513e6494e985ea0525..2220ca7c4f921c1455132f77d8096e37848f1111 100644
--- a/src/ia32/macro-assembler-ia32.h
+++ b/src/ia32/macro-assembler-ia32.h
@@ -798,6 +798,24 @@ class MacroAssembler: public Assembler {
// may be bigger than 2^16 - 1. Requires a scratch register.
void Ret(int bytes_dropped, Register scratch);
+ // Emit code that loads |parameter_index|'th parameter from the stack to
+ // the register according to the CallInterfaceDescriptor definition.
+ // |sp_to_caller_sp_offset_in_words| specifies the number of words pushed
+ // below the caller's sp (on ia32 it's at least return address).
+ template <class Descriptor>
+ void LoadParameterFromStack(
+ Register reg, typename Descriptor::ParameterIndices parameter_index,
+ int sp_to_ra_offset_in_words = 1) {
+ DCHECK(Descriptor::kPassLastArgsOnStack);
+ DCHECK_LT(parameter_index, Descriptor::kParameterCount);
+ DCHECK_LE(Descriptor::kParameterCount - Descriptor::kStackArgumentsCount,
+ parameter_index);
+ int offset = (Descriptor::kParameterCount - parameter_index - 1 +
+ sp_to_ra_offset_in_words) *
+ kPointerSize;
+ mov(reg, Operand(esp, offset));
+ }
+
// Emit code to discard a non-negative number of pointer-sized elements
// from the stack, clobbering only the esp register.
void Drop(int element_count);
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic/arm/handler-compiler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698