| OLD | NEW | 
|     1 // Copyright 2013 the V8 project authors. All rights reserved. |     1 // Copyright 2013 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/crankshaft/arm64/lithium-codegen-arm64.h" |     5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" | 
|     6  |     6  | 
|     7 #include "src/arm64/frames-arm64.h" |     7 #include "src/arm64/frames-arm64.h" | 
|     8 #include "src/base/bits.h" |     8 #include "src/base/bits.h" | 
|     9 #include "src/code-factory.h" |     9 #include "src/code-factory.h" | 
|    10 #include "src/code-stubs.h" |    10 #include "src/code-stubs.h" | 
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   270                        environment->HasTaggedValueAt(env_offset + i), |   270                        environment->HasTaggedValueAt(env_offset + i), | 
|   271                        environment->HasUint32ValueAt(env_offset + i), |   271                        environment->HasUint32ValueAt(env_offset + i), | 
|   272                        object_index_pointer, |   272                        object_index_pointer, | 
|   273                        dematerialized_index_pointer); |   273                        dematerialized_index_pointer); | 
|   274     } |   274     } | 
|   275     return; |   275     return; | 
|   276   } |   276   } | 
|   277  |   277  | 
|   278   if (op->IsStackSlot()) { |   278   if (op->IsStackSlot()) { | 
|   279     int index = op->index(); |   279     int index = op->index(); | 
 |   280     if (index >= 0) { | 
 |   281       index += StandardFrameConstants::kFixedFrameSize / kPointerSize; | 
 |   282     } | 
|   280     if (is_tagged) { |   283     if (is_tagged) { | 
|   281       translation->StoreStackSlot(index); |   284       translation->StoreStackSlot(index); | 
|   282     } else if (is_uint32) { |   285     } else if (is_uint32) { | 
|   283       translation->StoreUint32StackSlot(index); |   286       translation->StoreUint32StackSlot(index); | 
|   284     } else { |   287     } else { | 
|   285       translation->StoreInt32StackSlot(index); |   288       translation->StoreInt32StackSlot(index); | 
|   286     } |   289     } | 
|   287   } else if (op->IsDoubleStackSlot()) { |   290   } else if (op->IsDoubleStackSlot()) { | 
|   288     int index = op->index(); |   291     int index = op->index(); | 
 |   292     if (index >= 0) { | 
 |   293       index += StandardFrameConstants::kFixedFrameSize / kPointerSize; | 
 |   294     } | 
|   289     translation->StoreDoubleStackSlot(index); |   295     translation->StoreDoubleStackSlot(index); | 
|   290   } else if (op->IsRegister()) { |   296   } else if (op->IsRegister()) { | 
|   291     Register reg = ToRegister(op); |   297     Register reg = ToRegister(op); | 
|   292     if (is_tagged) { |   298     if (is_tagged) { | 
|   293       translation->StoreRegister(reg); |   299       translation->StoreRegister(reg); | 
|   294     } else if (is_uint32) { |   300     } else if (is_uint32) { | 
|   295       translation->StoreUint32Register(reg); |   301       translation->StoreUint32Register(reg); | 
|   296     } else { |   302     } else { | 
|   297       translation->StoreInt32Register(reg); |   303       translation->StoreInt32Register(reg); | 
|   298     } |   304     } | 
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   851   if (!is_aborted()) status_ = DONE; |   857   if (!is_aborted()) status_ = DONE; | 
|   852   return !is_aborted(); |   858   return !is_aborted(); | 
|   853 } |   859 } | 
|   854  |   860  | 
|   855  |   861  | 
|   856 bool LCodeGen::GenerateSafepointTable() { |   862 bool LCodeGen::GenerateSafepointTable() { | 
|   857   DCHECK(is_done()); |   863   DCHECK(is_done()); | 
|   858   // We do not know how much data will be emitted for the safepoint table, so |   864   // We do not know how much data will be emitted for the safepoint table, so | 
|   859   // force emission of the veneer pool. |   865   // force emission of the veneer pool. | 
|   860   masm()->CheckVeneerPool(true, true); |   866   masm()->CheckVeneerPool(true, true); | 
|   861   safepoints_.Emit(masm(), GetTotalFrameSlotCount()); |   867   safepoints_.Emit(masm(), GetStackSlotCount()); | 
|   862   return !is_aborted(); |   868   return !is_aborted(); | 
|   863 } |   869 } | 
|   864  |   870  | 
|   865  |   871  | 
|   866 void LCodeGen::FinishCode(Handle<Code> code) { |   872 void LCodeGen::FinishCode(Handle<Code> code) { | 
|   867   DCHECK(is_done()); |   873   DCHECK(is_done()); | 
|   868   code->set_stack_slots(GetStackSlotCount()); |   874   code->set_stack_slots(GetStackSlotCount()); | 
|   869   code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |   875   code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 
|   870   PopulateDeoptimizationData(code); |   876   PopulateDeoptimizationData(code); | 
|   871 } |   877 } | 
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1142   return -(index + 1) * kPointerSize; |  1148   return -(index + 1) * kPointerSize; | 
|  1143 } |  1149 } | 
|  1144  |  1150  | 
|  1145  |  1151  | 
|  1146 MemOperand LCodeGen::ToMemOperand(LOperand* op, StackMode stack_mode) const { |  1152 MemOperand LCodeGen::ToMemOperand(LOperand* op, StackMode stack_mode) const { | 
|  1147   DCHECK(op != NULL); |  1153   DCHECK(op != NULL); | 
|  1148   DCHECK(!op->IsRegister()); |  1154   DCHECK(!op->IsRegister()); | 
|  1149   DCHECK(!op->IsDoubleRegister()); |  1155   DCHECK(!op->IsDoubleRegister()); | 
|  1150   DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |  1156   DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 
|  1151   if (NeedsEagerFrame()) { |  1157   if (NeedsEagerFrame()) { | 
|  1152     int fp_offset = FrameSlotToFPOffset(op->index()); |  1158     int fp_offset = StackSlotOffset(op->index()); | 
|  1153     // Loads and stores have a bigger reach in positive offset than negative. |  1159     // Loads and stores have a bigger reach in positive offset than negative. | 
|  1154     // We try to access using jssp (positive offset) first, then fall back to |  1160     // We try to access using jssp (positive offset) first, then fall back to | 
|  1155     // fp (negative offset) if that fails. |  1161     // fp (negative offset) if that fails. | 
|  1156     // |  1162     // | 
|  1157     // We can reference a stack slot from jssp only if we know how much we've |  1163     // We can reference a stack slot from jssp only if we know how much we've | 
|  1158     // put on the stack. We don't know this in the following cases: |  1164     // put on the stack. We don't know this in the following cases: | 
|  1159     // - stack_mode != kCanUseStackPointer: this is the case when deferred |  1165     // - stack_mode != kCanUseStackPointer: this is the case when deferred | 
|  1160     //   code has saved the registers. |  1166     //   code has saved the registers. | 
|  1161     // - saves_caller_doubles(): some double registers have been pushed, jssp |  1167     // - saves_caller_doubles(): some double registers have been pushed, jssp | 
|  1162     //   references the end of the double registers and not the end of the stack |  1168     //   references the end of the double registers and not the end of the stack | 
| (...skipping 4571 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5734   Handle<ScopeInfo> scope_info = instr->scope_info(); |  5740   Handle<ScopeInfo> scope_info = instr->scope_info(); | 
|  5735   __ Push(scope_info); |  5741   __ Push(scope_info); | 
|  5736   __ Push(ToRegister(instr->function())); |  5742   __ Push(ToRegister(instr->function())); | 
|  5737   CallRuntime(Runtime::kPushBlockContext, instr); |  5743   CallRuntime(Runtime::kPushBlockContext, instr); | 
|  5738   RecordSafepoint(Safepoint::kNoLazyDeopt); |  5744   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
|  5739 } |  5745 } | 
|  5740  |  5746  | 
|  5741  |  5747  | 
|  5742 }  // namespace internal |  5748 }  // namespace internal | 
|  5743 }  // namespace v8 |  5749 }  // namespace v8 | 
| OLD | NEW |