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" | |
11 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
12 #include "src/full-codegen/full-codegen.h" | 11 #include "src/full-codegen/full-codegen.h" |
13 #include "src/ic/ic.h" | 12 #include "src/ic/ic.h" |
14 #include "src/parser.h" | 13 #include "src/parser.h" |
15 #include "src/scopes.h" | 14 #include "src/scopes.h" |
16 | 15 |
17 #include "src/ppc/code-stubs-ppc.h" | 16 #include "src/ppc/code-stubs-ppc.h" |
18 #include "src/ppc/macro-assembler-ppc.h" | 17 #include "src/ppc/macro-assembler-ppc.h" |
19 | 18 |
20 namespace v8 { | 19 namespace v8 { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 int prologue_offset = masm_->pc_offset(); | 138 int prologue_offset = masm_->pc_offset(); |
140 | 139 |
141 if (prologue_offset) { | 140 if (prologue_offset) { |
142 // Prologue logic requires it's starting address in ip and the | 141 // Prologue logic requires it's starting address in ip and the |
143 // corresponding offset from the function entry. | 142 // corresponding offset from the function entry. |
144 prologue_offset += Instruction::kInstrSize; | 143 prologue_offset += Instruction::kInstrSize; |
145 __ addi(ip, ip, Operand(prologue_offset)); | 144 __ addi(ip, ip, Operand(prologue_offset)); |
146 } | 145 } |
147 info->set_prologue_offset(prologue_offset); | 146 info->set_prologue_offset(prologue_offset); |
148 __ Prologue(info->IsCodePreAgingActive(), prologue_offset); | 147 __ Prologue(info->IsCodePreAgingActive(), prologue_offset); |
149 info->AddNoFrameRange(0, masm_->pc_offset()); | |
150 | 148 |
151 { | 149 { |
152 Comment cmnt(masm_, "[ Allocate locals"); | 150 Comment cmnt(masm_, "[ Allocate locals"); |
153 int locals_count = info->scope()->num_stack_slots(); | 151 int locals_count = info->scope()->num_stack_slots(); |
154 // Generators allocate locals, if any, in context slots. | 152 // Generators allocate locals, if any, in context slots. |
155 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 153 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
156 if (locals_count > 0) { | 154 if (locals_count > 0) { |
157 if (locals_count >= 128) { | 155 if (locals_count >= 128) { |
158 Label ok; | 156 Label ok; |
159 __ Add(ip, sp, -(locals_count * kPointerSize), r0); | 157 __ Add(ip, sp, -(locals_count * kPointerSize), r0); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 EmitProfilingCounterReset(); | 458 EmitProfilingCounterReset(); |
461 __ bind(&ok); | 459 __ bind(&ok); |
462 | 460 |
463 // Make sure that the constant pool is not emitted inside of the return | 461 // Make sure that the constant pool is not emitted inside of the return |
464 // sequence. | 462 // sequence. |
465 { | 463 { |
466 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 464 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
467 int32_t arg_count = info_->scope()->num_parameters() + 1; | 465 int32_t arg_count = info_->scope()->num_parameters() + 1; |
468 int32_t sp_delta = arg_count * kPointerSize; | 466 int32_t sp_delta = arg_count * kPointerSize; |
469 SetReturnPosition(literal()); | 467 SetReturnPosition(literal()); |
470 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); | 468 __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); |
471 __ blr(); | 469 __ blr(); |
472 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
473 } | 470 } |
474 } | 471 } |
475 } | 472 } |
476 | 473 |
477 | 474 |
478 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { | 475 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
479 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 476 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
480 codegen()->GetVar(result_register(), var); | 477 codegen()->GetVar(result_register(), var); |
481 __ push(result_register()); | 478 __ push(result_register()); |
482 } | 479 } |
(...skipping 4734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 return ON_STACK_REPLACEMENT; | 5214 return ON_STACK_REPLACEMENT; |
5218 } | 5215 } |
5219 | 5216 |
5220 DCHECK(interrupt_address == | 5217 DCHECK(interrupt_address == |
5221 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5218 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5222 return OSR_AFTER_STACK_CHECK; | 5219 return OSR_AFTER_STACK_CHECK; |
5223 } | 5220 } |
5224 } // namespace internal | 5221 } // namespace internal |
5225 } // namespace v8 | 5222 } // namespace v8 |
5226 #endif // V8_TARGET_ARCH_PPC | 5223 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |