OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // Stack slots not implemented, use ToMemOperand instead. | 561 // Stack slots not implemented, use ToMemOperand instead. |
562 UNREACHABLE(); | 562 UNREACHABLE(); |
563 return Operand::Zero(); | 563 return Operand::Zero(); |
564 } | 564 } |
565 | 565 |
566 | 566 |
567 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { | 567 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { |
568 ASSERT(!op->IsRegister()); | 568 ASSERT(!op->IsRegister()); |
569 ASSERT(!op->IsDoubleRegister()); | 569 ASSERT(!op->IsDoubleRegister()); |
570 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); | 570 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); |
571 int index = op->index(); | 571 return MemOperand(fp, StackSlotOffset(op->index())); |
572 if (index >= 0) { | |
573 // Local or spill slot. Skip the frame pointer, function, and | |
574 // context in the fixed part of the frame. | |
575 return MemOperand(fp, -(index + 3) * kPointerSize); | |
576 } else { | |
577 // Incoming parameter. Skip the return address. | |
578 return MemOperand(fp, -(index - 1) * kPointerSize); | |
579 } | |
580 } | 572 } |
581 | 573 |
582 | 574 |
583 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { | 575 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { |
584 ASSERT(op->IsDoubleStackSlot()); | 576 ASSERT(op->IsDoubleStackSlot()); |
585 int index = op->index(); | 577 return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize); |
586 if (index >= 0) { | |
587 // Local or spill slot. Skip the frame pointer, function, context, | |
588 // and the first word of the double in the fixed part of the frame. | |
589 return MemOperand(fp, -(index + 3) * kPointerSize + kPointerSize); | |
590 } else { | |
591 // Incoming parameter. Skip the return address and the first word of | |
592 // the double. | |
593 return MemOperand(fp, -(index - 1) * kPointerSize + kPointerSize); | |
594 } | |
595 } | 578 } |
596 | 579 |
597 | 580 |
598 void LCodeGen::WriteTranslation(LEnvironment* environment, | 581 void LCodeGen::WriteTranslation(LEnvironment* environment, |
599 Translation* translation, | 582 Translation* translation, |
600 int* arguments_index, | 583 int* arguments_index, |
601 int* arguments_count) { | 584 int* arguments_count) { |
602 if (environment == NULL) return; | 585 if (environment == NULL) return; |
603 | 586 |
604 // The translation includes one command per value in the environment. | 587 // The translation includes one command per value in the environment. |
(...skipping 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6316 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6299 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6317 __ ldr(result, FieldMemOperand(scratch, | 6300 __ ldr(result, FieldMemOperand(scratch, |
6318 FixedArray::kHeaderSize - kPointerSize)); | 6301 FixedArray::kHeaderSize - kPointerSize)); |
6319 __ bind(&done); | 6302 __ bind(&done); |
6320 } | 6303 } |
6321 | 6304 |
6322 | 6305 |
6323 #undef __ | 6306 #undef __ |
6324 | 6307 |
6325 } } // namespace v8::internal | 6308 } } // namespace v8::internal |
OLD | NEW |