summaryrefslogtreecommitdiff
path: root/deps/v8/src/ia32/macro-assembler-ia32.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/ia32/macro-assembler-ia32.h')
-rw-r--r--deps/v8/src/ia32/macro-assembler-ia32.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/deps/v8/src/ia32/macro-assembler-ia32.h b/deps/v8/src/ia32/macro-assembler-ia32.h
index 08cc7ceb64..2220ca7c4f 100644
--- a/deps/v8/src/ia32/macro-assembler-ia32.h
+++ b/deps/v8/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);