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

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

Issue 12559003: MIPS: Make IC patching resilient to flushing of the original target() ic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months 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/mips/ic-mips.cc ('k') | 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 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2867 Label success; 2867 Label success;
2868 2868
2869 NonexistentHandlerFrontend(object, last, name, &success, global); 2869 NonexistentHandlerFrontend(object, last, name, &success, global);
2870 2870
2871 __ bind(&success); 2871 __ bind(&success);
2872 // Return undefined if maps of the full prototype chain is still the same. 2872 // Return undefined if maps of the full prototype chain is still the same.
2873 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); 2873 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
2874 __ Ret(); 2874 __ Ret();
2875 2875
2876 // Return the generated code. 2876 // Return the generated code.
2877 return GetCode(Code::HANDLER_FRAGMENT, Code::NONEXISTENT, name); 2877 return GetCode(kind(), Code::NONEXISTENT, name);
2878 } 2878 }
2879 2879
2880 2880
2881 Register* LoadStubCompiler::registers() { 2881 Register* LoadStubCompiler::registers() {
2882 // receiver, name, scratch1, scratch2, scratch3, scratch4. 2882 // receiver, name, scratch1, scratch2, scratch3, scratch4.
2883 static Register registers[] = { a0, a2, a3, a1, t0, t1 }; 2883 static Register registers[] = { a0, a2, a3, a1, t0, t1 };
2884 return registers; 2884 return registers;
2885 } 2885 }
2886 2886
2887 2887
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2961 2961
2962 HandlerFrontendFooter(&success, &miss); 2962 HandlerFrontendFooter(&success, &miss);
2963 __ bind(&success); 2963 __ bind(&success);
2964 2964
2965 Counters* counters = masm()->isolate()->counters(); 2965 Counters* counters = masm()->isolate()->counters();
2966 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); 2966 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3);
2967 __ mov(v0, t0); 2967 __ mov(v0, t0);
2968 __ Ret(); 2968 __ Ret();
2969 2969
2970 // Return the generated code. 2970 // Return the generated code.
2971 return GetCode(Code::IC_FRAGMENT, Code::NORMAL, name); 2971 return GetICCode(kind(), Code::NORMAL, name);
2972 } 2972 }
2973 2973
2974 2974
2975 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( 2975 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
2976 Handle<Map> receiver_map) { 2976 Handle<Map> receiver_map) {
2977 // ----------- S t a t e ------------- 2977 // ----------- S t a t e -------------
2978 // -- ra : return address 2978 // -- ra : return address
2979 // -- a0 : key 2979 // -- a0 : key
2980 // -- a1 : receiver 2980 // -- a1 : receiver
2981 // ----------------------------------- 2981 // -----------------------------------
2982 ElementsKind elements_kind = receiver_map->elements_kind(); 2982 ElementsKind elements_kind = receiver_map->elements_kind();
2983 if (receiver_map->has_fast_elements() || 2983 if (receiver_map->has_fast_elements() ||
2984 receiver_map->has_external_array_elements()) { 2984 receiver_map->has_external_array_elements()) {
2985 Handle<Code> stub = KeyedLoadFastElementStub( 2985 Handle<Code> stub = KeyedLoadFastElementStub(
2986 receiver_map->instance_type() == JS_ARRAY_TYPE, 2986 receiver_map->instance_type() == JS_ARRAY_TYPE,
2987 elements_kind).GetCode(isolate()); 2987 elements_kind).GetCode(isolate());
2988 __ DispatchMap(a1, a2, receiver_map, stub, DO_SMI_CHECK); 2988 __ DispatchMap(a1, a2, receiver_map, stub, DO_SMI_CHECK);
2989 } else { 2989 } else {
2990 Handle<Code> stub = 2990 Handle<Code> stub =
2991 KeyedLoadDictionaryElementStub().GetCode(isolate()); 2991 KeyedLoadDictionaryElementStub().GetCode(isolate());
2992 __ DispatchMap(a1, a2, receiver_map, stub, DO_SMI_CHECK); 2992 __ DispatchMap(a1, a2, receiver_map, stub, DO_SMI_CHECK);
2993 } 2993 }
2994 2994
2995 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 2995 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
2996 __ Jump(ic, RelocInfo::CODE_TARGET); 2996 __ Jump(ic, RelocInfo::CODE_TARGET);
2997 2997
2998 // Return the generated code. 2998 // Return the generated code.
2999 return GetCode(Code::IC_FRAGMENT, Code::NORMAL, factory()->empty_string()); 2999 return GetICCode(kind(), Code::NORMAL, factory()->empty_string());
3000 } 3000 }
3001 3001
3002 3002
3003 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC( 3003 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC(
3004 MapHandleList* receiver_maps, 3004 MapHandleList* receiver_maps,
3005 CodeHandleList* handlers, 3005 CodeHandleList* handlers,
3006 Handle<Name> name, 3006 Handle<Name> name,
3007 Code::StubType type, 3007 Code::StubType type,
3008 IcCheckType check) { 3008 IcCheckType check) {
3009 Label miss; 3009 Label miss;
(...skipping 11 matching lines...) Expand all
3021 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, 3021 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET,
3022 eq, map_reg, Operand(receiver_maps->at(current))); 3022 eq, map_reg, Operand(receiver_maps->at(current)));
3023 } 3023 }
3024 3024
3025 __ bind(&miss); 3025 __ bind(&miss);
3026 GenerateLoadMiss(masm(), kind()); 3026 GenerateLoadMiss(masm(), kind());
3027 3027
3028 // Return the generated code. 3028 // Return the generated code.
3029 InlineCacheState state = 3029 InlineCacheState state =
3030 receiver_maps->length() > 1 ? POLYMORPHIC : MONOMORPHIC; 3030 receiver_maps->length() > 1 ? POLYMORPHIC : MONOMORPHIC;
3031 return GetCode(Code::IC_FRAGMENT, type, name, state); 3031 return GetICCode(kind(), type, name, state);
3032 } 3032 }
3033 3033
3034 3034
3035 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, 3035 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
3036 int index, 3036 int index,
3037 Handle<Map> transition, 3037 Handle<Map> transition,
3038 Handle<Name> name) { 3038 Handle<Name> name) {
3039 // ----------- S t a t e ------------- 3039 // ----------- S t a t e -------------
3040 // -- a0 : value 3040 // -- a0 : value
3041 // -- a1 : key 3041 // -- a1 : key
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4136 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4137 } 4137 }
4138 } 4138 }
4139 4139
4140 4140
4141 #undef __ 4141 #undef __
4142 4142
4143 } } // namespace v8::internal 4143 } } // namespace v8::internal
4144 4144
4145 #endif // V8_TARGET_ARCH_MIPS 4145 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/ic-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698