Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1459)

Unified Diff: src/ppc/full-codegen-ppc.cc

Issue 1030353003: Enable constant pool support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ppc/full-codegen-ppc.cc
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
index ecdcc265053bb1edcbc3943f05b1b212a579a1f6..35ffcc96d195cb38ba4847d0a503a11acb3cbfd8 100644
--- a/src/ppc/full-codegen-ppc.cc
+++ b/src/ppc/full-codegen-ppc.cc
@@ -104,7 +104,8 @@ class JumpPatchSite BASE_EMBEDDED {
void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
handler_table_ =
- isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
+ Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
+ HandlerTable::LengthForRange(function()->handler_count()), TENURED));
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
@@ -361,6 +362,8 @@ void FullCodeGenerator::Generate() {
__ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
}
EmitReturnSequence();
+
+ masm_->EmitConstantPool();
}
@@ -401,6 +404,7 @@ void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
EmitProfilingCounterDecrement(weight);
{
Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
+ Assembler::BlockConstantPoolEntrySharingScope prevent_entry_sharing(masm_);
// BackEdgeTable::PatchAt manipulates this sequence.
__ cmpi(r6, Operand::Zero());
__ bc_short(ge, &ok);
@@ -473,7 +477,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// With 64bit we may need nop() instructions to ensure we have
// enough space to SetDebugBreakAtReturn()
if (is_int16(sp_delta)) {
- masm_->nop();
+ if (!FLAG_enable_embedded_constant_pool) masm_->nop();
masm_->nop();
}
#endif
@@ -2143,7 +2147,6 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
__ bind(&l_catch);
- handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
__ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw"
__ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); // iter
__ Push(load_name, r6, r3); // "throw", iter, except
@@ -2154,16 +2157,17 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// re-boxing.
__ bind(&l_try);
__ pop(r3); // result
- __ PushTryHandler(StackHandler::CATCH, expr->index());
- const int handler_size = StackHandlerConstants::kSize;
+ EnterTryBlock(expr->index(), &l_catch);
+ const int try_block_size = TryCatch::kElementCount * kPointerSize;
__ push(r3); // result
__ b(&l_suspend);
__ bind(&l_continuation);
__ b(&l_resume);
__ bind(&l_suspend);
- const int generator_object_depth = kPointerSize + handler_size;
+ const int generator_object_depth = kPointerSize + try_block_size;
__ LoadP(r3, MemOperand(sp, generator_object_depth));
__ push(r3); // g
+ __ Push(Smi::FromInt(expr->index())); // handler-index
DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
__ LoadSmiLiteral(r4, Smi::FromInt(l_continuation.pos()));
__ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset),
@@ -2172,12 +2176,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ mr(r4, cp);
__ RecordWriteField(r3, JSGeneratorObject::kContextOffset, r4, r5,
kLRHasBeenSaved, kDontSaveFPRegs);
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
+ __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
__ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
__ pop(r3); // result
EmitReturnSequence();
__ bind(&l_resume); // received in r3
- __ PopTryHandler();
+ ExitTryBlock(expr->index());
// receiver = iter; f = 'next'; arg = received;
__ bind(&l_next);
@@ -2299,6 +2303,10 @@ void FullCodeGenerator::EmitGeneratorResume(
__ bne(&slow_resume, cr0);
__ LoadP(ip, FieldMemOperand(r7, JSFunction::kCodeEntryOffset));
{
+ ConstantPoolUnavailableScope constant_pool_unavailable(masm_);
+ if (FLAG_enable_embedded_constant_pool) {
+ __ LoadTargetConstantPoolPointerRegister(ip);
+ }
__ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset));
__ SmiUntag(r5);
__ add(ip, ip, r5);
@@ -5363,32 +5371,6 @@ void FullCodeGenerator::ExitFinallyBlock() {
#undef __
-#define __ ACCESS_MASM(masm())
-
-FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
- int* stack_depth, int* context_length) {
- // The macros used here must preserve the result register.
-
- // Because the handler block contains the context of the finally
- // code, we can restore it directly from there for the finally code
- // rather than iteratively unwinding contexts via their previous
- // links.
- __ Drop(*stack_depth); // Down to the handler block.
- if (*context_length > 0) {
- // Restore the context to its dedicated register and the stack.
- __ LoadP(cp, MemOperand(sp, StackHandlerConstants::kContextOffset));
- __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- }
- __ PopTryHandler();
- __ b(finally_entry_, SetLK);
-
- *stack_depth = 0;
- *context_length = 0;
- return previous_;
-}
-
-#undef __
-
void BackEdgeTable::PatchAt(Code* unoptimized_code, Address pc,
BackEdgeState target_state,

Powered by Google App Engine
This is Rietveld 408576698