OLD | NEW |
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 8409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8420 RelocInfo* info = it.rinfo(); | 8420 RelocInfo* info = it.rinfo(); |
8421 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 8421 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
8422 if (target->is_inline_cache_stub()) { | 8422 if (target->is_inline_cache_stub()) { |
8423 IC::Clear(info->pc()); | 8423 IC::Clear(info->pc()); |
8424 } | 8424 } |
8425 } | 8425 } |
8426 } | 8426 } |
8427 | 8427 |
8428 | 8428 |
8429 void Code::ClearTypeFeedbackCells(Heap* heap) { | 8429 void Code::ClearTypeFeedbackCells(Heap* heap) { |
| 8430 if (kind() != FUNCTION) return; |
8430 Object* raw_info = type_feedback_info(); | 8431 Object* raw_info = type_feedback_info(); |
8431 if (raw_info->IsTypeFeedbackInfo()) { | 8432 if (raw_info->IsTypeFeedbackInfo()) { |
8432 TypeFeedbackCells* type_feedback_cells = | 8433 TypeFeedbackCells* type_feedback_cells = |
8433 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); | 8434 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); |
8434 for (int i = 0; i < type_feedback_cells->CellCount(); i++) { | 8435 for (int i = 0; i < type_feedback_cells->CellCount(); i++) { |
8435 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); | 8436 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); |
8436 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); | 8437 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); |
8437 } | 8438 } |
8438 } | 8439 } |
8439 } | 8440 } |
8440 | 8441 |
8441 | 8442 |
8442 bool Code::allowed_in_shared_map_code_cache() { | 8443 bool Code::allowed_in_shared_map_code_cache() { |
8443 return is_keyed_load_stub() || is_keyed_store_stub() || | 8444 return is_keyed_load_stub() || is_keyed_store_stub() || |
8444 (is_compare_ic_stub() && compare_state() == CompareIC::KNOWN_OBJECTS); | 8445 (is_compare_ic_stub() && |
| 8446 ICCompareStub::CompareState(stub_info()) == CompareIC::KNOWN_OBJECTS); |
8445 } | 8447 } |
8446 | 8448 |
8447 | 8449 |
8448 #ifdef ENABLE_DISASSEMBLER | 8450 #ifdef ENABLE_DISASSEMBLER |
8449 | 8451 |
8450 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { | 8452 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { |
8451 disasm::NameConverter converter; | 8453 disasm::NameConverter converter; |
8452 int deopt_count = DeoptCount(); | 8454 int deopt_count = DeoptCount(); |
8453 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); | 8455 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); |
8454 if (0 == deopt_count) return; | 8456 if (0 == deopt_count) return; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8696 if (is_inline_cache_stub()) { | 8698 if (is_inline_cache_stub()) { |
8697 PrintF(out, "ic_state = %s\n", ICState2String(ic_state())); | 8699 PrintF(out, "ic_state = %s\n", ICState2String(ic_state())); |
8698 PrintExtraICState(out, kind(), extra_ic_state()); | 8700 PrintExtraICState(out, kind(), extra_ic_state()); |
8699 if (ic_state() == MONOMORPHIC) { | 8701 if (ic_state() == MONOMORPHIC) { |
8700 PrintF(out, "type = %s\n", StubType2String(type())); | 8702 PrintF(out, "type = %s\n", StubType2String(type())); |
8701 } | 8703 } |
8702 if (is_call_stub() || is_keyed_call_stub()) { | 8704 if (is_call_stub() || is_keyed_call_stub()) { |
8703 PrintF(out, "argc = %d\n", arguments_count()); | 8705 PrintF(out, "argc = %d\n", arguments_count()); |
8704 } | 8706 } |
8705 if (is_compare_ic_stub()) { | 8707 if (is_compare_ic_stub()) { |
8706 CompareIC::State state = CompareIC::ComputeState(this); | 8708 ASSERT(major_key() == CodeStub::CompareIC); |
8707 PrintF(out, "compare_state = %s\n", CompareIC::GetStateName(state)); | 8709 CompareIC::State left_state, right_state, handler_state; |
8708 } | 8710 Token::Value op; |
8709 if (is_compare_ic_stub() && major_key() == CodeStub::CompareIC) { | 8711 ICCompareStub::DecodeMinorKey(stub_info(), &left_state, &right_state, |
8710 Token::Value op = CompareIC::ComputeOperation(this); | 8712 &handler_state, &op); |
| 8713 PrintF(out, "compare_state = %s*%s -> %s\n", |
| 8714 CompareIC::GetStateName(left_state), |
| 8715 CompareIC::GetStateName(right_state), |
| 8716 CompareIC::GetStateName(handler_state)); |
8711 PrintF(out, "compare_operation = %s\n", Token::Name(op)); | 8717 PrintF(out, "compare_operation = %s\n", Token::Name(op)); |
8712 } | 8718 } |
8713 } | 8719 } |
8714 if ((name != NULL) && (name[0] != '\0')) { | 8720 if ((name != NULL) && (name[0] != '\0')) { |
8715 PrintF(out, "name = %s\n", name); | 8721 PrintF(out, "name = %s\n", name); |
8716 } | 8722 } |
8717 if (kind() == OPTIMIZED_FUNCTION) { | 8723 if (kind() == OPTIMIZED_FUNCTION) { |
8718 PrintF(out, "stack_slots = %d\n", stack_slots()); | 8724 PrintF(out, "stack_slots = %d\n", stack_slots()); |
8719 } | 8725 } |
8720 | 8726 |
(...skipping 25 matching lines...) Expand all Loading... |
8746 PrintF(out, " %6d", entry.deoptimization_index()); | 8752 PrintF(out, " %6d", entry.deoptimization_index()); |
8747 } else { | 8753 } else { |
8748 PrintF(out, " <none>"); | 8754 PrintF(out, " <none>"); |
8749 } | 8755 } |
8750 if (entry.argument_count() > 0) { | 8756 if (entry.argument_count() > 0) { |
8751 PrintF(out, " argc: %d", entry.argument_count()); | 8757 PrintF(out, " argc: %d", entry.argument_count()); |
8752 } | 8758 } |
8753 PrintF(out, "\n"); | 8759 PrintF(out, "\n"); |
8754 } | 8760 } |
8755 PrintF(out, "\n"); | 8761 PrintF(out, "\n"); |
8756 // Just print if type feedback info is ever used for optimized code. | |
8757 ASSERT(type_feedback_info()->IsUndefined()); | |
8758 } else if (kind() == FUNCTION) { | 8762 } else if (kind() == FUNCTION) { |
8759 unsigned offset = stack_check_table_offset(); | 8763 unsigned offset = stack_check_table_offset(); |
8760 // If there is no stack check table, the "table start" will at or after | 8764 // If there is no stack check table, the "table start" will at or after |
8761 // (due to alignment) the end of the instruction stream. | 8765 // (due to alignment) the end of the instruction stream. |
8762 if (static_cast<int>(offset) < instruction_size()) { | 8766 if (static_cast<int>(offset) < instruction_size()) { |
8763 unsigned* address = | 8767 unsigned* address = |
8764 reinterpret_cast<unsigned*>(instruction_start() + offset); | 8768 reinterpret_cast<unsigned*>(instruction_start() + offset); |
8765 unsigned length = address[0]; | 8769 unsigned length = address[0]; |
8766 PrintF(out, "Stack checks (size = %u)\n", length); | 8770 PrintF(out, "Stack checks (size = %u)\n", length); |
8767 PrintF(out, "ast_id pc_offset\n"); | 8771 PrintF(out, "ast_id pc_offset\n"); |
(...skipping 4705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13473 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13477 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13474 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13478 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13475 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13479 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13476 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13480 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13477 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13481 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13478 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13482 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13479 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13483 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13480 } | 13484 } |
13481 | 13485 |
13482 } } // namespace v8::internal | 13486 } } // namespace v8::internal |
OLD | NEW |