| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 { | 153 { |
| 154 HandleScope scope(isolate); | 154 HandleScope scope(isolate); |
| 155 | 155 |
| 156 Handle<Code> new_object = GenerateCode(isolate); | 156 Handle<Code> new_object = GenerateCode(isolate); |
| 157 new_object->set_major_key(MajorKey()); | 157 new_object->set_major_key(MajorKey()); |
| 158 FinishCode(new_object); | 158 FinishCode(new_object); |
| 159 RecordCodeGeneration(*new_object, isolate); | 159 RecordCodeGeneration(*new_object, isolate); |
| 160 | 160 |
| 161 #ifdef ENABLE_DISASSEMBLER | 161 #ifdef ENABLE_DISASSEMBLER |
| 162 if (FLAG_print_code_stubs) { | 162 if (FLAG_print_code_stubs) { |
| 163 new_object->Disassemble(*GetName()); | 163 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); |
| 164 PrintF("\n"); | 164 new_object->Disassemble(*GetName(), trace_scope.file()); |
| 165 PrintF(trace_scope.file(), "\n"); |
| 165 } | 166 } |
| 166 #endif | 167 #endif |
| 167 | 168 |
| 168 if (UseSpecialCache()) { | 169 if (UseSpecialCache()) { |
| 169 AddToSpecialCache(new_object); | 170 AddToSpecialCache(new_object); |
| 170 } else { | 171 } else { |
| 171 // Update the dictionary and the root in Heap. | 172 // Update the dictionary and the root in Heap. |
| 172 Handle<UnseededNumberDictionary> dict = | 173 Handle<UnseededNumberDictionary> dict = |
| 173 factory->DictionaryAtNumberPut( | 174 factory->DictionaryAtNumberPut( |
| 174 Handle<UnseededNumberDictionary>(heap->code_stubs()), | 175 Handle<UnseededNumberDictionary>(heap->code_stubs()), |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 handle(Type::String(), isolate)), isolate); | 675 handle(Type::String(), isolate)), isolate); |
| 675 } | 676 } |
| 676 ASSERT(result_state_ != GENERIC); | 677 ASSERT(result_state_ != GENERIC); |
| 677 if (result_state_ == NUMBER && op_ == Token::SHR) { | 678 if (result_state_ == NUMBER && op_ == Token::SHR) { |
| 678 return handle(Type::Unsigned32(), isolate); | 679 return handle(Type::Unsigned32(), isolate); |
| 679 } | 680 } |
| 680 return StateToType(result_state_, isolate); | 681 return StateToType(result_state_, isolate); |
| 681 } | 682 } |
| 682 | 683 |
| 683 | 684 |
| 685 void NewStringAddStub::PrintBaseName(StringStream* stream) { |
| 686 stream->Add("NewStringAddStub"); |
| 687 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) { |
| 688 stream->Add("_CheckBoth"); |
| 689 } else if ((flags() & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) { |
| 690 stream->Add("_CheckLeft"); |
| 691 } else if ((flags() & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) { |
| 692 stream->Add("_CheckRight"); |
| 693 } |
| 694 if (pretenure_flag() == TENURED) { |
| 695 stream->Add("_Tenured"); |
| 696 } |
| 697 } |
| 698 |
| 699 |
| 684 InlineCacheState ICCompareStub::GetICState() { | 700 InlineCacheState ICCompareStub::GetICState() { |
| 685 CompareIC::State state = Max(left_, right_); | 701 CompareIC::State state = Max(left_, right_); |
| 686 switch (state) { | 702 switch (state) { |
| 687 case CompareIC::UNINITIALIZED: | 703 case CompareIC::UNINITIALIZED: |
| 688 return ::v8::internal::UNINITIALIZED; | 704 return ::v8::internal::UNINITIALIZED; |
| 689 case CompareIC::SMI: | 705 case CompareIC::SMI: |
| 690 case CompareIC::NUMBER: | 706 case CompareIC::NUMBER: |
| 691 case CompareIC::INTERNALIZED_STRING: | 707 case CompareIC::INTERNALIZED_STRING: |
| 692 case CompareIC::STRING: | 708 case CompareIC::STRING: |
| 693 case CompareIC::UNIQUE_NAME: | 709 case CompareIC::UNIQUE_NAME: |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 InstallDescriptor(isolate, &stub); | 1142 InstallDescriptor(isolate, &stub); |
| 1127 } | 1143 } |
| 1128 | 1144 |
| 1129 | 1145 |
| 1130 void FastNewClosureStub::InstallDescriptors(Isolate* isolate) { | 1146 void FastNewClosureStub::InstallDescriptors(Isolate* isolate) { |
| 1131 FastNewClosureStub stub(STRICT_MODE, false); | 1147 FastNewClosureStub stub(STRICT_MODE, false); |
| 1132 InstallDescriptor(isolate, &stub); | 1148 InstallDescriptor(isolate, &stub); |
| 1133 } | 1149 } |
| 1134 | 1150 |
| 1135 | 1151 |
| 1152 // static |
| 1153 void NewStringAddStub::InstallDescriptors(Isolate* isolate) { |
| 1154 NewStringAddStub stub(STRING_ADD_CHECK_NONE, NOT_TENURED); |
| 1155 InstallDescriptor(isolate, &stub); |
| 1156 } |
| 1157 |
| 1158 |
| 1136 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 1159 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
| 1137 : argument_count_(ANY) { | 1160 : argument_count_(ANY) { |
| 1138 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 1161 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 1139 } | 1162 } |
| 1140 | 1163 |
| 1141 | 1164 |
| 1142 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, | 1165 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, |
| 1143 int argument_count) { | 1166 int argument_count) { |
| 1144 if (argument_count == 0) { | 1167 if (argument_count == 0) { |
| 1145 argument_count_ = NONE; | 1168 argument_count_ = NONE; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1163 InstallDescriptor(isolate, &stub3); | 1186 InstallDescriptor(isolate, &stub3); |
| 1164 } | 1187 } |
| 1165 | 1188 |
| 1166 InternalArrayConstructorStub::InternalArrayConstructorStub( | 1189 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 1167 Isolate* isolate) { | 1190 Isolate* isolate) { |
| 1168 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 1191 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 1169 } | 1192 } |
| 1170 | 1193 |
| 1171 | 1194 |
| 1172 } } // namespace v8::internal | 1195 } } // namespace v8::internal |
| OLD | NEW |