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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return !is_aborted(); | 342 return !is_aborted(); |
343 } | 343 } |
344 | 344 |
345 | 345 |
346 bool LCodeGen::GenerateJumpTable() { | 346 bool LCodeGen::GenerateJumpTable() { |
347 Label needs_frame_not_call; | 347 Label needs_frame_not_call; |
348 Label needs_frame_is_call; | 348 Label needs_frame_is_call; |
349 for (int i = 0; i < jump_table_.length(); i++) { | 349 for (int i = 0; i < jump_table_.length(); i++) { |
350 __ bind(&jump_table_[i].label); | 350 __ bind(&jump_table_[i].label); |
351 Address entry = jump_table_[i].address; | 351 Address entry = jump_table_[i].address; |
| 352 bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; |
| 353 Deoptimizer::BailoutType type = |
| 354 is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; |
| 355 int id = Deoptimizer::GetDeoptimizationId(entry, type); |
| 356 if (id == Deoptimizer::kNotDeoptimizationEntry) { |
| 357 Comment(";;; jump table entry %d.", i); |
| 358 } else { |
| 359 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); |
| 360 } |
352 if (jump_table_[i].needs_frame) { | 361 if (jump_table_[i].needs_frame) { |
353 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); | 362 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); |
354 if (jump_table_[i].is_lazy_deopt) { | 363 if (is_lazy_deopt) { |
355 if (needs_frame_is_call.is_bound()) { | 364 if (needs_frame_is_call.is_bound()) { |
356 __ jmp(&needs_frame_is_call); | 365 __ jmp(&needs_frame_is_call); |
357 } else { | 366 } else { |
358 __ bind(&needs_frame_is_call); | 367 __ bind(&needs_frame_is_call); |
359 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); | 368 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); |
360 // This variant of deopt can only be used with stubs. Since we don't | 369 // This variant of deopt can only be used with stubs. Since we don't |
361 // have a function pointer to install in the stack frame that we're | 370 // have a function pointer to install in the stack frame that we're |
362 // building, install a special marker there instead. | 371 // building, install a special marker there instead. |
363 ASSERT(info()->IsStub()); | 372 ASSERT(info()->IsStub()); |
364 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); | 373 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
(...skipping 24 matching lines...) Expand all Loading... |
389 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); | 398 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
390 // Push the continuation which was stashed were the ebp should | 399 // Push the continuation which was stashed were the ebp should |
391 // be. Replace it with the saved ebp. | 400 // be. Replace it with the saved ebp. |
392 __ push(MemOperand(esp, 2 * kPointerSize)); | 401 __ push(MemOperand(esp, 2 * kPointerSize)); |
393 __ mov(MemOperand(esp, 3 * kPointerSize), ebp); | 402 __ mov(MemOperand(esp, 3 * kPointerSize), ebp); |
394 __ lea(ebp, MemOperand(esp, 3 * kPointerSize)); | 403 __ lea(ebp, MemOperand(esp, 3 * kPointerSize)); |
395 __ ret(0); // Call the continuation without clobbering registers. | 404 __ ret(0); // Call the continuation without clobbering registers. |
396 } | 405 } |
397 } | 406 } |
398 } else { | 407 } else { |
399 if (jump_table_[i].is_lazy_deopt) { | 408 if (is_lazy_deopt) { |
400 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 409 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
401 } else { | 410 } else { |
402 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); | 411 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
403 } | 412 } |
404 } | 413 } |
405 } | 414 } |
406 return !is_aborted(); | 415 return !is_aborted(); |
407 } | 416 } |
408 | 417 |
409 | 418 |
(...skipping 5556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5966 FixedArray::kHeaderSize - kPointerSize)); | 5975 FixedArray::kHeaderSize - kPointerSize)); |
5967 __ bind(&done); | 5976 __ bind(&done); |
5968 } | 5977 } |
5969 | 5978 |
5970 | 5979 |
5971 #undef __ | 5980 #undef __ |
5972 | 5981 |
5973 } } // namespace v8::internal | 5982 } } // namespace v8::internal |
5974 | 5983 |
5975 #endif // V8_TARGET_ARCH_IA32 | 5984 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |