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

Side by Side Diff: src/deoptimizer.cc

Issue 11498006: Revert 13157, 13145 and 13140: Crankshaft code stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/deoptimizer.h ('k') | src/disassembler.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 reinterpret_cast<intptr_t>(from), 403 reinterpret_cast<intptr_t>(from),
404 fp_to_sp_delta - (2 * kPointerSize)); 404 fp_to_sp_delta - (2 * kPointerSize));
405 } else if (FLAG_trace_osr && type == OSR) { 405 } else if (FLAG_trace_osr && type == OSR) {
406 PrintF("**** OSR: "); 406 PrintF("**** OSR: ");
407 function->PrintName(); 407 function->PrintName();
408 PrintF(" at ast id #%u, address 0x%" V8PRIxPTR ", frame size %d\n", 408 PrintF(" at ast id #%u, address 0x%" V8PRIxPTR ", frame size %d\n",
409 bailout_id, 409 bailout_id,
410 reinterpret_cast<intptr_t>(from), 410 reinterpret_cast<intptr_t>(from),
411 fp_to_sp_delta - (2 * kPointerSize)); 411 fp_to_sp_delta - (2 * kPointerSize));
412 } 412 }
413 // For COMPILED_STUBs called from builtins, the function pointer 413 function->shared()->increment_deopt_count();
414 // is a SMI indicating an internal frame.
415 if (function->IsSmi()) {
416 function = NULL;
417 }
418 if (function != NULL && function->IsOptimized()) {
419 function->shared()->increment_deopt_count();
420 }
421 // Find the optimized code. 414 // Find the optimized code.
422 if (type == EAGER) { 415 if (type == EAGER) {
423 ASSERT(from == NULL); 416 ASSERT(from == NULL);
424 compiled_code_ = function_->code(); 417 optimized_code_ = function_->code();
425 if (FLAG_trace_deopt && FLAG_code_comments) { 418 if (FLAG_trace_deopt && FLAG_code_comments) {
426 // Print instruction associated with this bailout. 419 // Print instruction associated with this bailout.
427 const char* last_comment = NULL; 420 const char* last_comment = NULL;
428 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) 421 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT)
429 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 422 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
430 for (RelocIterator it(compiled_code_, mask); !it.done(); it.next()) { 423 for (RelocIterator it(optimized_code_, mask); !it.done(); it.next()) {
431 RelocInfo* info = it.rinfo(); 424 RelocInfo* info = it.rinfo();
432 if (info->rmode() == RelocInfo::COMMENT) { 425 if (info->rmode() == RelocInfo::COMMENT) {
433 last_comment = reinterpret_cast<const char*>(info->data()); 426 last_comment = reinterpret_cast<const char*>(info->data());
434 } 427 }
435 if (info->rmode() == RelocInfo::RUNTIME_ENTRY) { 428 if (info->rmode() == RelocInfo::RUNTIME_ENTRY) {
436 unsigned id = Deoptimizer::GetDeoptimizationId( 429 unsigned id = Deoptimizer::GetDeoptimizationId(
437 info->target_address(), Deoptimizer::EAGER); 430 info->target_address(), Deoptimizer::EAGER);
438 if (id == bailout_id && last_comment != NULL) { 431 if (id == bailout_id && last_comment != NULL) {
439 PrintF(" %s\n", last_comment); 432 PrintF(" %s\n", last_comment);
440 break; 433 break;
441 } 434 }
442 } 435 }
443 } 436 }
444 } 437 }
445 } else if (type == LAZY) { 438 } else if (type == LAZY) {
446 compiled_code_ = FindDeoptimizingCodeFromAddress(from); 439 optimized_code_ = FindDeoptimizingCodeFromAddress(from);
447 if (compiled_code_ == NULL) { 440 ASSERT(optimized_code_ != NULL);
448 compiled_code_ =
449 static_cast<Code*>(isolate->heap()->FindCodeObject(from));
450 }
451 ASSERT(compiled_code_ != NULL);
452 } else if (type == OSR) { 441 } else if (type == OSR) {
453 // The function has already been optimized and we're transitioning 442 // The function has already been optimized and we're transitioning
454 // from the unoptimized shared version to the optimized one in the 443 // from the unoptimized shared version to the optimized one in the
455 // function. The return address (from) points to unoptimized code. 444 // function. The return address (from) points to unoptimized code.
456 compiled_code_ = function_->code(); 445 optimized_code_ = function_->code();
457 ASSERT(compiled_code_->kind() == Code::OPTIMIZED_FUNCTION); 446 ASSERT(optimized_code_->kind() == Code::OPTIMIZED_FUNCTION);
458 ASSERT(!compiled_code_->contains(from)); 447 ASSERT(!optimized_code_->contains(from));
459 } else if (type == DEBUGGER) { 448 } else if (type == DEBUGGER) {
460 compiled_code_ = optimized_code; 449 optimized_code_ = optimized_code;
461 ASSERT(compiled_code_->contains(from)); 450 ASSERT(optimized_code_->contains(from));
462 } 451 }
463 ASSERT(HEAP->allow_allocation(false)); 452 ASSERT(HEAP->allow_allocation(false));
464 unsigned size = ComputeInputFrameSize(); 453 unsigned size = ComputeInputFrameSize();
465 input_ = new(size) FrameDescription(size, function); 454 input_ = new(size) FrameDescription(size, function);
466 input_->SetFrameType(StackFrame::JAVA_SCRIPT); 455 input_->SetFrameType(StackFrame::JAVA_SCRIPT);
467 } 456 }
468 457
469 458
470 Deoptimizer::~Deoptimizer() { 459 Deoptimizer::~Deoptimizer() {
471 ASSERT(input_ == NULL && output_ == NULL); 460 ASSERT(input_ == NULL && output_ == NULL);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 PrintF("[deoptimizing%s: begin 0x%08" V8PRIxPTR " ", 566 PrintF("[deoptimizing%s: begin 0x%08" V8PRIxPTR " ",
578 (bailout_type_ == LAZY ? " (lazy)" : ""), 567 (bailout_type_ == LAZY ? " (lazy)" : ""),
579 reinterpret_cast<intptr_t>(function_)); 568 reinterpret_cast<intptr_t>(function_));
580 function_->PrintName(); 569 function_->PrintName();
581 PrintF(" @%d]\n", bailout_id_); 570 PrintF(" @%d]\n", bailout_id_);
582 } 571 }
583 572
584 // Determine basic deoptimization information. The optimized frame is 573 // Determine basic deoptimization information. The optimized frame is
585 // described by the input data. 574 // described by the input data.
586 DeoptimizationInputData* input_data = 575 DeoptimizationInputData* input_data =
587 DeoptimizationInputData::cast(compiled_code_->deoptimization_data()); 576 DeoptimizationInputData::cast(optimized_code_->deoptimization_data());
588 BailoutId node_id = input_data->AstId(bailout_id_); 577 BailoutId node_id = input_data->AstId(bailout_id_);
589 ByteArray* translations = input_data->TranslationByteArray(); 578 ByteArray* translations = input_data->TranslationByteArray();
590 unsigned translation_index = 579 unsigned translation_index =
591 input_data->TranslationIndex(bailout_id_)->value(); 580 input_data->TranslationIndex(bailout_id_)->value();
592 581
593 // Do the input frame to output frame(s) translation. 582 // Do the input frame to output frame(s) translation.
594 TranslationIterator iterator(translations, translation_index); 583 TranslationIterator iterator(translations, translation_index);
595 Translation::Opcode opcode = 584 Translation::Opcode opcode =
596 static_cast<Translation::Opcode>(iterator.Next()); 585 static_cast<Translation::Opcode>(iterator.Next());
597 ASSERT(Translation::BEGIN == opcode); 586 ASSERT(Translation::BEGIN == opcode);
(...skipping 24 matching lines...) Expand all
622 break; 611 break;
623 case Translation::CONSTRUCT_STUB_FRAME: 612 case Translation::CONSTRUCT_STUB_FRAME:
624 DoComputeConstructStubFrame(&iterator, i); 613 DoComputeConstructStubFrame(&iterator, i);
625 break; 614 break;
626 case Translation::GETTER_STUB_FRAME: 615 case Translation::GETTER_STUB_FRAME:
627 DoComputeAccessorStubFrame(&iterator, i, false); 616 DoComputeAccessorStubFrame(&iterator, i, false);
628 break; 617 break;
629 case Translation::SETTER_STUB_FRAME: 618 case Translation::SETTER_STUB_FRAME:
630 DoComputeAccessorStubFrame(&iterator, i, true); 619 DoComputeAccessorStubFrame(&iterator, i, true);
631 break; 620 break;
632 case Translation::COMPILED_STUB_FRAME:
633 DoCompiledStubFrame(&iterator, i);
634 break;
635 case Translation::BEGIN: 621 case Translation::BEGIN:
636 case Translation::REGISTER: 622 case Translation::REGISTER:
637 case Translation::INT32_REGISTER: 623 case Translation::INT32_REGISTER:
638 case Translation::UINT32_REGISTER: 624 case Translation::UINT32_REGISTER:
639 case Translation::DOUBLE_REGISTER: 625 case Translation::DOUBLE_REGISTER:
640 case Translation::STACK_SLOT: 626 case Translation::STACK_SLOT:
641 case Translation::INT32_STACK_SLOT: 627 case Translation::INT32_STACK_SLOT:
642 case Translation::UINT32_STACK_SLOT: 628 case Translation::UINT32_STACK_SLOT:
643 case Translation::DOUBLE_STACK_SLOT: 629 case Translation::DOUBLE_STACK_SLOT:
644 case Translation::LITERAL: 630 case Translation::LITERAL:
645 case Translation::ARGUMENTS_OBJECT: 631 case Translation::ARGUMENTS_OBJECT:
646 case Translation::DUPLICATE: 632 case Translation::DUPLICATE:
647 default:
648 UNREACHABLE(); 633 UNREACHABLE();
649 break; 634 break;
650 } 635 }
651 } 636 }
652 637
653 // Print some helpful diagnostic information. 638 // Print some helpful diagnostic information.
654 if (FLAG_trace_deopt) { 639 if (FLAG_trace_deopt) {
655 double ms = static_cast<double>(OS::Ticks() - start) / 1000; 640 double ms = static_cast<double>(OS::Ticks() - start) / 1000;
656 int index = output_count_ - 1; // Index of the topmost frame. 641 int index = output_count_ - 1; // Index of the topmost frame.
657 JSFunction* function = output_[index]->GetFunction(); 642 JSFunction* function = output_[index]->GetFunction();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 opcode = static_cast<Translation::Opcode>(iterator->Next()); 802 opcode = static_cast<Translation::Opcode>(iterator->Next());
818 } 803 }
819 804
820 switch (opcode) { 805 switch (opcode) {
821 case Translation::BEGIN: 806 case Translation::BEGIN:
822 case Translation::JS_FRAME: 807 case Translation::JS_FRAME:
823 case Translation::ARGUMENTS_ADAPTOR_FRAME: 808 case Translation::ARGUMENTS_ADAPTOR_FRAME:
824 case Translation::CONSTRUCT_STUB_FRAME: 809 case Translation::CONSTRUCT_STUB_FRAME:
825 case Translation::GETTER_STUB_FRAME: 810 case Translation::GETTER_STUB_FRAME:
826 case Translation::SETTER_STUB_FRAME: 811 case Translation::SETTER_STUB_FRAME:
827 case Translation::COMPILED_STUB_FRAME:
828 case Translation::DUPLICATE: 812 case Translation::DUPLICATE:
829 UNREACHABLE(); 813 UNREACHABLE();
830 return; 814 return;
831 815
832 case Translation::REGISTER: { 816 case Translation::REGISTER: {
833 int input_reg = iterator->Next(); 817 int input_reg = iterator->Next();
834 intptr_t input_value = input_->GetRegister(input_reg); 818 intptr_t input_value = input_->GetRegister(input_reg);
835 if (FLAG_trace_deopt) { 819 if (FLAG_trace_deopt) {
836 PrintF( 820 PrintF(
837 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s ", 821 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s ",
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 opcode = static_cast<Translation::Opcode>(iterator->Next()); 1110 opcode = static_cast<Translation::Opcode>(iterator->Next());
1127 } 1111 }
1128 1112
1129 switch (opcode) { 1113 switch (opcode) {
1130 case Translation::BEGIN: 1114 case Translation::BEGIN:
1131 case Translation::JS_FRAME: 1115 case Translation::JS_FRAME:
1132 case Translation::ARGUMENTS_ADAPTOR_FRAME: 1116 case Translation::ARGUMENTS_ADAPTOR_FRAME:
1133 case Translation::CONSTRUCT_STUB_FRAME: 1117 case Translation::CONSTRUCT_STUB_FRAME:
1134 case Translation::GETTER_STUB_FRAME: 1118 case Translation::GETTER_STUB_FRAME:
1135 case Translation::SETTER_STUB_FRAME: 1119 case Translation::SETTER_STUB_FRAME:
1136 case Translation::COMPILED_STUB_FRAME:
1137 case Translation::DUPLICATE: 1120 case Translation::DUPLICATE:
1138 UNREACHABLE(); // Malformed input. 1121 UNREACHABLE(); // Malformed input.
1139 return false; 1122 return false;
1140 1123
1141 case Translation::REGISTER: { 1124 case Translation::REGISTER: {
1142 int output_reg = iterator->Next(); 1125 int output_reg = iterator->Next();
1143 if (FLAG_trace_osr) { 1126 if (FLAG_trace_osr) {
1144 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n", 1127 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n",
1145 converter.NameOfCPURegister(output_reg), 1128 converter.NameOfCPURegister(output_reg),
1146 input_value, 1129 input_value,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 // The fp-to-sp delta already takes the context and the function 1330 // The fp-to-sp delta already takes the context and the function
1348 // into account so we have to avoid double counting them (-2). 1331 // into account so we have to avoid double counting them (-2).
1349 unsigned result = fixed_size + fp_to_sp_delta_ - (2 * kPointerSize); 1332 unsigned result = fixed_size + fp_to_sp_delta_ - (2 * kPointerSize);
1350 #ifdef DEBUG 1333 #ifdef DEBUG
1351 if (bailout_type_ == OSR) { 1334 if (bailout_type_ == OSR) {
1352 // TODO(kasperl): It would be nice if we could verify that the 1335 // TODO(kasperl): It would be nice if we could verify that the
1353 // size matches with the stack height we can compute based on the 1336 // size matches with the stack height we can compute based on the
1354 // environment at the OSR entry. The code for that his built into 1337 // environment at the OSR entry. The code for that his built into
1355 // the DoComputeOsrOutputFrame function for now. 1338 // the DoComputeOsrOutputFrame function for now.
1356 } else { 1339 } else {
1357 unsigned stack_slots = compiled_code_->stack_slots(); 1340 unsigned stack_slots = optimized_code_->stack_slots();
1358 unsigned outgoing_size = compiled_code_->kind() == Code::COMPILED_STUB 1341 unsigned outgoing_size = ComputeOutgoingArgumentSize();
1359 ? 0 : ComputeOutgoingArgumentSize();
1360 ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size); 1342 ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size);
1361 } 1343 }
1362 #endif 1344 #endif
1363 return result; 1345 return result;
1364 } 1346 }
1365 1347
1366 1348
1367 unsigned Deoptimizer::ComputeFixedSize(JSFunction* function) const { 1349 unsigned Deoptimizer::ComputeFixedSize(JSFunction* function) const {
1368 // The fixed part of the frame consists of the return address, frame 1350 // The fixed part of the frame consists of the return address, frame
1369 // pointer, function, context, and all the incoming arguments. 1351 // pointer, function, context, and all the incoming arguments.
1370 return ComputeIncomingArgumentSize(function) + 1352 return ComputeIncomingArgumentSize(function) +
1371 StandardFrameConstants::kFixedFrameSize; 1353 StandardFrameConstants::kFixedFrameSize;
1372 } 1354 }
1373 1355
1374 1356
1375 unsigned Deoptimizer::ComputeIncomingArgumentSize(JSFunction* function) const { 1357 unsigned Deoptimizer::ComputeIncomingArgumentSize(JSFunction* function) const {
1376 // The incoming arguments is the values for formal parameters and 1358 // The incoming arguments is the values for formal parameters and
1377 // the receiver. Every slot contains a pointer. 1359 // the receiver. Every slot contains a pointer.
1378 if (function->IsSmi()) {
1379 ASSERT(Smi::cast(function) == Smi::FromInt(StackFrame::STUB));
1380 return 0;
1381 }
1382 unsigned arguments = function->shared()->formal_parameter_count() + 1; 1360 unsigned arguments = function->shared()->formal_parameter_count() + 1;
1383 return arguments * kPointerSize; 1361 return arguments * kPointerSize;
1384 } 1362 }
1385 1363
1386 1364
1387 unsigned Deoptimizer::ComputeOutgoingArgumentSize() const { 1365 unsigned Deoptimizer::ComputeOutgoingArgumentSize() const {
1388 DeoptimizationInputData* data = DeoptimizationInputData::cast( 1366 DeoptimizationInputData* data = DeoptimizationInputData::cast(
1389 compiled_code_->deoptimization_data()); 1367 optimized_code_->deoptimization_data());
1390 unsigned height = data->ArgumentsStackHeight(bailout_id_)->value(); 1368 unsigned height = data->ArgumentsStackHeight(bailout_id_)->value();
1391 return height * kPointerSize; 1369 return height * kPointerSize;
1392 } 1370 }
1393 1371
1394 1372
1395 Object* Deoptimizer::ComputeLiteral(int index) const { 1373 Object* Deoptimizer::ComputeLiteral(int index) const {
1396 DeoptimizationInputData* data = DeoptimizationInputData::cast( 1374 DeoptimizationInputData* data = DeoptimizationInputData::cast(
1397 compiled_code_->deoptimization_data()); 1375 optimized_code_->deoptimization_data());
1398 FixedArray* literals = data->LiteralArray(); 1376 FixedArray* literals = data->LiteralArray();
1399 return literals->get(index); 1377 return literals->get(index);
1400 } 1378 }
1401 1379
1402 1380
1403 void Deoptimizer::AddArgumentsObject(intptr_t slot_address, int argc) { 1381 void Deoptimizer::AddArgumentsObject(intptr_t slot_address, int argc) {
1404 ArgumentsObjectMaterializationDescriptor object_desc( 1382 ArgumentsObjectMaterializationDescriptor object_desc(
1405 reinterpret_cast<Address>(slot_address), argc); 1383 reinterpret_cast<Address>(slot_address), argc);
1406 deferred_arguments_objects_.Add(object_desc); 1384 deferred_arguments_objects_.Add(object_desc);
1407 } 1385 }
(...skipping 10 matching lines...) Expand all
1418 deferred_heap_numbers_.Add(value_desc); 1396 deferred_heap_numbers_.Add(value_desc);
1419 } 1397 }
1420 1398
1421 1399
1422 void Deoptimizer::EnsureCodeForDeoptimizationEntry(BailoutType type, 1400 void Deoptimizer::EnsureCodeForDeoptimizationEntry(BailoutType type,
1423 int max_entry_id) { 1401 int max_entry_id) {
1424 // We cannot run this if the serializer is enabled because this will 1402 // We cannot run this if the serializer is enabled because this will
1425 // cause us to emit relocation information for the external 1403 // cause us to emit relocation information for the external
1426 // references. This is fine because the deoptimizer's code section 1404 // references. This is fine because the deoptimizer's code section
1427 // isn't meant to be serialized at all. 1405 // isn't meant to be serialized at all.
1406 ASSERT(!Serializer::enabled());
1407
1428 ASSERT(type == EAGER || type == LAZY); 1408 ASSERT(type == EAGER || type == LAZY);
1429 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); 1409 DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
1430 int entry_count = (type == EAGER) 1410 int entry_count = (type == EAGER)
1431 ? data->eager_deoptimization_entry_code_entries_ 1411 ? data->eager_deoptimization_entry_code_entries_
1432 : data->lazy_deoptimization_entry_code_entries_; 1412 : data->lazy_deoptimization_entry_code_entries_;
1433 if (max_entry_id < entry_count) return; 1413 if (max_entry_id < entry_count) return;
1434 entry_count = Min(Max(entry_count * 2, Deoptimizer::kMinNumberOfEntries), 1414 entry_count = Min(Max(entry_count * 2, Deoptimizer::kMinNumberOfEntries),
1435 Deoptimizer::kMaxNumberOfEntries); 1415 Deoptimizer::kMaxNumberOfEntries);
1436 1416
1437 MacroAssembler masm(Isolate::Current(), NULL, 16 * KB); 1417 MacroAssembler masm(Isolate::Current(), NULL, 16 * KB);
1438 masm.set_emit_debug_code(false); 1418 masm.set_emit_debug_code(false);
1439 GenerateDeoptimizationEntries(&masm, entry_count, type); 1419 GenerateDeoptimizationEntries(&masm, entry_count, type);
1440 CodeDesc desc; 1420 CodeDesc desc;
1441 masm.GetCode(&desc); 1421 masm.GetCode(&desc);
1422 ASSERT(desc.reloc_size == 0);
1442 1423
1443 VirtualMemory* memory = type == EAGER 1424 VirtualMemory* memory = type == EAGER
1444 ? data->eager_deoptimization_entry_code_ 1425 ? data->eager_deoptimization_entry_code_
1445 : data->lazy_deoptimization_entry_code_; 1426 : data->lazy_deoptimization_entry_code_;
1446 size_t table_size = Deoptimizer::GetMaxDeoptTableSize(); 1427 size_t table_size = Deoptimizer::GetMaxDeoptTableSize();
1447 ASSERT(static_cast<int>(table_size) >= desc.instr_size); 1428 ASSERT(static_cast<int>(table_size) >= desc.instr_size);
1448 memory->Commit(memory->address(), table_size, true); 1429 memory->Commit(memory->address(), table_size, true);
1449 memcpy(memory->address(), desc.buffer, desc.instr_size); 1430 memcpy(memory->address(), desc.buffer, desc.instr_size);
1450 CPU::FlushICache(memory->address(), desc.instr_size); 1431 CPU::FlushICache(memory->address(), desc.instr_size);
1451 1432
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 void Translation::BeginJSFrame(BailoutId node_id, 1674 void Translation::BeginJSFrame(BailoutId node_id,
1694 int literal_id, 1675 int literal_id,
1695 unsigned height) { 1676 unsigned height) {
1696 buffer_->Add(JS_FRAME, zone()); 1677 buffer_->Add(JS_FRAME, zone());
1697 buffer_->Add(node_id.ToInt(), zone()); 1678 buffer_->Add(node_id.ToInt(), zone());
1698 buffer_->Add(literal_id, zone()); 1679 buffer_->Add(literal_id, zone());
1699 buffer_->Add(height, zone()); 1680 buffer_->Add(height, zone());
1700 } 1681 }
1701 1682
1702 1683
1703 void Translation::BeginCompiledStubFrame() {
1704 buffer_->Add(COMPILED_STUB_FRAME, zone());
1705 }
1706
1707
1708 void Translation::StoreRegister(Register reg) { 1684 void Translation::StoreRegister(Register reg) {
1709 buffer_->Add(REGISTER, zone()); 1685 buffer_->Add(REGISTER, zone());
1710 buffer_->Add(reg.code(), zone()); 1686 buffer_->Add(reg.code(), zone());
1711 } 1687 }
1712 1688
1713 1689
1714 void Translation::StoreInt32Register(Register reg) { 1690 void Translation::StoreInt32Register(Register reg) {
1715 buffer_->Add(INT32_REGISTER, zone()); 1691 buffer_->Add(INT32_REGISTER, zone());
1716 buffer_->Add(reg.code(), zone()); 1692 buffer_->Add(reg.code(), zone());
1717 } 1693 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 case SETTER_STUB_FRAME: 1755 case SETTER_STUB_FRAME:
1780 case REGISTER: 1756 case REGISTER:
1781 case INT32_REGISTER: 1757 case INT32_REGISTER:
1782 case UINT32_REGISTER: 1758 case UINT32_REGISTER:
1783 case DOUBLE_REGISTER: 1759 case DOUBLE_REGISTER:
1784 case STACK_SLOT: 1760 case STACK_SLOT:
1785 case INT32_STACK_SLOT: 1761 case INT32_STACK_SLOT:
1786 case UINT32_STACK_SLOT: 1762 case UINT32_STACK_SLOT:
1787 case DOUBLE_STACK_SLOT: 1763 case DOUBLE_STACK_SLOT:
1788 case LITERAL: 1764 case LITERAL:
1789 case COMPILED_STUB_FRAME:
1790 return 1; 1765 return 1;
1791 case BEGIN: 1766 case BEGIN:
1792 case ARGUMENTS_ADAPTOR_FRAME: 1767 case ARGUMENTS_ADAPTOR_FRAME:
1793 case CONSTRUCT_STUB_FRAME: 1768 case CONSTRUCT_STUB_FRAME:
1794 case ARGUMENTS_OBJECT: 1769 case ARGUMENTS_OBJECT:
1795 return 2; 1770 return 2;
1796 case JS_FRAME: 1771 case JS_FRAME:
1797 return 3; 1772 return 3;
1798 } 1773 }
1799 UNREACHABLE(); 1774 UNREACHABLE();
(...skipping 10 matching lines...) Expand all
1810 case JS_FRAME: 1785 case JS_FRAME:
1811 return "JS_FRAME"; 1786 return "JS_FRAME";
1812 case ARGUMENTS_ADAPTOR_FRAME: 1787 case ARGUMENTS_ADAPTOR_FRAME:
1813 return "ARGUMENTS_ADAPTOR_FRAME"; 1788 return "ARGUMENTS_ADAPTOR_FRAME";
1814 case CONSTRUCT_STUB_FRAME: 1789 case CONSTRUCT_STUB_FRAME:
1815 return "CONSTRUCT_STUB_FRAME"; 1790 return "CONSTRUCT_STUB_FRAME";
1816 case GETTER_STUB_FRAME: 1791 case GETTER_STUB_FRAME:
1817 return "GETTER_STUB_FRAME"; 1792 return "GETTER_STUB_FRAME";
1818 case SETTER_STUB_FRAME: 1793 case SETTER_STUB_FRAME:
1819 return "SETTER_STUB_FRAME"; 1794 return "SETTER_STUB_FRAME";
1820 case COMPILED_STUB_FRAME:
1821 return "COMPILED_STUB_FRAME";
1822 case REGISTER: 1795 case REGISTER:
1823 return "REGISTER"; 1796 return "REGISTER";
1824 case INT32_REGISTER: 1797 case INT32_REGISTER:
1825 return "INT32_REGISTER"; 1798 return "INT32_REGISTER";
1826 case UINT32_REGISTER: 1799 case UINT32_REGISTER:
1827 return "UINT32_REGISTER"; 1800 return "UINT32_REGISTER";
1828 case DOUBLE_REGISTER: 1801 case DOUBLE_REGISTER:
1829 return "DOUBLE_REGISTER"; 1802 return "DOUBLE_REGISTER";
1830 case STACK_SLOT: 1803 case STACK_SLOT:
1831 return "STACK_SLOT"; 1804 return "STACK_SLOT";
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 case Translation::DOUBLE_STACK_SLOT: { 1892 case Translation::DOUBLE_STACK_SLOT: {
1920 int slot_index = iterator->Next(); 1893 int slot_index = iterator->Next();
1921 Address slot_addr = SlotAddress(frame, slot_index); 1894 Address slot_addr = SlotAddress(frame, slot_index);
1922 return SlotRef(slot_addr, SlotRef::DOUBLE); 1895 return SlotRef(slot_addr, SlotRef::DOUBLE);
1923 } 1896 }
1924 1897
1925 case Translation::LITERAL: { 1898 case Translation::LITERAL: {
1926 int literal_index = iterator->Next(); 1899 int literal_index = iterator->Next();
1927 return SlotRef(data->LiteralArray()->get(literal_index)); 1900 return SlotRef(data->LiteralArray()->get(literal_index));
1928 } 1901 }
1929
1930 case Translation::COMPILED_STUB_FRAME:
1931 UNREACHABLE();
1932 break;
1933 } 1902 }
1934 1903
1935 UNREACHABLE(); 1904 UNREACHABLE();
1936 return SlotRef(); 1905 return SlotRef();
1937 } 1906 }
1938 1907
1939 1908
1940 void SlotRef::ComputeSlotsForArguments(Vector<SlotRef>* args_slots, 1909 void SlotRef::ComputeSlotsForArguments(Vector<SlotRef>* args_slots,
1941 TranslationIterator* it, 1910 TranslationIterator* it,
1942 DeoptimizationInputData* data, 1911 DeoptimizationInputData* data,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 2022
2054 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2023 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
2055 v->VisitPointer(BitCast<Object**>(&function_)); 2024 v->VisitPointer(BitCast<Object**>(&function_));
2056 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2025 v->VisitPointers(parameters_, parameters_ + parameters_count_);
2057 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2026 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
2058 } 2027 }
2059 2028
2060 #endif // ENABLE_DEBUGGER_SUPPORT 2029 #endif // ENABLE_DEBUGGER_SUPPORT
2061 2030
2062 } } // namespace v8::internal 2031 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698