OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 | 322 |
323 bool LCodeGen::GenerateDeferredCode() { | 323 bool LCodeGen::GenerateDeferredCode() { |
324 ASSERT(is_generating()); | 324 ASSERT(is_generating()); |
325 if (deferred_.length() > 0) { | 325 if (deferred_.length() > 0) { |
326 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 326 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
327 LDeferredCode* code = deferred_[i]; | 327 LDeferredCode* code = deferred_[i]; |
328 | 328 |
329 HValue* value = | 329 HValue* value = |
330 instructions_->at(code->instruction_index())->hydrogen_value(); | 330 instructions_->at(code->instruction_index())->hydrogen_value(); |
331 RecordAndWritePosition(value->position()); | 331 RecordAndWritePosition( |
| 332 chunk()->graph()->SourcePositionToScriptPosition(value->position())); |
332 | 333 |
333 Comment(";;; <@%d,#%d> " | 334 Comment(";;; <@%d,#%d> " |
334 "-------------------- Deferred %s --------------------", | 335 "-------------------- Deferred %s --------------------", |
335 code->instruction_index(), | 336 code->instruction_index(), |
336 code->instr()->hydrogen_value()->id(), | 337 code->instr()->hydrogen_value()->id(), |
337 code->instr()->Mnemonic()); | 338 code->instr()->Mnemonic()); |
338 __ bind(code->entry()); | 339 __ bind(code->entry()); |
339 if (NeedsDeferredFrame()) { | 340 if (NeedsDeferredFrame()) { |
340 Comment(";;; Build frame"); | 341 Comment(";;; Build frame"); |
341 ASSERT(!frame_is_built_); | 342 ASSERT(!frame_is_built_); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 785 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
785 int length = deoptimizations_.length(); | 786 int length = deoptimizations_.length(); |
786 if (length == 0) return; | 787 if (length == 0) return; |
787 Handle<DeoptimizationInputData> data = | 788 Handle<DeoptimizationInputData> data = |
788 factory()->NewDeoptimizationInputData(length, TENURED); | 789 factory()->NewDeoptimizationInputData(length, TENURED); |
789 | 790 |
790 Handle<ByteArray> translations = | 791 Handle<ByteArray> translations = |
791 translations_.CreateByteArray(isolate()->factory()); | 792 translations_.CreateByteArray(isolate()->factory()); |
792 data->SetTranslationByteArray(*translations); | 793 data->SetTranslationByteArray(*translations); |
793 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 794 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
| 795 data->SetOptimizationId(Smi::FromInt(info_->optimization_id())); |
794 | 796 |
795 Handle<FixedArray> literals = | 797 Handle<FixedArray> literals = |
796 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); | 798 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); |
797 { AllowDeferredHandleDereference copy_handles; | 799 { AllowDeferredHandleDereference copy_handles; |
798 for (int i = 0; i < deoptimization_literals_.length(); i++) { | 800 for (int i = 0; i < deoptimization_literals_.length(); i++) { |
799 literals->set(i, *deoptimization_literals_[i]); | 801 literals->set(i, *deoptimization_literals_[i]); |
800 } | 802 } |
801 data->SetLiteralArray(*literals); | 803 data->SetLiteralArray(*literals); |
802 } | 804 } |
803 | 805 |
(...skipping 4746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5550 FixedArray::kHeaderSize - kPointerSize)); | 5552 FixedArray::kHeaderSize - kPointerSize)); |
5551 __ bind(&done); | 5553 __ bind(&done); |
5552 } | 5554 } |
5553 | 5555 |
5554 | 5556 |
5555 #undef __ | 5557 #undef __ |
5556 | 5558 |
5557 } } // namespace v8::internal | 5559 } } // namespace v8::internal |
5558 | 5560 |
5559 #endif // V8_TARGET_ARCH_X64 | 5561 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |