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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 Handle<DeoptimizationInputData> data = | 920 Handle<DeoptimizationInputData> data = |
921 factory()->NewDeoptimizationInputData(length, TENURED); | 921 factory()->NewDeoptimizationInputData(length, TENURED); |
922 | 922 |
923 Handle<ByteArray> translations = | 923 Handle<ByteArray> translations = |
924 translations_.CreateByteArray(isolate()->factory()); | 924 translations_.CreateByteArray(isolate()->factory()); |
925 data->SetTranslationByteArray(*translations); | 925 data->SetTranslationByteArray(*translations); |
926 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 926 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
927 | 927 |
928 Handle<FixedArray> literals = | 928 Handle<FixedArray> literals = |
929 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); | 929 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); |
930 { ALLOW_HANDLE_DEREF(isolate(), | 930 { AllowDeferredHandleDereference copy_handles; |
931 "copying a ZoneList of handles into a FixedArray"); | |
932 for (int i = 0; i < deoptimization_literals_.length(); i++) { | 931 for (int i = 0; i < deoptimization_literals_.length(); i++) { |
933 literals->set(i, *deoptimization_literals_[i]); | 932 literals->set(i, *deoptimization_literals_[i]); |
934 } | 933 } |
935 data->SetLiteralArray(*literals); | 934 data->SetLiteralArray(*literals); |
936 } | 935 } |
937 | 936 |
938 data->SetOsrAstId(Smi::FromInt(info_->osr_ast_id().ToInt())); | 937 data->SetOsrAstId(Smi::FromInt(info_->osr_ast_id().ToInt())); |
939 data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_)); | 938 data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_)); |
940 | 939 |
941 // Populate the deoptimization entries. | 940 // Populate the deoptimization entries. |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 void LCodeGen::DoConstantD(LConstantD* instr) { | 1511 void LCodeGen::DoConstantD(LConstantD* instr) { |
1513 ASSERT(instr->result()->IsDoubleRegister()); | 1512 ASSERT(instr->result()->IsDoubleRegister()); |
1514 DoubleRegister result = ToDoubleRegister(instr->result()); | 1513 DoubleRegister result = ToDoubleRegister(instr->result()); |
1515 double v = instr->value(); | 1514 double v = instr->value(); |
1516 __ Move(result, v); | 1515 __ Move(result, v); |
1517 } | 1516 } |
1518 | 1517 |
1519 | 1518 |
1520 void LCodeGen::DoConstantT(LConstantT* instr) { | 1519 void LCodeGen::DoConstantT(LConstantT* instr) { |
1521 Handle<Object> value = instr->value(); | 1520 Handle<Object> value = instr->value(); |
1522 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 1521 AllowDeferredHandleDereference smi_check; |
1523 if (value->IsSmi()) { | 1522 if (value->IsSmi()) { |
1524 __ li(ToRegister(instr->result()), Operand(value)); | 1523 __ li(ToRegister(instr->result()), Operand(value)); |
1525 } else { | 1524 } else { |
1526 __ LoadHeapObject(ToRegister(instr->result()), | 1525 __ LoadHeapObject(ToRegister(instr->result()), |
1527 Handle<HeapObject>::cast(value)); | 1526 Handle<HeapObject>::cast(value)); |
1528 } | 1527 } |
1529 } | 1528 } |
1530 | 1529 |
1531 | 1530 |
1532 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { | 1531 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { |
(...skipping 3482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5015 __ And(scratch, scratch, Operand(mask)); | 5014 __ And(scratch, scratch, Operand(mask)); |
5016 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); | 5015 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); |
5017 } | 5016 } |
5018 } | 5017 } |
5019 } | 5018 } |
5020 | 5019 |
5021 | 5020 |
5022 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { | 5021 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { |
5023 Register reg = ToRegister(instr->value()); | 5022 Register reg = ToRegister(instr->value()); |
5024 Handle<JSFunction> target = instr->hydrogen()->target(); | 5023 Handle<JSFunction> target = instr->hydrogen()->target(); |
5025 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | 5024 AllowDeferredHandleDereference smi_check; |
5026 if (isolate()->heap()->InNewSpace(*target)) { | 5025 if (isolate()->heap()->InNewSpace(*target)) { |
5027 Register reg = ToRegister(instr->value()); | 5026 Register reg = ToRegister(instr->value()); |
5028 Handle<JSGlobalPropertyCell> cell = | 5027 Handle<JSGlobalPropertyCell> cell = |
5029 isolate()->factory()->NewJSGlobalPropertyCell(target); | 5028 isolate()->factory()->NewJSGlobalPropertyCell(target); |
5030 __ li(at, Operand(Handle<Object>(cell))); | 5029 __ li(at, Operand(Handle<Object>(cell))); |
5031 __ lw(at, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); | 5030 __ lw(at, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); |
5032 DeoptimizeIf(ne, instr->environment(), reg, | 5031 DeoptimizeIf(ne, instr->environment(), reg, |
5033 Operand(at)); | 5032 Operand(at)); |
5034 } else { | 5033 } else { |
5035 DeoptimizeIf(ne, instr->environment(), reg, | 5034 DeoptimizeIf(ne, instr->environment(), reg, |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5768 __ Subu(scratch, result, scratch); | 5767 __ Subu(scratch, result, scratch); |
5769 __ lw(result, FieldMemOperand(scratch, | 5768 __ lw(result, FieldMemOperand(scratch, |
5770 FixedArray::kHeaderSize - kPointerSize)); | 5769 FixedArray::kHeaderSize - kPointerSize)); |
5771 __ bind(&done); | 5770 __ bind(&done); |
5772 } | 5771 } |
5773 | 5772 |
5774 | 5773 |
5775 #undef __ | 5774 #undef __ |
5776 | 5775 |
5777 } } // namespace v8::internal | 5776 } } // namespace v8::internal |
OLD | NEW |