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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 | 271 |
272 bool LCodeGen::GenerateDeferredCode() { | 272 bool LCodeGen::GenerateDeferredCode() { |
273 ASSERT(is_generating()); | 273 ASSERT(is_generating()); |
274 if (deferred_.length() > 0) { | 274 if (deferred_.length() > 0) { |
275 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 275 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
276 LDeferredCode* code = deferred_[i]; | 276 LDeferredCode* code = deferred_[i]; |
277 | 277 |
278 HValue* value = | 278 HValue* value = |
279 instructions_->at(code->instruction_index())->hydrogen_value(); | 279 instructions_->at(code->instruction_index())->hydrogen_value(); |
280 RecordAndWritePosition(value->position()); | 280 RecordAndWritePosition( |
| 281 chunk()->graph()->SourcePositionToScriptPosition(value->position())); |
281 | 282 |
282 Comment(";;; <@%d,#%d> " | 283 Comment(";;; <@%d,#%d> " |
283 "-------------------- Deferred %s --------------------", | 284 "-------------------- Deferred %s --------------------", |
284 code->instruction_index(), | 285 code->instruction_index(), |
285 code->instr()->hydrogen_value()->id(), | 286 code->instr()->hydrogen_value()->id(), |
286 code->instr()->Mnemonic()); | 287 code->instr()->Mnemonic()); |
287 __ bind(code->entry()); | 288 __ bind(code->entry()); |
288 if (NeedsDeferredFrame()) { | 289 if (NeedsDeferredFrame()) { |
289 Comment(";;; Build frame"); | 290 Comment(";;; Build frame"); |
290 ASSERT(!frame_is_built_); | 291 ASSERT(!frame_is_built_); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 900 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
900 int length = deoptimizations_.length(); | 901 int length = deoptimizations_.length(); |
901 if (length == 0) return; | 902 if (length == 0) return; |
902 Handle<DeoptimizationInputData> data = | 903 Handle<DeoptimizationInputData> data = |
903 factory()->NewDeoptimizationInputData(length, TENURED); | 904 factory()->NewDeoptimizationInputData(length, TENURED); |
904 | 905 |
905 Handle<ByteArray> translations = | 906 Handle<ByteArray> translations = |
906 translations_.CreateByteArray(isolate()->factory()); | 907 translations_.CreateByteArray(isolate()->factory()); |
907 data->SetTranslationByteArray(*translations); | 908 data->SetTranslationByteArray(*translations); |
908 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 909 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
| 910 data->SetOptimizationId(Smi::FromInt(info_->optimization_id())); |
909 | 911 |
910 Handle<FixedArray> literals = | 912 Handle<FixedArray> literals = |
911 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); | 913 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); |
912 { AllowDeferredHandleDereference copy_handles; | 914 { AllowDeferredHandleDereference copy_handles; |
913 for (int i = 0; i < deoptimization_literals_.length(); i++) { | 915 for (int i = 0; i < deoptimization_literals_.length(); i++) { |
914 literals->set(i, *deoptimization_literals_[i]); | 916 literals->set(i, *deoptimization_literals_[i]); |
915 } | 917 } |
916 data->SetLiteralArray(*literals); | 918 data->SetLiteralArray(*literals); |
917 } | 919 } |
918 | 920 |
(...skipping 4823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5742 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5744 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5743 __ ldr(result, FieldMemOperand(scratch, | 5745 __ ldr(result, FieldMemOperand(scratch, |
5744 FixedArray::kHeaderSize - kPointerSize)); | 5746 FixedArray::kHeaderSize - kPointerSize)); |
5745 __ bind(&done); | 5747 __ bind(&done); |
5746 } | 5748 } |
5747 | 5749 |
5748 | 5750 |
5749 #undef __ | 5751 #undef __ |
5750 | 5752 |
5751 } } // namespace v8::internal | 5753 } } // namespace v8::internal |
OLD | NEW |