Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 84911ecec5d83896d380218094b821e40d7734ad..6c1d496fa8cbc545667661e8dbb48eea36c0211a 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1216,25 +1216,28 @@ MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid, |
} |
-// If true, a Handle<T> passed by value is passed and returned by |
-// using the location_ field directly. If false, it is passed and |
-// returned as a pointer to a handle. |
-#ifdef USING_BSD_ABI |
-static const bool kPassHandlesDirectly = true; |
+// If true, a Handle<T> returned by value from a function with cdecl calling |
+// convention will be returned directly as a value of location_ field in a |
+// register eax. |
+// If false, it is returned as a pointer to a preallocated by caller memory |
+// region. Pointer to this region should be passed to a function as an |
+// implicit first argument. |
+#if defined(USING_BSD_ABI) || defined(__MINGW32__) |
antonm
2010/12/09 19:35:34
I'd rather moved defined(__MINGW32__) into src/glo
Erik Corry
2010/12/10 11:35:20
I agree with Anton.
Vyacheslav Egorov (Chromium)
2010/12/10 11:40:04
I committed as is.
I do not think that defining US
|
+static const bool kReturnHandlesDirectly = true; |
#else |
-static const bool kPassHandlesDirectly = false; |
+static const bool kReturnHandlesDirectly = false; |
#endif |
Operand ApiParameterOperand(int index) { |
- return Operand(esp, (index + (kPassHandlesDirectly ? 0 : 1)) * kPointerSize); |
+ return Operand(esp, (index + (kReturnHandlesDirectly ? 0 : 1)) * kPointerSize); |
Erik Corry
2010/12/10 11:35:20
lint?
|
} |
void MacroAssembler::PrepareCallApiFunction(int argc, Register scratch) { |
- if (kPassHandlesDirectly) { |
+ if (kReturnHandlesDirectly) { |
EnterApiExitFrame(argc); |
- // When handles as passed directly we don't have to allocate extra |
+ // When handles are returned directly we don't have to allocate extra |
// space for and pass an out parameter. |
} else { |
// We allocate two additional slots: return value and pointer to it. |
@@ -1279,7 +1282,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function, |
// Call the api function! |
call(function->address(), RelocInfo::RUNTIME_ENTRY); |
- if (!kPassHandlesDirectly) { |
+ if (!kReturnHandlesDirectly) { |
// The returned value is a pointer to the handle holding the result. |
// Dereference this to get to the location. |
mov(eax, Operand(eax, 0)); |