| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // o sp: stack pointer | 95 // o sp: stack pointer |
| 96 // o lr: return address | 96 // o lr: return address |
| 97 // o ip: our own function entry (required by the prologue) | 97 // o ip: our own function entry (required by the prologue) |
| 98 // | 98 // |
| 99 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 99 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
| 100 // frames-ppc.h for its layout. | 100 // frames-ppc.h for its layout. |
| 101 void FullCodeGenerator::Generate() { | 101 void FullCodeGenerator::Generate() { |
| 102 CompilationInfo* info = info_; | 102 CompilationInfo* info = info_; |
| 103 profiling_counter_ = isolate()->factory()->NewCell( | 103 profiling_counter_ = isolate()->factory()->NewCell( |
| 104 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 104 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 105 SetFunctionPosition(function()); | 105 SetFunctionPosition(literal()); |
| 106 Comment cmnt(masm_, "[ function compiled by full code generator"); | 106 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 107 | 107 |
| 108 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 108 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 109 | 109 |
| 110 #ifdef DEBUG | 110 #ifdef DEBUG |
| 111 if (strlen(FLAG_stop_at) > 0 && | 111 if (strlen(FLAG_stop_at) > 0 && |
| 112 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 112 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 113 __ stop("stop-at"); | 113 __ stop("stop-at"); |
| 114 } | 114 } |
| 115 #endif | 115 #endif |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 __ LoadSmiLiteral(r4, Smi::FromInt(num_parameters)); | 323 __ LoadSmiLiteral(r4, Smi::FromInt(num_parameters)); |
| 324 __ Push(r6, r5, r4); | 324 __ Push(r6, r5, r4); |
| 325 | 325 |
| 326 // Arguments to ArgumentsAccessStub: | 326 // Arguments to ArgumentsAccessStub: |
| 327 // function, receiver address, parameter count. | 327 // function, receiver address, parameter count. |
| 328 // The stub will rewrite receiver and parameter count if the previous | 328 // The stub will rewrite receiver and parameter count if the previous |
| 329 // stack frame was an arguments adapter frame. | 329 // stack frame was an arguments adapter frame. |
| 330 ArgumentsAccessStub::Type type; | 330 ArgumentsAccessStub::Type type; |
| 331 if (is_strict(language_mode()) || !has_simple_parameters()) { | 331 if (is_strict(language_mode()) || !has_simple_parameters()) { |
| 332 type = ArgumentsAccessStub::NEW_STRICT; | 332 type = ArgumentsAccessStub::NEW_STRICT; |
| 333 } else if (function()->has_duplicate_parameters()) { | 333 } else if (literal()->has_duplicate_parameters()) { |
| 334 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 334 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
| 335 } else { | 335 } else { |
| 336 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 336 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
| 337 } | 337 } |
| 338 ArgumentsAccessStub stub(isolate(), type); | 338 ArgumentsAccessStub stub(isolate(), type); |
| 339 __ CallStub(&stub); | 339 __ CallStub(&stub); |
| 340 | 340 |
| 341 SetVar(arguments, r3, r4, r5); | 341 SetVar(arguments, r3, r4, r5); |
| 342 } | 342 } |
| 343 | 343 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 370 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 370 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 371 __ cmpl(sp, ip); | 371 __ cmpl(sp, ip); |
| 372 __ bc_short(ge, &ok); | 372 __ bc_short(ge, &ok); |
| 373 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 373 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
| 374 __ bind(&ok); | 374 __ bind(&ok); |
| 375 } | 375 } |
| 376 | 376 |
| 377 { | 377 { |
| 378 Comment cmnt(masm_, "[ Body"); | 378 Comment cmnt(masm_, "[ Body"); |
| 379 DCHECK(loop_depth() == 0); | 379 DCHECK(loop_depth() == 0); |
| 380 VisitStatements(function()->body()); | 380 VisitStatements(literal()->body()); |
| 381 DCHECK(loop_depth() == 0); | 381 DCHECK(loop_depth() == 0); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 // Always emit a 'return undefined' in case control fell off the end of | 385 // Always emit a 'return undefined' in case control fell off the end of |
| 386 // the body. | 386 // the body. |
| 387 { | 387 { |
| 388 Comment cmnt(masm_, "[ return <undefined>;"); | 388 Comment cmnt(masm_, "[ return <undefined>;"); |
| 389 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); | 389 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
| 390 } | 390 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 __ pop(r3); | 480 __ pop(r3); |
| 481 EmitProfilingCounterReset(); | 481 EmitProfilingCounterReset(); |
| 482 __ bind(&ok); | 482 __ bind(&ok); |
| 483 | 483 |
| 484 // Make sure that the constant pool is not emitted inside of the return | 484 // Make sure that the constant pool is not emitted inside of the return |
| 485 // sequence. | 485 // sequence. |
| 486 { | 486 { |
| 487 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 487 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 488 int32_t arg_count = info_->scope()->num_parameters() + 1; | 488 int32_t arg_count = info_->scope()->num_parameters() + 1; |
| 489 int32_t sp_delta = arg_count * kPointerSize; | 489 int32_t sp_delta = arg_count * kPointerSize; |
| 490 SetReturnPosition(function()); | 490 SetReturnPosition(literal()); |
| 491 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); | 491 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); |
| 492 __ blr(); | 492 __ blr(); |
| 493 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 493 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 | 498 |
| 499 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { | 499 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
| 500 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 500 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| (...skipping 4888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5389 return ON_STACK_REPLACEMENT; | 5389 return ON_STACK_REPLACEMENT; |
| 5390 } | 5390 } |
| 5391 | 5391 |
| 5392 DCHECK(interrupt_address == | 5392 DCHECK(interrupt_address == |
| 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5394 return OSR_AFTER_STACK_CHECK; | 5394 return OSR_AFTER_STACK_CHECK; |
| 5395 } | 5395 } |
| 5396 } // namespace internal | 5396 } // namespace internal |
| 5397 } // namespace v8 | 5397 } // namespace v8 |
| 5398 #endif // V8_TARGET_ARCH_PPC | 5398 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |