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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "arm64/lithium-codegen-arm64.h" | 7 #include "arm64/lithium-codegen-arm64.h" |
8 #include "arm64/lithium-gap-resolver-arm64.h" | 8 #include "arm64/lithium-gap-resolver-arm64.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 | 888 |
889 void LCodeGen::FinishCode(Handle<Code> code) { | 889 void LCodeGen::FinishCode(Handle<Code> code) { |
890 ASSERT(is_done()); | 890 ASSERT(is_done()); |
891 code->set_stack_slots(GetStackSlotCount()); | 891 code->set_stack_slots(GetStackSlotCount()); |
892 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 892 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
893 if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); | 893 if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); |
894 PopulateDeoptimizationData(code); | 894 PopulateDeoptimizationData(code); |
895 } | 895 } |
896 | 896 |
897 | 897 |
898 void LCodeGen::Abort(BailoutReason reason) { | |
899 info()->set_bailout_reason(reason); | |
900 status_ = ABORTED; | |
901 } | |
902 | |
903 | |
904 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 898 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
905 int length = deoptimizations_.length(); | 899 int length = deoptimizations_.length(); |
906 if (length == 0) return; | 900 if (length == 0) return; |
907 | 901 |
908 Handle<DeoptimizationInputData> data = | 902 Handle<DeoptimizationInputData> data = |
909 DeoptimizationInputData::New(isolate(), length, TENURED); | 903 DeoptimizationInputData::New(isolate(), length, TENURED); |
910 | 904 |
911 Handle<ByteArray> translations = | 905 Handle<ByteArray> translations = |
912 translations_.CreateByteArray(isolate()->factory()); | 906 translations_.CreateByteArray(isolate()->factory()); |
913 data->SetTranslationByteArray(*translations); | 907 data->SetTranslationByteArray(*translations); |
(...skipping 4332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5246 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 5240 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
5247 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5241 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5248 } | 5242 } |
5249 | 5243 |
5250 | 5244 |
5251 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 5245 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
5252 Representation representation = instr->representation(); | 5246 Representation representation = instr->representation(); |
5253 | 5247 |
5254 Register object = ToRegister(instr->object()); | 5248 Register object = ToRegister(instr->object()); |
5255 HObjectAccess access = instr->hydrogen()->access(); | 5249 HObjectAccess access = instr->hydrogen()->access(); |
5256 Handle<Map> transition = instr->transition(); | |
5257 int offset = access.offset(); | 5250 int offset = access.offset(); |
5258 | 5251 |
5259 if (access.IsExternalMemory()) { | 5252 if (access.IsExternalMemory()) { |
5260 ASSERT(transition.is_null()); | 5253 ASSERT(!instr->hydrogen()->has_transition()); |
5261 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 5254 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
5262 Register value = ToRegister(instr->value()); | 5255 Register value = ToRegister(instr->value()); |
5263 __ Store(value, MemOperand(object, offset), representation); | 5256 __ Store(value, MemOperand(object, offset), representation); |
5264 return; | 5257 return; |
5265 } else if (representation.IsDouble()) { | 5258 } else if (representation.IsDouble()) { |
5266 ASSERT(transition.is_null()); | |
5267 ASSERT(access.IsInobject()); | 5259 ASSERT(access.IsInobject()); |
| 5260 ASSERT(!instr->hydrogen()->has_transition()); |
5268 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 5261 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
5269 FPRegister value = ToDoubleRegister(instr->value()); | 5262 FPRegister value = ToDoubleRegister(instr->value()); |
5270 __ Str(value, FieldMemOperand(object, offset)); | 5263 __ Str(value, FieldMemOperand(object, offset)); |
5271 return; | 5264 return; |
5272 } | 5265 } |
5273 | 5266 |
5274 Register value = ToRegister(instr->value()); | 5267 Register value = ToRegister(instr->value()); |
5275 | 5268 |
5276 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() | 5269 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() |
5277 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 5270 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
5278 | 5271 |
5279 ASSERT(!(representation.IsSmi() && | 5272 ASSERT(!(representation.IsSmi() && |
5280 instr->value()->IsConstantOperand() && | 5273 instr->value()->IsConstantOperand() && |
5281 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); | 5274 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); |
5282 if (representation.IsHeapObject() && | 5275 if (representation.IsHeapObject() && |
5283 !instr->hydrogen()->value()->type().IsHeapObject()) { | 5276 !instr->hydrogen()->value()->type().IsHeapObject()) { |
5284 DeoptimizeIfSmi(value, instr->environment()); | 5277 DeoptimizeIfSmi(value, instr->environment()); |
5285 | 5278 |
5286 // We know now that value is not a smi, so we can omit the check below. | 5279 // We know now that value is not a smi, so we can omit the check below. |
5287 check_needed = OMIT_SMI_CHECK; | 5280 check_needed = OMIT_SMI_CHECK; |
5288 } | 5281 } |
5289 | 5282 |
5290 if (!transition.is_null()) { | 5283 if (instr->hydrogen()->has_transition()) { |
| 5284 Handle<Map> transition = instr->hydrogen()->transition_map(); |
| 5285 AddDeprecationDependency(transition); |
5291 // Store the new map value. | 5286 // Store the new map value. |
5292 Register new_map_value = ToRegister(instr->temp0()); | 5287 Register new_map_value = ToRegister(instr->temp0()); |
5293 __ Mov(new_map_value, Operand(transition)); | 5288 __ Mov(new_map_value, Operand(transition)); |
5294 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); | 5289 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); |
5295 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 5290 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
5296 // Update the write barrier for the map field. | 5291 // Update the write barrier for the map field. |
5297 __ RecordWriteField(object, | 5292 __ RecordWriteField(object, |
5298 HeapObject::kMapOffset, | 5293 HeapObject::kMapOffset, |
5299 new_map_value, | 5294 new_map_value, |
5300 ToRegister(instr->temp1()), | 5295 ToRegister(instr->temp1()), |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5948 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5943 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5949 // Index is equal to negated out of object property index plus 1. | 5944 // Index is equal to negated out of object property index plus 1. |
5950 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5945 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5951 __ Ldr(result, FieldMemOperand(result, | 5946 __ Ldr(result, FieldMemOperand(result, |
5952 FixedArray::kHeaderSize - kPointerSize)); | 5947 FixedArray::kHeaderSize - kPointerSize)); |
5953 __ Bind(deferred->exit()); | 5948 __ Bind(deferred->exit()); |
5954 __ Bind(&done); | 5949 __ Bind(&done); |
5955 } | 5950 } |
5956 | 5951 |
5957 } } // namespace v8::internal | 5952 } } // namespace v8::internal |
OLD | NEW |