OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 Comment cmnt(masm_, "[ Back edge bookkeeping"); | 415 Comment cmnt(masm_, "[ Back edge bookkeeping"); |
416 Label ok; | 416 Label ok; |
417 | 417 |
418 DCHECK(back_edge_target->is_bound()); | 418 DCHECK(back_edge_target->is_bound()); |
419 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target) + | 419 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target) + |
420 kCodeSizeMultiplier / 2; | 420 kCodeSizeMultiplier / 2; |
421 int weight = Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); | 421 int weight = Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); |
422 EmitProfilingCounterDecrement(weight); | 422 EmitProfilingCounterDecrement(weight); |
423 { | 423 { |
424 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 424 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
425 Assembler::BlockConstantPoolEntrySharingScope prevent_entry_sharing(masm_); | |
426 // BackEdgeTable::PatchAt manipulates this sequence. | 425 // BackEdgeTable::PatchAt manipulates this sequence. |
427 __ cmpi(r6, Operand::Zero()); | 426 __ cmpi(r6, Operand::Zero()); |
428 __ bc_short(ge, &ok); | 427 __ bc_short(ge, &ok); |
429 __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); | 428 __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); |
430 | 429 |
431 // Record a mapping of this PC offset to the OSR id. This is used to find | 430 // Record a mapping of this PC offset to the OSR id. This is used to find |
432 // the AST id from the unoptimized code in order to use it as a key into | 431 // the AST id from the unoptimized code in order to use it as a key into |
433 // the deoptimization input data found in the optimized code. | 432 // the deoptimization input data found in the optimized code. |
434 RecordBackEdge(stmt->OsrEntryId()); | 433 RecordBackEdge(stmt->OsrEntryId()); |
435 } | 434 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 arg_count++; | 487 arg_count++; |
489 } | 488 } |
490 int32_t sp_delta = arg_count * kPointerSize; | 489 int32_t sp_delta = arg_count * kPointerSize; |
491 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 490 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
492 __ RecordJSReturn(); | 491 __ RecordJSReturn(); |
493 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); | 492 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); |
494 #if V8_TARGET_ARCH_PPC64 | 493 #if V8_TARGET_ARCH_PPC64 |
495 // With 64bit we may need nop() instructions to ensure we have | 494 // With 64bit we may need nop() instructions to ensure we have |
496 // enough space to SetDebugBreakAtReturn() | 495 // enough space to SetDebugBreakAtReturn() |
497 if (is_int16(sp_delta)) { | 496 if (is_int16(sp_delta)) { |
498 if (!FLAG_enable_embedded_constant_pool) masm_->nop(); | 497 masm_->nop(); |
499 masm_->nop(); | 498 masm_->nop(); |
500 } | 499 } |
501 #endif | 500 #endif |
502 __ blr(); | 501 __ blr(); |
503 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 502 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
504 } | 503 } |
505 | 504 |
506 #ifdef DEBUG | 505 #ifdef DEBUG |
507 // Check that the size of the code used for returning is large enough | 506 // Check that the size of the code used for returning is large enough |
508 // for the debugger's requirements. | 507 // for the debugger's requirements. |
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 __ SmiUntag(r6, SetRC); | 2290 __ SmiUntag(r6, SetRC); |
2292 | 2291 |
2293 // If we are sending a value and there is no operand stack, we can jump back | 2292 // If we are sending a value and there is no operand stack, we can jump back |
2294 // in directly. | 2293 // in directly. |
2295 Label call_resume; | 2294 Label call_resume; |
2296 if (resume_mode == JSGeneratorObject::NEXT) { | 2295 if (resume_mode == JSGeneratorObject::NEXT) { |
2297 Label slow_resume; | 2296 Label slow_resume; |
2298 __ bne(&slow_resume, cr0); | 2297 __ bne(&slow_resume, cr0); |
2299 __ LoadP(ip, FieldMemOperand(r7, JSFunction::kCodeEntryOffset)); | 2298 __ LoadP(ip, FieldMemOperand(r7, JSFunction::kCodeEntryOffset)); |
2300 { | 2299 { |
2301 ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | |
2302 if (FLAG_enable_embedded_constant_pool) { | |
2303 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(ip); | |
2304 } | |
2305 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset)); | 2300 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset)); |
2306 __ SmiUntag(r5); | 2301 __ SmiUntag(r5); |
2307 __ add(ip, ip, r5); | 2302 __ add(ip, ip, r5); |
2308 __ LoadSmiLiteral(r5, | 2303 __ LoadSmiLiteral(r5, |
2309 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); | 2304 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); |
2310 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), | 2305 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), |
2311 r0); | 2306 r0); |
2312 __ Jump(ip); | 2307 __ Jump(ip); |
2313 __ bind(&slow_resume); | 2308 __ bind(&slow_resume); |
2314 } | 2309 } |
(...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5521 return ON_STACK_REPLACEMENT; | 5516 return ON_STACK_REPLACEMENT; |
5522 } | 5517 } |
5523 | 5518 |
5524 DCHECK(interrupt_address == | 5519 DCHECK(interrupt_address == |
5525 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5520 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5526 return OSR_AFTER_STACK_CHECK; | 5521 return OSR_AFTER_STACK_CHECK; |
5527 } | 5522 } |
5528 } // namespace internal | 5523 } // namespace internal |
5529 } // namespace v8 | 5524 } // namespace v8 |
5530 #endif // V8_TARGET_ARCH_PPC | 5525 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |