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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 316 } |
317 } | 317 } |
318 // Deferred code is the last part of the instruction sequence. Mark | 318 // Deferred code is the last part of the instruction sequence. Mark |
319 // the generated code as done unless we bailed out. | 319 // the generated code as done unless we bailed out. |
320 if (!is_aborted()) status_ = DONE; | 320 if (!is_aborted()) status_ = DONE; |
321 return !is_aborted(); | 321 return !is_aborted(); |
322 } | 322 } |
323 | 323 |
324 | 324 |
325 bool LCodeGen::GenerateDeoptJumpTable() { | 325 bool LCodeGen::GenerateDeoptJumpTable() { |
326 // Check that the jump table is accessible from everywhere in the function | |
327 // code, i.e. that offsets to the table can be encoded in the 16bit signed | |
328 // immediate of a branch instruction. | |
329 // To simplify we consider the code size from the first instruction to the | |
330 // end of the jump table. | |
331 if (!is_int16((masm()->pc_offset() / Assembler::kInstrSize) + | |
332 deopt_jump_table_.length() * 12)) { | |
333 Abort(kGeneratedCodeIsTooLarge); | |
334 } | |
335 | |
336 if (deopt_jump_table_.length() > 0) { | 326 if (deopt_jump_table_.length() > 0) { |
337 Comment(";;; -------------------- Jump table --------------------"); | 327 Comment(";;; -------------------- Jump table --------------------"); |
338 } | 328 } |
339 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 329 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
340 Label table_start; | 330 Label table_start; |
341 __ bind(&table_start); | 331 __ bind(&table_start); |
342 Label needs_frame; | 332 Label needs_frame; |
343 for (int i = 0; i < deopt_jump_table_.length(); i++) { | 333 for (int i = 0; i < deopt_jump_table_.length(); i++) { |
344 __ bind(&deopt_jump_table_[i].label); | 334 __ bind(&deopt_jump_table_[i].label); |
345 Address entry = deopt_jump_table_[i].address; | 335 Address entry = deopt_jump_table_[i].address; |
(...skipping 5447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5793 __ Subu(scratch, result, scratch); | 5783 __ Subu(scratch, result, scratch); |
5794 __ lw(result, FieldMemOperand(scratch, | 5784 __ lw(result, FieldMemOperand(scratch, |
5795 FixedArray::kHeaderSize - kPointerSize)); | 5785 FixedArray::kHeaderSize - kPointerSize)); |
5796 __ bind(&done); | 5786 __ bind(&done); |
5797 } | 5787 } |
5798 | 5788 |
5799 | 5789 |
5800 #undef __ | 5790 #undef __ |
5801 | 5791 |
5802 } } // namespace v8::internal | 5792 } } // namespace v8::internal |
OLD | NEW |