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

Side by Side Diff: src/objects.cc

Issue 10837165: Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback; fixed tests Created 8 years, 1 month 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/objects.h ('k') | src/objects-inl.h » ('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 8763 matching lines...) Expand 10 before | Expand all | Expand 10 after
8774 RelocInfo* info = it.rinfo(); 8774 RelocInfo* info = it.rinfo();
8775 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); 8775 Code* target(Code::GetCodeFromTargetAddress(info->target_address()));
8776 if (target->is_inline_cache_stub()) { 8776 if (target->is_inline_cache_stub()) {
8777 IC::Clear(info->pc()); 8777 IC::Clear(info->pc());
8778 } 8778 }
8779 } 8779 }
8780 } 8780 }
8781 8781
8782 8782
8783 void Code::ClearTypeFeedbackCells(Heap* heap) { 8783 void Code::ClearTypeFeedbackCells(Heap* heap) {
8784 if (kind() != FUNCTION) return;
8784 Object* raw_info = type_feedback_info(); 8785 Object* raw_info = type_feedback_info();
8785 if (raw_info->IsTypeFeedbackInfo()) { 8786 if (raw_info->IsTypeFeedbackInfo()) {
8786 TypeFeedbackCells* type_feedback_cells = 8787 TypeFeedbackCells* type_feedback_cells =
8787 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); 8788 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells();
8788 for (int i = 0; i < type_feedback_cells->CellCount(); i++) { 8789 for (int i = 0; i < type_feedback_cells->CellCount(); i++) {
8789 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); 8790 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i);
8790 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); 8791 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap));
8791 } 8792 }
8792 } 8793 }
8793 } 8794 }
8794 8795
8795 8796
8796 bool Code::allowed_in_shared_map_code_cache() { 8797 bool Code::allowed_in_shared_map_code_cache() {
8797 return is_keyed_load_stub() || is_keyed_store_stub() || 8798 return is_keyed_load_stub() || is_keyed_store_stub() ||
8798 (is_compare_ic_stub() && compare_state() == CompareIC::KNOWN_OBJECTS); 8799 (is_compare_ic_stub() &&
8800 ICCompareStub::CompareState(stub_info()) == CompareIC::KNOWN_OBJECTS);
8799 } 8801 }
8800 8802
8801 8803
8802 void Code::MakeCodeAgeSequenceYoung(byte* sequence) { 8804 void Code::MakeCodeAgeSequenceYoung(byte* sequence) {
8803 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY); 8805 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY);
8804 } 8806 }
8805 8807
8806 8808
8807 void Code::MakeYoung() { 8809 void Code::MakeYoung() {
8808 byte* sequence = FindCodeAgeSequence(); 8810 byte* sequence = FindCodeAgeSequence();
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
9143 if (is_inline_cache_stub()) { 9145 if (is_inline_cache_stub()) {
9144 PrintF(out, "ic_state = %s\n", ICState2String(ic_state())); 9146 PrintF(out, "ic_state = %s\n", ICState2String(ic_state()));
9145 PrintExtraICState(out, kind(), extra_ic_state()); 9147 PrintExtraICState(out, kind(), extra_ic_state());
9146 if (ic_state() == MONOMORPHIC) { 9148 if (ic_state() == MONOMORPHIC) {
9147 PrintF(out, "type = %s\n", StubType2String(type())); 9149 PrintF(out, "type = %s\n", StubType2String(type()));
9148 } 9150 }
9149 if (is_call_stub() || is_keyed_call_stub()) { 9151 if (is_call_stub() || is_keyed_call_stub()) {
9150 PrintF(out, "argc = %d\n", arguments_count()); 9152 PrintF(out, "argc = %d\n", arguments_count());
9151 } 9153 }
9152 if (is_compare_ic_stub()) { 9154 if (is_compare_ic_stub()) {
9153 CompareIC::State state = CompareIC::ComputeState(this); 9155 ASSERT(major_key() == CodeStub::CompareIC);
9154 PrintF(out, "compare_state = %s\n", CompareIC::GetStateName(state)); 9156 CompareIC::State left_state, right_state, handler_state;
9155 } 9157 Token::Value op;
9156 if (is_compare_ic_stub() && major_key() == CodeStub::CompareIC) { 9158 ICCompareStub::DecodeMinorKey(stub_info(), &left_state, &right_state,
9157 Token::Value op = CompareIC::ComputeOperation(this); 9159 &handler_state, &op);
9160 PrintF(out, "compare_state = %s*%s -> %s\n",
9161 CompareIC::GetStateName(left_state),
9162 CompareIC::GetStateName(right_state),
9163 CompareIC::GetStateName(handler_state));
9158 PrintF(out, "compare_operation = %s\n", Token::Name(op)); 9164 PrintF(out, "compare_operation = %s\n", Token::Name(op));
9159 } 9165 }
9160 } 9166 }
9161 if ((name != NULL) && (name[0] != '\0')) { 9167 if ((name != NULL) && (name[0] != '\0')) {
9162 PrintF(out, "name = %s\n", name); 9168 PrintF(out, "name = %s\n", name);
9163 } 9169 }
9164 if (kind() == OPTIMIZED_FUNCTION) { 9170 if (kind() == OPTIMIZED_FUNCTION) {
9165 PrintF(out, "stack_slots = %d\n", stack_slots()); 9171 PrintF(out, "stack_slots = %d\n", stack_slots());
9166 } 9172 }
9167 9173
(...skipping 25 matching lines...) Expand all
9193 PrintF(out, " %6d", entry.deoptimization_index()); 9199 PrintF(out, " %6d", entry.deoptimization_index());
9194 } else { 9200 } else {
9195 PrintF(out, " <none>"); 9201 PrintF(out, " <none>");
9196 } 9202 }
9197 if (entry.argument_count() > 0) { 9203 if (entry.argument_count() > 0) {
9198 PrintF(out, " argc: %d", entry.argument_count()); 9204 PrintF(out, " argc: %d", entry.argument_count());
9199 } 9205 }
9200 PrintF(out, "\n"); 9206 PrintF(out, "\n");
9201 } 9207 }
9202 PrintF(out, "\n"); 9208 PrintF(out, "\n");
9203 // Just print if type feedback info is ever used for optimized code.
9204 ASSERT(type_feedback_info()->IsUndefined());
9205 } else if (kind() == FUNCTION) { 9209 } else if (kind() == FUNCTION) {
9206 unsigned offset = stack_check_table_offset(); 9210 unsigned offset = stack_check_table_offset();
9207 // If there is no stack check table, the "table start" will at or after 9211 // If there is no stack check table, the "table start" will at or after
9208 // (due to alignment) the end of the instruction stream. 9212 // (due to alignment) the end of the instruction stream.
9209 if (static_cast<int>(offset) < instruction_size()) { 9213 if (static_cast<int>(offset) < instruction_size()) {
9210 unsigned* address = 9214 unsigned* address =
9211 reinterpret_cast<unsigned*>(instruction_start() + offset); 9215 reinterpret_cast<unsigned*>(instruction_start() + offset);
9212 unsigned length = address[0]; 9216 unsigned length = address[0];
9213 PrintF(out, "Stack checks (size = %u)\n", length); 9217 PrintF(out, "Stack checks (size = %u)\n", length);
9214 PrintF(out, "ast_id pc_offset\n"); 9218 PrintF(out, "ast_id pc_offset\n");
(...skipping 4648 matching lines...) Expand 10 before | Expand all | Expand 10 after
13863 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13867 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13864 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13868 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13865 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13869 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13866 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13870 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13867 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13871 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13868 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13872 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13869 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13873 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13870 } 13874 }
13871 13875
13872 } } // namespace v8::internal 13876 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698