OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/base/bits.h" | 5 #include "src/base/bits.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 | 67 |
68 void LCodeGen::SaveCallerDoubles() { | 68 void LCodeGen::SaveCallerDoubles() { |
69 DCHECK(info()->saves_caller_doubles()); | 69 DCHECK(info()->saves_caller_doubles()); |
70 DCHECK(NeedsEagerFrame()); | 70 DCHECK(NeedsEagerFrame()); |
71 Comment(";;; Save clobbered callee double registers"); | 71 Comment(";;; Save clobbered callee double registers"); |
72 int count = 0; | 72 int count = 0; |
73 BitVector* doubles = chunk()->allocated_double_registers(); | 73 BitVector* doubles = chunk()->allocated_double_registers(); |
74 BitVector::Iterator save_iterator(doubles); | 74 BitVector::Iterator save_iterator(doubles); |
75 while (!save_iterator.Done()) { | 75 while (!save_iterator.Done()) { |
76 __ stfd(DoubleRegister::FromAllocationIndex(save_iterator.Current()), | 76 __ stfd(DoubleRegister::from_code(save_iterator.Current()), |
77 MemOperand(sp, count * kDoubleSize)); | 77 MemOperand(sp, count * kDoubleSize)); |
78 save_iterator.Advance(); | 78 save_iterator.Advance(); |
79 count++; | 79 count++; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 | 83 |
84 void LCodeGen::RestoreCallerDoubles() { | 84 void LCodeGen::RestoreCallerDoubles() { |
85 DCHECK(info()->saves_caller_doubles()); | 85 DCHECK(info()->saves_caller_doubles()); |
86 DCHECK(NeedsEagerFrame()); | 86 DCHECK(NeedsEagerFrame()); |
87 Comment(";;; Restore clobbered callee double registers"); | 87 Comment(";;; Restore clobbered callee double registers"); |
88 BitVector* doubles = chunk()->allocated_double_registers(); | 88 BitVector* doubles = chunk()->allocated_double_registers(); |
89 BitVector::Iterator save_iterator(doubles); | 89 BitVector::Iterator save_iterator(doubles); |
90 int count = 0; | 90 int count = 0; |
91 while (!save_iterator.Done()) { | 91 while (!save_iterator.Done()) { |
92 __ lfd(DoubleRegister::FromAllocationIndex(save_iterator.Current()), | 92 __ lfd(DoubleRegister::from_code(save_iterator.Current()), |
93 MemOperand(sp, count * kDoubleSize)); | 93 MemOperand(sp, count * kDoubleSize)); |
94 save_iterator.Advance(); | 94 save_iterator.Advance(); |
95 count++; | 95 count++; |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 bool LCodeGen::GeneratePrologue() { | 100 bool LCodeGen::GeneratePrologue() { |
101 DCHECK(is_generating()); | 101 DCHECK(is_generating()); |
102 | 102 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 bool LCodeGen::GenerateSafepointTable() { | 390 bool LCodeGen::GenerateSafepointTable() { |
391 DCHECK(is_done()); | 391 DCHECK(is_done()); |
392 safepoints_.Emit(masm(), GetStackSlotCount()); | 392 safepoints_.Emit(masm(), GetStackSlotCount()); |
393 return !is_aborted(); | 393 return !is_aborted(); |
394 } | 394 } |
395 | 395 |
396 | 396 |
397 Register LCodeGen::ToRegister(int index) const { | 397 Register LCodeGen::ToRegister(int code) const { |
398 return Register::FromAllocationIndex(index); | 398 return Register::from_code(code); |
399 } | 399 } |
400 | 400 |
401 | 401 |
402 DoubleRegister LCodeGen::ToDoubleRegister(int index) const { | 402 DoubleRegister LCodeGen::ToDoubleRegister(int code) const { |
403 return DoubleRegister::FromAllocationIndex(index); | 403 return DoubleRegister::from_code(code); |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 Register LCodeGen::ToRegister(LOperand* op) const { | 407 Register LCodeGen::ToRegister(LOperand* op) const { |
408 DCHECK(op->IsRegister()); | 408 DCHECK(op->IsRegister()); |
409 return ToRegister(op->index()); | 409 return ToRegister(op->index()); |
410 } | 410 } |
411 | 411 |
412 | 412 |
413 Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { | 413 Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { |
(...skipping 5709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6123 __ Push(scope_info); | 6123 __ Push(scope_info); |
6124 __ push(ToRegister(instr->function())); | 6124 __ push(ToRegister(instr->function())); |
6125 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6125 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6126 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6126 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6127 } | 6127 } |
6128 | 6128 |
6129 | 6129 |
6130 #undef __ | 6130 #undef __ |
6131 } // namespace internal | 6131 } // namespace internal |
6132 } // namespace v8 | 6132 } // namespace v8 |
OLD | NEW |