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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 bool LCodeGen::GenerateJumpTable() { | 302 bool LCodeGen::GenerateJumpTable() { |
303 Label needs_frame_not_call; | 303 Label needs_frame_not_call; |
304 Label needs_frame_is_call; | 304 Label needs_frame_is_call; |
305 for (int i = 0; i < jump_table_.length(); i++) { | 305 for (int i = 0; i < jump_table_.length(); i++) { |
306 __ bind(&jump_table_[i].label); | 306 __ bind(&jump_table_[i].label); |
307 Address entry = jump_table_[i].address; | 307 Address entry = jump_table_[i].address; |
308 bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; | 308 bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; |
309 Deoptimizer::BailoutType type = | 309 Deoptimizer::BailoutType type = |
310 is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; | 310 is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; |
311 int id = Deoptimizer::GetDeoptimizationId(entry, type); | 311 int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type); |
312 if (id == Deoptimizer::kNotDeoptimizationEntry) { | 312 if (id == Deoptimizer::kNotDeoptimizationEntry) { |
313 Comment(";;; jump table entry %d.", i); | 313 Comment(";;; jump table entry %d.", i); |
314 } else { | 314 } else { |
315 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); | 315 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); |
316 } | 316 } |
317 if (jump_table_[i].needs_frame) { | 317 if (jump_table_[i].needs_frame) { |
318 __ movq(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); | 318 __ movq(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); |
319 if (is_lazy_deopt) { | 319 if (is_lazy_deopt) { |
320 if (needs_frame_is_call.is_bound()) { | 320 if (needs_frame_is_call.is_bound()) { |
321 __ jmp(&needs_frame_is_call); | 321 __ jmp(&needs_frame_is_call); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 } | 801 } |
802 } | 802 } |
803 | 803 |
804 | 804 |
805 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 805 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
806 int length = deoptimizations_.length(); | 806 int length = deoptimizations_.length(); |
807 if (length == 0) return; | 807 if (length == 0) return; |
808 Handle<DeoptimizationInputData> data = | 808 Handle<DeoptimizationInputData> data = |
809 factory()->NewDeoptimizationInputData(length, TENURED); | 809 factory()->NewDeoptimizationInputData(length, TENURED); |
810 | 810 |
811 Handle<ByteArray> translations = translations_.CreateByteArray(); | 811 Handle<ByteArray> translations = |
| 812 translations_.CreateByteArray(isolate()->factory()); |
812 data->SetTranslationByteArray(*translations); | 813 data->SetTranslationByteArray(*translations); |
813 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 814 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
814 | 815 |
815 Handle<FixedArray> literals = | 816 Handle<FixedArray> literals = |
816 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); | 817 factory()->NewFixedArray(deoptimization_literals_.length(), TENURED); |
817 for (int i = 0; i < deoptimization_literals_.length(); i++) { | 818 for (int i = 0; i < deoptimization_literals_.length(); i++) { |
818 literals->set(i, *deoptimization_literals_[i]); | 819 literals->set(i, *deoptimization_literals_[i]); |
819 } | 820 } |
820 data->SetLiteralArray(*literals); | 821 data->SetLiteralArray(*literals); |
821 | 822 |
(...skipping 5025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5847 FixedArray::kHeaderSize - kPointerSize)); | 5848 FixedArray::kHeaderSize - kPointerSize)); |
5848 __ bind(&done); | 5849 __ bind(&done); |
5849 } | 5850 } |
5850 | 5851 |
5851 | 5852 |
5852 #undef __ | 5853 #undef __ |
5853 | 5854 |
5854 } } // namespace v8::internal | 5855 } } // namespace v8::internal |
5855 | 5856 |
5856 #endif // V8_TARGET_ARCH_X64 | 5857 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |