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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 75953002: MIPS: Convert PatchCache (and related methods) to use types rather than objects/maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « no previous file | no next file » | 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 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after
3055 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); 3055 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3);
3056 __ Ret(USE_DELAY_SLOT); 3056 __ Ret(USE_DELAY_SLOT);
3057 __ mov(v0, t0); 3057 __ mov(v0, t0);
3058 3058
3059 // Return the generated code. 3059 // Return the generated code.
3060 return GetCode(kind(), Code::NORMAL, name); 3060 return GetCode(kind(), Code::NORMAL, name);
3061 } 3061 }
3062 3062
3063 3063
3064 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( 3064 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
3065 MapHandleList* receiver_maps, 3065 TypeHandleList* types,
3066 CodeHandleList* handlers, 3066 CodeHandleList* handlers,
3067 Handle<Name> name, 3067 Handle<Name> name,
3068 Code::StubType type, 3068 Code::StubType type,
3069 IcCheckType check) { 3069 IcCheckType check) {
3070 Label miss; 3070 Label miss;
3071 3071
3072 if (check == PROPERTY) { 3072 if (check == PROPERTY) {
3073 GenerateNameCheck(name, this->name(), &miss); 3073 GenerateNameCheck(name, this->name(), &miss);
3074 } 3074 }
3075 3075
3076 Label number_case; 3076 Label number_case;
3077 Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss; 3077 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
3078 __ JumpIfSmi(receiver(), smi_target); 3078 __ JumpIfSmi(receiver(), smi_target);
3079 3079
3080 Register map_reg = scratch1(); 3080 Register map_reg = scratch1();
3081 3081
3082 int receiver_count = receiver_maps->length(); 3082 int receiver_count = types->length();
3083 int number_of_handled_maps = 0; 3083 int number_of_handled_maps = 0;
3084 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 3084 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
3085 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map();
3086 for (int current = 0; current < receiver_count; ++current) { 3085 for (int current = 0; current < receiver_count; ++current) {
3087 Handle<Map> map = receiver_maps->at(current); 3086 Handle<Type> type = types->at(current);
3087 Handle<Map> map = IC::TypeToMap(*type, isolate());
3088 if (!map->is_deprecated()) { 3088 if (!map->is_deprecated()) {
3089 number_of_handled_maps++; 3089 number_of_handled_maps++;
3090 if (map.is_identical_to(heap_number_map)) { 3090 if (type->Is(Type::Number())) {
3091 ASSERT(!number_case.is_unused()); 3091 ASSERT(!number_case.is_unused());
3092 __ bind(&number_case); 3092 __ bind(&number_case);
3093 } 3093 }
3094 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, 3094 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET,
3095 eq, map_reg, Operand(receiver_maps->at(current))); 3095 eq, map_reg, Operand(map));
3096 } 3096 }
3097 } 3097 }
3098 ASSERT(number_of_handled_maps != 0); 3098 ASSERT(number_of_handled_maps != 0);
3099 3099
3100 __ bind(&miss); 3100 __ bind(&miss);
3101 TailCallBuiltin(masm(), MissBuiltin(kind())); 3101 TailCallBuiltin(masm(), MissBuiltin(kind()));
3102 3102
3103 // Return the generated code. 3103 // Return the generated code.
3104 InlineCacheState state = 3104 InlineCacheState state =
3105 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; 3105 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 // ----------------------------------- 3183 // -----------------------------------
3184 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 3184 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
3185 } 3185 }
3186 3186
3187 3187
3188 #undef __ 3188 #undef __
3189 3189
3190 } } // namespace v8::internal 3190 } } // namespace v8::internal
3191 3191
3192 #endif // V8_TARGET_ARCH_MIPS 3192 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698