Use the correct ifdef to detect Win64 (_WIN64, not __MSVC__).
Review URL: http://codereview.chromium.org/195014
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2823
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
static ObjectPair LoadContextSlotHelper(Arguments args, bool throw_error) {
HandleScope scope;
- ASSERT(args.length() == 2);
+ ASSERT_EQ(2, args.length());
if (!args[0]->IsContext() || !args[1]->IsString()) {
return MakePair(Top::ThrowIllegalOperation(), NULL);
// MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots.
// Store register parameters in pre-allocated stack slots,
__ movq(Operand(rbp, kInputString), rcx);
- __ movq(Operand(rbp, kStartIndex), rdx);
+ __ movzxlq(Operand(rbp, kStartIndex), rdx); // Passed as int in eax.
__ movq(Operand(rbp, kInputStart), r8);
__ movq(Operand(rbp, kInputEnd), r9);
// Callee-save on Win64.
__ Move(code_object_pointer(), masm_->CodeObject());
// Load previous char as initial value of current-character.
Label at_start;
- __ cmpq(Operand(rbp, kAtStart), Immediate(0));
+ __ cmpb(Operand(rbp, kAtStart), Immediate(0));
__ j(not_equal, &at_start);
LoadCurrentCharacterUnchecked(-1, 1); // Load previous char.
__ jmp(&start_label_);
static const int kReturn_eip = kFramePointer + kPointerSize;
static const int kFrameAlign = kReturn_eip + kPointerSize;
-#ifdef __MSVC__
+#ifdef _WIN64
// Parameters (first four passed as registers, but with room on stack).
// In Microsoft 64-bit Calling Convention, there is room on the callers
// stack (before the return address) to spill parameter registers. We
// use this space to store the register passed parameters.
static const int kInputString = kFrameAlign;
+ // StartIndex is passed as 32 bit int.
static const int kStartIndex = kInputString + kPointerSize;
static const int kInputStart = kStartIndex + kPointerSize;
static const int kInputEnd = kInputStart + kPointerSize;
static const int kRegisterOutput = kInputEnd + kPointerSize;
+ // AtStart is passed as 32 bit int (values 0 or 1).
static const int kAtStart = kRegisterOutput + kPointerSize;
static const int kStackHighEnd = kAtStart + kPointerSize;
#else
static const int kStackHighEnd = kFrameAlign;
#endif
-#ifdef __MSVC__
+#ifdef _WIN64
// Microsoft calling convention has three callee-saved registers
// (that we are using). We push these after the frame pointer.
static const int kBackup_rsi = kFramePointer - kPointerSize;