| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // The following three instructions must remain together and unmodified | 172 // The following three instructions must remain together and unmodified |
| 173 // for code aging to work properly. | 173 // for code aging to work properly. |
| 174 __ Push(ra, fp, cp, a1); | 174 __ Push(ra, fp, cp, a1); |
| 175 // Add unused load of ip to ensure prologue sequence is identical for | 175 // Add unused load of ip to ensure prologue sequence is identical for |
| 176 // full-codegen and lithium-codegen. | 176 // full-codegen and lithium-codegen. |
| 177 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 177 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 178 // Adj. FP to point to saved FP. | 178 // Adj. FP to point to saved FP. |
| 179 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 179 __ Addu(fp, sp, Operand(2 * kPointerSize)); |
| 180 } | 180 } |
| 181 frame_is_built_ = true; | 181 frame_is_built_ = true; |
| 182 info_->AddNoFrameRange(0, masm_->pc_offset()); |
| 182 } | 183 } |
| 183 | 184 |
| 184 // Reserve space for the stack slots needed by the code. | 185 // Reserve space for the stack slots needed by the code. |
| 185 int slots = GetStackSlotCount(); | 186 int slots = GetStackSlotCount(); |
| 186 if (slots > 0) { | 187 if (slots > 0) { |
| 187 if (FLAG_debug_code) { | 188 if (FLAG_debug_code) { |
| 188 __ Subu(sp, sp, Operand(slots * kPointerSize)); | 189 __ Subu(sp, sp, Operand(slots * kPointerSize)); |
| 189 __ push(a0); | 190 __ push(a0); |
| 190 __ push(a1); | 191 __ push(a1); |
| 191 __ Addu(a0, sp, Operand(slots * kPointerSize)); | 192 __ Addu(a0, sp, Operand(slots * kPointerSize)); |
| (...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2504 BitVector* doubles = chunk()->allocated_double_registers(); | 2505 BitVector* doubles = chunk()->allocated_double_registers(); |
| 2505 BitVector::Iterator save_iterator(doubles); | 2506 BitVector::Iterator save_iterator(doubles); |
| 2506 int count = 0; | 2507 int count = 0; |
| 2507 while (!save_iterator.Done()) { | 2508 while (!save_iterator.Done()) { |
| 2508 __ ldc1(DoubleRegister::FromAllocationIndex(save_iterator.Current()), | 2509 __ ldc1(DoubleRegister::FromAllocationIndex(save_iterator.Current()), |
| 2509 MemOperand(sp, count * kDoubleSize)); | 2510 MemOperand(sp, count * kDoubleSize)); |
| 2510 save_iterator.Advance(); | 2511 save_iterator.Advance(); |
| 2511 count++; | 2512 count++; |
| 2512 } | 2513 } |
| 2513 } | 2514 } |
| 2515 int no_frame_start = -1; |
| 2514 if (NeedsEagerFrame()) { | 2516 if (NeedsEagerFrame()) { |
| 2515 __ mov(sp, fp); | 2517 __ mov(sp, fp); |
| 2516 __ Pop(ra, fp); | 2518 __ Pop(ra, fp); |
| 2519 no_frame_start = masm_->pc_offset(); |
| 2517 } | 2520 } |
| 2518 if (instr->has_constant_parameter_count()) { | 2521 if (instr->has_constant_parameter_count()) { |
| 2519 int parameter_count = ToInteger32(instr->constant_parameter_count()); | 2522 int parameter_count = ToInteger32(instr->constant_parameter_count()); |
| 2520 int32_t sp_delta = (parameter_count + 1) * kPointerSize; | 2523 int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
| 2521 if (sp_delta != 0) { | 2524 if (sp_delta != 0) { |
| 2522 __ Addu(sp, sp, Operand(sp_delta)); | 2525 __ Addu(sp, sp, Operand(sp_delta)); |
| 2523 } | 2526 } |
| 2524 } else { | 2527 } else { |
| 2525 Register reg = ToRegister(instr->parameter_count()); | 2528 Register reg = ToRegister(instr->parameter_count()); |
| 2526 // The argument count parameter is a smi | 2529 // The argument count parameter is a smi |
| 2527 __ SmiUntag(reg); | 2530 __ SmiUntag(reg); |
| 2528 __ sll(at, reg, kPointerSizeLog2); | 2531 __ sll(at, reg, kPointerSizeLog2); |
| 2529 __ Addu(sp, sp, at); | 2532 __ Addu(sp, sp, at); |
| 2530 } | 2533 } |
| 2531 | 2534 |
| 2532 __ Jump(ra); | 2535 __ Jump(ra); |
| 2536 |
| 2537 if (no_frame_start != -1) { |
| 2538 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 2539 } |
| 2533 } | 2540 } |
| 2534 | 2541 |
| 2535 | 2542 |
| 2536 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2543 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
| 2537 Register result = ToRegister(instr->result()); | 2544 Register result = ToRegister(instr->result()); |
| 2538 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell()))); | 2545 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell()))); |
| 2539 __ lw(result, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); | 2546 __ lw(result, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); |
| 2540 if (instr->hydrogen()->RequiresHoleCheck()) { | 2547 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2541 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2548 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 2542 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); | 2549 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
| (...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5624 __ Subu(scratch, result, scratch); | 5631 __ Subu(scratch, result, scratch); |
| 5625 __ lw(result, FieldMemOperand(scratch, | 5632 __ lw(result, FieldMemOperand(scratch, |
| 5626 FixedArray::kHeaderSize - kPointerSize)); | 5633 FixedArray::kHeaderSize - kPointerSize)); |
| 5627 __ bind(&done); | 5634 __ bind(&done); |
| 5628 } | 5635 } |
| 5629 | 5636 |
| 5630 | 5637 |
| 5631 #undef __ | 5638 #undef __ |
| 5632 | 5639 |
| 5633 } } // namespace v8::internal | 5640 } } // namespace v8::internal |
| OLD | NEW |