| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 "-------------------- Deferred %s --------------------", | 271 "-------------------- Deferred %s --------------------", |
| 272 code->instruction_index(), | 272 code->instruction_index(), |
| 273 code->instr()->hydrogen_value()->id(), | 273 code->instr()->hydrogen_value()->id(), |
| 274 code->instr()->Mnemonic()); | 274 code->instr()->Mnemonic()); |
| 275 __ bind(code->entry()); | 275 __ bind(code->entry()); |
| 276 if (NeedsDeferredFrame()) { | 276 if (NeedsDeferredFrame()) { |
| 277 Comment(";;; Build frame"); | 277 Comment(";;; Build frame"); |
| 278 DCHECK(!frame_is_built_); | 278 DCHECK(!frame_is_built_); |
| 279 DCHECK(info()->IsStub()); | 279 DCHECK(info()->IsStub()); |
| 280 frame_is_built_ = true; | 280 frame_is_built_ = true; |
| 281 __ MultiPush(cp.bit() | fp.bit() | ra.bit()); | |
| 282 __ li(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); | 281 __ li(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); |
| 283 __ push(scratch0()); | 282 __ PushCommonFrame(scratch0()); |
| 284 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | |
| 285 Comment(";;; Deferred code"); | 283 Comment(";;; Deferred code"); |
| 286 } | 284 } |
| 287 code->Generate(); | 285 code->Generate(); |
| 288 if (NeedsDeferredFrame()) { | 286 if (NeedsDeferredFrame()) { |
| 289 Comment(";;; Destroy frame"); | 287 Comment(";;; Destroy frame"); |
| 290 DCHECK(frame_is_built_); | 288 DCHECK(frame_is_built_); |
| 291 __ pop(at); | 289 __ PopCommonFrame(scratch0()); |
| 292 __ MultiPop(cp.bit() | fp.bit() | ra.bit()); | |
| 293 frame_is_built_ = false; | 290 frame_is_built_ = false; |
| 294 } | 291 } |
| 295 __ jmp(code->exit()); | 292 __ jmp(code->exit()); |
| 296 } | 293 } |
| 297 } | 294 } |
| 298 // Deferred code is the last part of the instruction sequence. Mark | 295 // Deferred code is the last part of the instruction sequence. Mark |
| 299 // the generated code as done unless we bailed out. | 296 // the generated code as done unless we bailed out. |
| 300 if (!is_aborted()) status_ = DONE; | 297 if (!is_aborted()) status_ = DONE; |
| 301 return !is_aborted(); | 298 return !is_aborted(); |
| 302 } | 299 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 321 DeoptComment(table_entry->deopt_info); | 318 DeoptComment(table_entry->deopt_info); |
| 322 | 319 |
| 323 // Second-level deopt table entries are contiguous and small, so instead | 320 // Second-level deopt table entries are contiguous and small, so instead |
| 324 // of loading the full, absolute address of each one, load an immediate | 321 // of loading the full, absolute address of each one, load an immediate |
| 325 // offset which will be added to the base address later. | 322 // offset which will be added to the base address later. |
| 326 __ li(entry_offset, Operand(entry - base)); | 323 __ li(entry_offset, Operand(entry - base)); |
| 327 | 324 |
| 328 if (table_entry->needs_frame) { | 325 if (table_entry->needs_frame) { |
| 329 DCHECK(!info()->saves_caller_doubles()); | 326 DCHECK(!info()->saves_caller_doubles()); |
| 330 Comment(";;; call deopt with frame"); | 327 Comment(";;; call deopt with frame"); |
| 331 __ MultiPush(cp.bit() | fp.bit() | ra.bit()); | 328 __ PushCommonFrame(); |
| 332 __ Call(&needs_frame); | 329 __ Call(&needs_frame); |
| 333 } else { | 330 } else { |
| 334 __ Call(&call_deopt_entry); | 331 __ Call(&call_deopt_entry); |
| 335 } | 332 } |
| 336 info()->LogDeoptCallPosition(masm()->pc_offset(), | 333 info()->LogDeoptCallPosition(masm()->pc_offset(), |
| 337 table_entry->deopt_info.inlining_id); | 334 table_entry->deopt_info.inlining_id); |
| 338 } | 335 } |
| 339 | 336 |
| 340 if (needs_frame.is_linked()) { | 337 if (needs_frame.is_linked()) { |
| 341 __ bind(&needs_frame); | 338 __ bind(&needs_frame); |
| 342 // This variant of deopt can only be used with stubs. Since we don't | 339 // This variant of deopt can only be used with stubs. Since we don't |
| 343 // have a function pointer to install in the stack frame that we're | 340 // have a function pointer to install in the stack frame that we're |
| 344 // building, install a special marker there instead. | 341 // building, install a special marker there instead. |
| 345 DCHECK(info()->IsStub()); | |
| 346 __ li(at, Operand(Smi::FromInt(StackFrame::STUB))); | 342 __ li(at, Operand(Smi::FromInt(StackFrame::STUB))); |
| 347 __ push(at); | 343 __ push(at); |
| 348 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 344 DCHECK(info()->IsStub()); |
| 349 } | 345 } |
| 350 | 346 |
| 351 Comment(";;; call deopt"); | 347 Comment(";;; call deopt"); |
| 352 __ bind(&call_deopt_entry); | 348 __ bind(&call_deopt_entry); |
| 353 | 349 |
| 354 if (info()->saves_caller_doubles()) { | 350 if (info()->saves_caller_doubles()) { |
| 355 DCHECK(info()->IsStub()); | 351 DCHECK(info()->IsStub()); |
| 356 RestoreCallerDoubles(); | 352 RestoreCallerDoubles(); |
| 357 } | 353 } |
| 358 | 354 |
| (...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2985 Register scratch = scratch0(); | 2981 Register scratch = scratch0(); |
| 2986 Register temp = scratch1(); | 2982 Register temp = scratch1(); |
| 2987 Register result = ToRegister(instr->result()); | 2983 Register result = ToRegister(instr->result()); |
| 2988 | 2984 |
| 2989 if (instr->hydrogen()->from_inlined()) { | 2985 if (instr->hydrogen()->from_inlined()) { |
| 2990 __ Subu(result, sp, 2 * kPointerSize); | 2986 __ Subu(result, sp, 2 * kPointerSize); |
| 2991 } else { | 2987 } else { |
| 2992 // Check if the calling frame is an arguments adaptor frame. | 2988 // Check if the calling frame is an arguments adaptor frame. |
| 2993 Label done, adapted; | 2989 Label done, adapted; |
| 2994 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2990 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2995 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); | 2991 __ lw(result, |
| 2992 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 2996 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2993 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2997 | 2994 |
| 2998 // Result is the frame pointer for the frame if not adapted and for the real | 2995 // Result is the frame pointer for the frame if not adapted and for the real |
| 2999 // frame below the adaptor frame if adapted. | 2996 // frame below the adaptor frame if adapted. |
| 3000 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). | 2997 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). |
| 3001 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). | 2998 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). |
| 3002 } | 2999 } |
| 3003 } | 3000 } |
| 3004 | 3001 |
| 3005 | 3002 |
| (...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5488 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5485 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
| 5489 Register context = ToRegister(instr->context()); | 5486 Register context = ToRegister(instr->context()); |
| 5490 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5487 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 5491 } | 5488 } |
| 5492 | 5489 |
| 5493 | 5490 |
| 5494 #undef __ | 5491 #undef __ |
| 5495 | 5492 |
| 5496 } // namespace internal | 5493 } // namespace internal |
| 5497 } // namespace v8 | 5494 } // namespace v8 |
| OLD | NEW |