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

Side by Side Diff: src/mips/deoptimizer-mips.cc

Issue 10155024: Fix deopted construct stub frame to contain code object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 builtins->builtin(Builtins::kArgumentsAdaptorTrampoline); 440 builtins->builtin(Builtins::kArgumentsAdaptorTrampoline);
441 uint32_t pc = reinterpret_cast<uint32_t>( 441 uint32_t pc = reinterpret_cast<uint32_t>(
442 adaptor_trampoline->instruction_start() + 442 adaptor_trampoline->instruction_start() +
443 isolate_->heap()->arguments_adaptor_deopt_pc_offset()->value()); 443 isolate_->heap()->arguments_adaptor_deopt_pc_offset()->value());
444 output_frame->SetPc(pc); 444 output_frame->SetPc(pc);
445 } 445 }
446 446
447 447
448 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, 448 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator,
449 int frame_index) { 449 int frame_index) {
450 Builtins* builtins = isolate_->builtins();
451 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric);
450 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next())); 452 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next()));
451 unsigned height = iterator->Next(); 453 unsigned height = iterator->Next();
452 unsigned height_in_bytes = height * kPointerSize; 454 unsigned height_in_bytes = height * kPointerSize;
453 if (FLAG_trace_deopt) { 455 if (FLAG_trace_deopt) {
454 PrintF(" translating construct stub => height=%d\n", height_in_bytes); 456 PrintF(" translating construct stub => height=%d\n", height_in_bytes);
455 } 457 }
456 458
457 unsigned fixed_frame_size = 7 * kPointerSize; 459 unsigned fixed_frame_size = 8 * kPointerSize;
458 unsigned output_frame_size = height_in_bytes + fixed_frame_size; 460 unsigned output_frame_size = height_in_bytes + fixed_frame_size;
459 461
460 // Allocate and store the output frame description. 462 // Allocate and store the output frame description.
461 FrameDescription* output_frame = 463 FrameDescription* output_frame =
462 new(output_frame_size) FrameDescription(output_frame_size, function); 464 new(output_frame_size) FrameDescription(output_frame_size, function);
463 output_frame->SetFrameType(StackFrame::CONSTRUCT); 465 output_frame->SetFrameType(StackFrame::CONSTRUCT);
464 466
465 // Construct stub can not be topmost or bottommost. 467 // Construct stub can not be topmost or bottommost.
466 ASSERT(frame_index > 0 && frame_index < output_count_ - 1); 468 ASSERT(frame_index > 0 && frame_index < output_count_ - 1);
467 ASSERT(output_[frame_index] == NULL); 469 ASSERT(output_[frame_index] == NULL);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 514
513 // A marker value is used in place of the function. 515 // A marker value is used in place of the function.
514 output_offset -= kPointerSize; 516 output_offset -= kPointerSize;
515 value = reinterpret_cast<intptr_t>(Smi::FromInt(StackFrame::CONSTRUCT)); 517 value = reinterpret_cast<intptr_t>(Smi::FromInt(StackFrame::CONSTRUCT));
516 output_frame->SetFrameSlot(output_offset, value); 518 output_frame->SetFrameSlot(output_offset, value);
517 if (FLAG_trace_deopt) { 519 if (FLAG_trace_deopt) {
518 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; function (construct sentinel)\n", 520 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; function (construct sentinel)\n",
519 top_address + output_offset, output_offset, value); 521 top_address + output_offset, output_offset, value);
520 } 522 }
521 523
524 // The output frame reflects a JSConstructStubGeneric frame.
525 output_offset -= kPointerSize;
526 value = reinterpret_cast<intptr_t>(construct_stub);
527 output_frame->SetFrameSlot(output_offset, value);
528 if (FLAG_trace_deopt) {
529 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; code object\n",
530 top_address + output_offset, output_offset, value);
531 }
532
522 // Number of incoming arguments. 533 // Number of incoming arguments.
523 output_offset -= kPointerSize; 534 output_offset -= kPointerSize;
524 value = reinterpret_cast<uint32_t>(Smi::FromInt(height - 1)); 535 value = reinterpret_cast<uint32_t>(Smi::FromInt(height - 1));
525 output_frame->SetFrameSlot(output_offset, value); 536 output_frame->SetFrameSlot(output_offset, value);
526 if (FLAG_trace_deopt) { 537 if (FLAG_trace_deopt) {
527 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; argc (%d)\n", 538 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; argc (%d)\n",
528 top_address + output_offset, output_offset, value, height - 1); 539 top_address + output_offset, output_offset, value, height - 1);
529 } 540 }
530 541
531 // Constructor function being invoked by the stub. 542 // Constructor function being invoked by the stub.
(...skipping 10 matching lines...) Expand all
542 output_offset -= kPointerSize; 553 output_offset -= kPointerSize;
543 value = output_frame->GetFrameSlot(output_frame_size - kPointerSize); 554 value = output_frame->GetFrameSlot(output_frame_size - kPointerSize);
544 output_frame->SetFrameSlot(output_offset, value); 555 output_frame->SetFrameSlot(output_offset, value);
545 if (FLAG_trace_deopt) { 556 if (FLAG_trace_deopt) {
546 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; allocated receiver\n", 557 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; allocated receiver\n",
547 top_address + output_offset, output_offset, value); 558 top_address + output_offset, output_offset, value);
548 } 559 }
549 560
550 ASSERT(0 == output_offset); 561 ASSERT(0 == output_offset);
551 562
552 Builtins* builtins = isolate_->builtins();
553 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric);
554 uint32_t pc = reinterpret_cast<uint32_t>( 563 uint32_t pc = reinterpret_cast<uint32_t>(
555 construct_stub->instruction_start() + 564 construct_stub->instruction_start() +
556 isolate_->heap()->construct_stub_deopt_pc_offset()->value()); 565 isolate_->heap()->construct_stub_deopt_pc_offset()->value());
557 output_frame->SetPc(pc); 566 output_frame->SetPc(pc);
558 } 567 }
559 568
560 569
561 // This code is very similar to ia32/arm code, but relies on register names 570 // This code is very similar to ia32/arm code, but relies on register names
562 // (fp, sp) and how the frame is laid out. 571 // (fp, sp) and how the frame is laid out.
563 void Deoptimizer::DoComputeJSFrame(TranslationIterator* iterator, 572 void Deoptimizer::DoComputeJSFrame(TranslationIterator* iterator,
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 } 992 }
984 993
985 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), 994 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start),
986 count() * table_entry_size_); 995 count() * table_entry_size_);
987 } 996 }
988 997
989 #undef __ 998 #undef __
990 999
991 1000
992 } } // namespace v8::internal 1001 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698