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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 542 |
543 bool LCodeGen::IsInteger32(LConstantOperand* op) const { | 543 bool LCodeGen::IsInteger32(LConstantOperand* op) const { |
544 return chunk_->LookupLiteralRepresentation(op).IsInteger32(); | 544 return chunk_->LookupLiteralRepresentation(op).IsInteger32(); |
545 } | 545 } |
546 | 546 |
547 | 547 |
548 Operand LCodeGen::ToOperand(LOperand* op) const { | 548 Operand LCodeGen::ToOperand(LOperand* op) const { |
549 if (op->IsRegister()) return Operand(ToRegister(op)); | 549 if (op->IsRegister()) return Operand(ToRegister(op)); |
550 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op)); | 550 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op)); |
551 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); | 551 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); |
552 int index = op->index(); | 552 return Operand(ebp, StackSlotOffset(op->index())); |
553 if (index >= 0) { | |
554 // Local or spill slot. Skip the frame pointer, function, and | |
555 // context in the fixed part of the frame. | |
556 return Operand(ebp, -(index + 3) * kPointerSize); | |
557 } else { | |
558 // Incoming parameter. Skip the return address. | |
559 return Operand(ebp, -(index - 1) * kPointerSize); | |
560 } | |
561 } | 553 } |
562 | 554 |
563 | 555 |
564 Operand LCodeGen::HighOperand(LOperand* op) { | 556 Operand LCodeGen::HighOperand(LOperand* op) { |
565 ASSERT(op->IsDoubleStackSlot()); | 557 ASSERT(op->IsDoubleStackSlot()); |
566 int index = op->index(); | 558 return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize); |
567 int offset = (index >= 0) ? index + 3 : index - 1; | |
568 return Operand(ebp, -offset * kPointerSize); | |
569 } | 559 } |
570 | 560 |
571 | 561 |
572 void LCodeGen::WriteTranslation(LEnvironment* environment, | 562 void LCodeGen::WriteTranslation(LEnvironment* environment, |
573 Translation* translation, | 563 Translation* translation, |
574 int* arguments_index, | 564 int* arguments_index, |
575 int* arguments_count) { | 565 int* arguments_count) { |
576 if (environment == NULL) return; | 566 if (environment == NULL) return; |
577 | 567 |
578 // The translation includes one command per value in the environment. | 568 // The translation includes one command per value in the environment. |
(...skipping 5599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6178 FixedArray::kHeaderSize - kPointerSize)); | 6168 FixedArray::kHeaderSize - kPointerSize)); |
6179 __ bind(&done); | 6169 __ bind(&done); |
6180 } | 6170 } |
6181 | 6171 |
6182 | 6172 |
6183 #undef __ | 6173 #undef __ |
6184 | 6174 |
6185 } } // namespace v8::internal | 6175 } } // namespace v8::internal |
6186 | 6176 |
6187 #endif // V8_TARGET_ARCH_IA32 | 6177 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |