| OLD | NEW |
| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 PropertyDetails(NONE, NORMAL)); | 685 PropertyDetails(NONE, NORMAL)); |
| 686 isolate->heap()->public_set_non_monomorphic_cache(*dictionary); | 686 isolate->heap()->public_set_non_monomorphic_cache(*dictionary); |
| 687 } | 687 } |
| 688 | 688 |
| 689 | 689 |
| 690 Code* StubCache::FindCallInitialize(int argc, | 690 Code* StubCache::FindCallInitialize(int argc, |
| 691 RelocInfo::Mode mode, | 691 RelocInfo::Mode mode, |
| 692 Code::Kind kind) { | 692 Code::Kind kind) { |
| 693 Code::ExtraICState extra_state = | 693 Code::ExtraICState extra_state = |
| 694 CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | | 694 CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | |
| 695 CallICBase::ConstructCall::encode(mode == RelocInfo::CONSTRUCT_CALL) | |
| 695 CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); | 696 CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); |
| 696 Code::Flags flags = | 697 Code::Flags flags = |
| 697 Code::ComputeFlags(kind, UNINITIALIZED, extra_state, NORMAL, argc); | 698 Code::ComputeFlags(kind, UNINITIALIZED, extra_state, NORMAL, argc); |
| 698 | 699 |
| 699 // Use raw_unchecked... so we don't get assert failures during GC. | 700 // Use raw_unchecked... so we don't get assert failures during GC. |
| 700 NumberDictionary* dictionary = | 701 NumberDictionary* dictionary = |
| 701 isolate()->heap()->raw_unchecked_non_monomorphic_cache(); | 702 isolate()->heap()->raw_unchecked_non_monomorphic_cache(); |
| 702 int entry = dictionary->FindEntry(isolate(), flags); | 703 int entry = dictionary->FindEntry(isolate(), flags); |
| 703 ASSERT(entry != -1); | 704 ASSERT(entry != -1); |
| 704 Object* code = dictionary->ValueAt(entry); | 705 Object* code = dictionary->ValueAt(entry); |
| 705 // This might be called during the marking phase of the collector | 706 // This might be called during the marking phase of the collector |
| 706 // hence the unchecked cast. | 707 // hence the unchecked cast. |
| 707 return reinterpret_cast<Code*>(code); | 708 return reinterpret_cast<Code*>(code); |
| 708 } | 709 } |
| 709 | 710 |
| 710 | 711 |
| 711 Handle<Code> StubCache::ComputeCallInitialize(int argc, | 712 Handle<Code> StubCache::ComputeCallInitialize(int argc, |
| 712 RelocInfo::Mode mode, | 713 RelocInfo::Mode mode, |
| 713 Code::Kind kind) { | 714 Code::Kind kind) { |
| 714 Code::ExtraICState extra_state = | 715 Code::ExtraICState extra_state = |
| 715 CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | | 716 CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | |
| 717 CallICBase::ConstructCall::encode(mode == RelocInfo::CONSTRUCT_CALL) | |
| 716 CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); | 718 CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); |
| 717 Code::Flags flags = | 719 Code::Flags flags = |
| 718 Code::ComputeFlags(kind, UNINITIALIZED, extra_state, NORMAL, argc); | 720 Code::ComputeFlags(kind, UNINITIALIZED, extra_state, NORMAL, argc); |
| 719 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); | 721 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); |
| 720 int entry = cache->FindEntry(isolate_, flags); | 722 int entry = cache->FindEntry(isolate_, flags); |
| 721 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); | 723 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); |
| 722 | 724 |
| 723 StubCompiler compiler(isolate_); | 725 StubCompiler compiler(isolate_); |
| 724 Handle<Code> code = compiler.CompileCallInitialize(flags); | 726 Handle<Code> code = compiler.CompileCallInitialize(flags); |
| 725 FillCache(isolate_, code); | 727 FillCache(isolate_, code); |
| 726 return code; | 728 return code; |
| 727 } | 729 } |
| 728 | 730 |
| 729 | 731 |
| 730 Handle<Code> StubCache::ComputeCallInitialize(int argc, RelocInfo::Mode mode) { | 732 Handle<Code> StubCache::ComputeCallInitialize(int argc, RelocInfo::Mode mode) { |
| 731 return ComputeCallInitialize(argc, mode, Code::CALL_IC); | 733 return ComputeCallInitialize(argc, mode, Code::CALL_IC); |
| 732 } | 734 } |
| 733 | 735 |
| 734 | 736 |
| 735 Handle<Code> StubCache::ComputeKeyedCallInitialize(int argc) { | 737 Handle<Code> StubCache::ComputeKeyedCallInitialize(int argc, |
| 736 return ComputeCallInitialize(argc, RelocInfo::CODE_TARGET, | 738 RelocInfo::Mode mode) { |
| 737 Code::KEYED_CALL_IC); | 739 return ComputeCallInitialize(argc, mode, Code::KEYED_CALL_IC); |
| 738 } | 740 } |
| 739 | 741 |
| 740 | 742 |
| 741 Handle<Code> StubCache::ComputeCallPreMonomorphic( | 743 Handle<Code> StubCache::ComputeCallPreMonomorphic( |
| 742 int argc, | 744 int argc, |
| 743 Code::Kind kind, | 745 Code::Kind kind, |
| 744 Code::ExtraICState extra_state) { | 746 Code::ExtraICState extra_state) { |
| 745 Code::Flags flags = | 747 Code::Flags flags = |
| 746 Code::ComputeFlags(kind, PREMONOMORPHIC, extra_state, NORMAL, argc); | 748 Code::ComputeFlags(kind, PREMONOMORPHIC, extra_state, NORMAL, argc); |
| 747 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); | 749 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 764 int entry = cache->FindEntry(isolate_, flags); | 766 int entry = cache->FindEntry(isolate_, flags); |
| 765 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); | 767 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); |
| 766 | 768 |
| 767 StubCompiler compiler(isolate_); | 769 StubCompiler compiler(isolate_); |
| 768 Handle<Code> code = compiler.CompileCallNormal(flags); | 770 Handle<Code> code = compiler.CompileCallNormal(flags); |
| 769 FillCache(isolate_, code); | 771 FillCache(isolate_, code); |
| 770 return code; | 772 return code; |
| 771 } | 773 } |
| 772 | 774 |
| 773 | 775 |
| 774 Handle<Code> StubCache::ComputeCallArguments(int argc, Code::Kind kind) { | 776 Handle<Code> StubCache::ComputeCallArguments(int argc, |
| 777 Code::Kind kind, |
| 778 Code::ExtraICState extra_state) { |
| 775 ASSERT(kind == Code::KEYED_CALL_IC); | 779 ASSERT(kind == Code::KEYED_CALL_IC); |
| 776 Code::Flags flags = | 780 Code::Flags flags = |
| 777 Code::ComputeFlags(kind, MEGAMORPHIC, Code::kNoExtraICState, | 781 Code::ComputeFlags(kind, MEGAMORPHIC, extra_state, NORMAL, argc); |
| 778 NORMAL, argc); | |
| 779 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); | 782 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); |
| 780 int entry = cache->FindEntry(isolate_, flags); | 783 int entry = cache->FindEntry(isolate_, flags); |
| 781 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); | 784 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); |
| 782 | 785 |
| 783 StubCompiler compiler(isolate_); | 786 StubCompiler compiler(isolate_); |
| 784 Handle<Code> code = compiler.CompileCallArguments(flags); | 787 Handle<Code> code = compiler.CompileCallArguments(flags); |
| 785 FillCache(isolate_, code); | 788 FillCache(isolate_, code); |
| 786 return code; | 789 return code; |
| 787 } | 790 } |
| 788 | 791 |
| 789 | 792 |
| 790 Handle<Code> StubCache::ComputeCallMegamorphic( | 793 Handle<Code> StubCache::ComputeCallMegamorphic( |
| 791 int argc, | 794 int argc, |
| 792 Code::Kind kind, | 795 Code::Kind kind, |
| 793 Code::ExtraICState extra_state) { | 796 Code::ExtraICState extra_state) { |
| 794 Code::Flags flags = | 797 Code::Flags flags = |
| 795 Code::ComputeFlags(kind, MEGAMORPHIC, extra_state, | 798 Code::ComputeFlags(kind, MEGAMORPHIC, extra_state, NORMAL, argc); |
| 796 NORMAL, argc); | |
| 797 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); | 799 Handle<NumberDictionary> cache = isolate_->factory()->non_monomorphic_cache(); |
| 798 int entry = cache->FindEntry(isolate_, flags); | 800 int entry = cache->FindEntry(isolate_, flags); |
| 799 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); | 801 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); |
| 800 | 802 |
| 801 StubCompiler compiler(isolate_); | 803 StubCompiler compiler(isolate_); |
| 802 Handle<Code> code = compiler.CompileCallMegamorphic(flags); | 804 Handle<Code> code = compiler.CompileCallMegamorphic(flags); |
| 803 FillCache(isolate_, code); | 805 FillCache(isolate_, code); |
| 804 return code; | 806 return code; |
| 805 } | 807 } |
| 806 | 808 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 } | 1124 } |
| 1123 | 1125 |
| 1124 | 1126 |
| 1125 Handle<Code> StubCompiler::CompileCallInitialize(Code::Flags flags) { | 1127 Handle<Code> StubCompiler::CompileCallInitialize(Code::Flags flags) { |
| 1126 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1128 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1127 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1129 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1128 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); | 1130 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1129 if (kind == Code::CALL_IC) { | 1131 if (kind == Code::CALL_IC) { |
| 1130 CallIC::GenerateInitialize(masm(), argc, extra_state); | 1132 CallIC::GenerateInitialize(masm(), argc, extra_state); |
| 1131 } else { | 1133 } else { |
| 1132 KeyedCallIC::GenerateInitialize(masm(), argc); | 1134 KeyedCallIC::GenerateInitialize(masm(), argc, extra_state); |
| 1133 } | 1135 } |
| 1134 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallInitialize"); | 1136 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallInitialize"); |
| 1135 isolate()->counters()->call_initialize_stubs()->Increment(); | 1137 isolate()->counters()->call_initialize_stubs()->Increment(); |
| 1136 PROFILE(isolate(), | 1138 PROFILE(isolate(), |
| 1137 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG), | 1139 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG), |
| 1138 *code, code->arguments_count())); | 1140 *code, code->arguments_count())); |
| 1139 GDBJIT(AddCode(GDBJITInterface::CALL_INITIALIZE, *code)); | 1141 GDBJIT(AddCode(GDBJITInterface::CALL_INITIALIZE, *code)); |
| 1140 return code; | 1142 return code; |
| 1141 } | 1143 } |
| 1142 | 1144 |
| 1143 | 1145 |
| 1144 Handle<Code> StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) { | 1146 Handle<Code> StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) { |
| 1145 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1147 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1146 // The code of the PreMonomorphic stub is the same as the code | 1148 // The code of the PreMonomorphic stub is the same as the code |
| 1147 // of the Initialized stub. They just differ on the code object flags. | 1149 // of the Initialized stub. They just differ on the code object flags. |
| 1148 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1150 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1149 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); | 1151 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1150 if (kind == Code::CALL_IC) { | 1152 if (kind == Code::CALL_IC) { |
| 1151 CallIC::GenerateInitialize(masm(), argc, extra_state); | 1153 CallIC::GenerateInitialize(masm(), argc, extra_state); |
| 1152 } else { | 1154 } else { |
| 1153 KeyedCallIC::GenerateInitialize(masm(), argc); | 1155 KeyedCallIC::GenerateInitialize(masm(), argc, extra_state); |
| 1154 } | 1156 } |
| 1155 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallPreMonomorphic"); | 1157 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallPreMonomorphic"); |
| 1156 isolate()->counters()->call_premonomorphic_stubs()->Increment(); | 1158 isolate()->counters()->call_premonomorphic_stubs()->Increment(); |
| 1157 PROFILE(isolate(), | 1159 PROFILE(isolate(), |
| 1158 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG), | 1160 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG), |
| 1159 *code, code->arguments_count())); | 1161 *code, code->arguments_count())); |
| 1160 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code)); | 1162 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code)); |
| 1161 return code; | 1163 return code; |
| 1162 } | 1164 } |
| 1163 | 1165 |
| 1164 | 1166 |
| 1165 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) { | 1167 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) { |
| 1166 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1168 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1167 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1169 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1170 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1168 if (kind == Code::CALL_IC) { | 1171 if (kind == Code::CALL_IC) { |
| 1169 // Call normal is always with a explict receiver. | 1172 CallIC::GenerateNormal(masm(), argc, extra_state); |
| 1170 ASSERT(!CallIC::Contextual::decode( | |
| 1171 Code::ExtractExtraICStateFromFlags(flags))); | |
| 1172 CallIC::GenerateNormal(masm(), argc); | |
| 1173 } else { | 1173 } else { |
| 1174 KeyedCallIC::GenerateNormal(masm(), argc); | 1174 KeyedCallIC::GenerateNormal(masm(), argc, extra_state); |
| 1175 } | 1175 } |
| 1176 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal"); | 1176 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal"); |
| 1177 isolate()->counters()->call_normal_stubs()->Increment(); | 1177 isolate()->counters()->call_normal_stubs()->Increment(); |
| 1178 PROFILE(isolate(), | 1178 PROFILE(isolate(), |
| 1179 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), | 1179 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), |
| 1180 *code, code->arguments_count())); | 1180 *code, code->arguments_count())); |
| 1181 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code)); | 1181 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code)); |
| 1182 return code; | 1182 return code; |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 | 1185 |
| 1186 Handle<Code> StubCompiler::CompileCallMegamorphic(Code::Flags flags) { | 1186 Handle<Code> StubCompiler::CompileCallMegamorphic(Code::Flags flags) { |
| 1187 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1187 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1188 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1188 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1189 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); | 1189 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1190 if (kind == Code::CALL_IC) { | 1190 if (kind == Code::CALL_IC) { |
| 1191 CallIC::GenerateMegamorphic(masm(), argc, extra_state); | 1191 CallIC::GenerateMegamorphic(masm(), argc, extra_state); |
| 1192 } else { | 1192 } else { |
| 1193 KeyedCallIC::GenerateMegamorphic(masm(), argc); | 1193 KeyedCallIC::GenerateMegamorphic(masm(), argc, extra_state); |
| 1194 } | 1194 } |
| 1195 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallMegamorphic"); | 1195 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallMegamorphic"); |
| 1196 isolate()->counters()->call_megamorphic_stubs()->Increment(); | 1196 isolate()->counters()->call_megamorphic_stubs()->Increment(); |
| 1197 PROFILE(isolate(), | 1197 PROFILE(isolate(), |
| 1198 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG), | 1198 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG), |
| 1199 *code, code->arguments_count())); | 1199 *code, code->arguments_count())); |
| 1200 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code)); | 1200 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code)); |
| 1201 return code; | 1201 return code; |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 | 1204 |
| 1205 Handle<Code> StubCompiler::CompileCallArguments(Code::Flags flags) { | 1205 Handle<Code> StubCompiler::CompileCallArguments(Code::Flags flags) { |
| 1206 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1206 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1207 KeyedCallIC::GenerateNonStrictArguments(masm(), argc); | 1207 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1208 KeyedCallIC::GenerateNonStrictArguments(masm(), argc, extra_state); |
| 1208 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallArguments"); | 1209 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallArguments"); |
| 1209 PROFILE(isolate(), | 1210 PROFILE(isolate(), |
| 1210 CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags), | 1211 CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags), |
| 1211 CALL_MEGAMORPHIC_TAG), | 1212 CALL_MEGAMORPHIC_TAG), |
| 1212 *code, code->arguments_count())); | 1213 *code, code->arguments_count())); |
| 1213 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code)); | 1214 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code)); |
| 1214 return code; | 1215 return code; |
| 1215 } | 1216 } |
| 1216 | 1217 |
| 1217 | 1218 |
| 1218 Handle<Code> StubCompiler::CompileCallMiss(Code::Flags flags) { | 1219 Handle<Code> StubCompiler::CompileCallMiss(Code::Flags flags) { |
| 1219 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1220 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1220 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1221 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1221 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); | 1222 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1222 if (kind == Code::CALL_IC) { | 1223 if (kind == Code::CALL_IC) { |
| 1223 CallIC::GenerateMiss(masm(), argc, extra_state); | 1224 CallIC::GenerateMiss(masm(), argc, extra_state); |
| 1224 } else { | 1225 } else { |
| 1225 KeyedCallIC::GenerateMiss(masm(), argc); | 1226 KeyedCallIC::GenerateMiss(masm(), argc, extra_state); |
| 1226 } | 1227 } |
| 1227 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallMiss"); | 1228 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallMiss"); |
| 1228 isolate()->counters()->call_megamorphic_stubs()->Increment(); | 1229 isolate()->counters()->call_megamorphic_stubs()->Increment(); |
| 1229 PROFILE(isolate(), | 1230 PROFILE(isolate(), |
| 1230 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG), | 1231 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG), |
| 1231 *code, code->arguments_count())); | 1232 *code, code->arguments_count())); |
| 1232 GDBJIT(AddCode(GDBJITInterface::CALL_MISS, *code)); | 1233 GDBJIT(AddCode(GDBJITInterface::CALL_MISS, *code)); |
| 1233 return code; | 1234 return code; |
| 1234 } | 1235 } |
| 1235 | 1236 |
| 1236 | 1237 |
| 1237 #ifdef ENABLE_DEBUGGER_SUPPORT | 1238 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 1238 Handle<Code> StubCompiler::CompileCallDebugBreak(Code::Flags flags) { | 1239 Handle<Code> StubCompiler::CompileCallDebugBreak(Code::Flags flags) { |
| 1239 Debug::GenerateCallICDebugBreak(masm()); | 1240 Debug::GenerateCallICDebugBreak(masm()); |
| 1240 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugBreak"); | 1241 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugBreak"); |
| 1241 PROFILE(isolate(), | 1242 PROFILE(isolate(), |
| 1242 CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags), | 1243 CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags), |
| 1243 CALL_DEBUG_BREAK_TAG), | 1244 CALL_DEBUG_BREAK_TAG), |
| 1244 *code, code->arguments_count())); | 1245 *code, code->arguments_count())); |
| 1245 return code; | 1246 return code; |
| 1246 } | 1247 } |
| 1247 | 1248 |
| 1248 | 1249 |
| 1249 Handle<Code> StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) { | 1250 Handle<Code> StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) { |
| 1250 // Use the same code for the the step in preparations as we do for the | 1251 // Use the same code for the the step in preparations as we do for the |
| 1251 // miss case. | 1252 // miss case. |
| 1252 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1253 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
| 1253 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1254 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
| 1255 Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
| 1254 if (kind == Code::CALL_IC) { | 1256 if (kind == Code::CALL_IC) { |
| 1255 // For the debugger extra ic state is irrelevant. | 1257 // For the debugger extra ic state is irrelevant. |
| 1256 CallIC::GenerateMiss(masm(), argc, Code::kNoExtraICState); | 1258 CallIC::GenerateMiss(masm(), argc, extra_state); |
| 1257 } else { | 1259 } else { |
| 1258 KeyedCallIC::GenerateMiss(masm(), argc); | 1260 KeyedCallIC::GenerateMiss(masm(), argc, extra_state); |
| 1259 } | 1261 } |
| 1260 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn"); | 1262 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn"); |
| 1261 PROFILE(isolate(), | 1263 PROFILE(isolate(), |
| 1262 CodeCreateEvent( | 1264 CodeCreateEvent( |
| 1263 CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG), | 1265 CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG), |
| 1264 *code, | 1266 *code, |
| 1265 code->arguments_count())); | 1267 code->arguments_count())); |
| 1266 return code; | 1268 return code; |
| 1267 } | 1269 } |
| 1268 #endif // ENABLE_DEBUGGER_SUPPORT | 1270 #endif // ENABLE_DEBUGGER_SUPPORT |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 Handle<FunctionTemplateInfo>( | 1508 Handle<FunctionTemplateInfo>( |
| 1507 FunctionTemplateInfo::cast(signature->receiver())); | 1509 FunctionTemplateInfo::cast(signature->receiver())); |
| 1508 } | 1510 } |
| 1509 } | 1511 } |
| 1510 | 1512 |
| 1511 is_simple_api_call_ = true; | 1513 is_simple_api_call_ = true; |
| 1512 } | 1514 } |
| 1513 | 1515 |
| 1514 | 1516 |
| 1515 } } // namespace v8::internal | 1517 } } // namespace v8::internal |
| OLD | NEW |