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

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

Issue 12451003: Make IC patching resilient to flushing of the original target() ic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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/arm/ic-arm.cc ('k') | src/builtins.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 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 2871
2872 NonexistentHandlerFrontend(object, last, name, &success, global); 2872 NonexistentHandlerFrontend(object, last, name, &success, global);
2873 2873
2874 __ bind(&success); 2874 __ bind(&success);
2875 // Return undefined if maps of the full prototype chain are still the 2875 // Return undefined if maps of the full prototype chain are still the
2876 // same and no global property with this name contains a value. 2876 // same and no global property with this name contains a value.
2877 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 2877 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
2878 __ Ret(); 2878 __ Ret();
2879 2879
2880 // Return the generated code. 2880 // Return the generated code.
2881 return GetCode(Code::HANDLER_FRAGMENT, Code::NONEXISTENT, name); 2881 return GetCode(kind(), Code::NONEXISTENT, name);
2882 } 2882 }
2883 2883
2884 2884
2885 Register* LoadStubCompiler::registers() { 2885 Register* LoadStubCompiler::registers() {
2886 // receiver, name, scratch1, scratch2, scratch3, scratch4. 2886 // receiver, name, scratch1, scratch2, scratch3, scratch4.
2887 static Register registers[] = { r0, r2, r3, r1, r4, r5 }; 2887 static Register registers[] = { r0, r2, r3, r1, r4, r5 };
2888 return registers; 2888 return registers;
2889 } 2889 }
2890 2890
2891 2891
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 2967
2968 HandlerFrontendFooter(&success, &miss); 2968 HandlerFrontendFooter(&success, &miss);
2969 __ bind(&success); 2969 __ bind(&success);
2970 2970
2971 Counters* counters = masm()->isolate()->counters(); 2971 Counters* counters = masm()->isolate()->counters();
2972 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); 2972 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3);
2973 __ mov(r0, r4); 2973 __ mov(r0, r4);
2974 __ Ret(); 2974 __ Ret();
2975 2975
2976 // Return the generated code. 2976 // Return the generated code.
2977 return GetCode(Code::IC_FRAGMENT, Code::NORMAL, name); 2977 return GetICCode(kind(), Code::NORMAL, name);
2978 } 2978 }
2979 2979
2980 2980
2981 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( 2981 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
2982 Handle<Map> receiver_map) { 2982 Handle<Map> receiver_map) {
2983 // ----------- S t a t e ------------- 2983 // ----------- S t a t e -------------
2984 // -- lr : return address 2984 // -- lr : return address
2985 // -- r0 : key 2985 // -- r0 : key
2986 // -- r1 : receiver 2986 // -- r1 : receiver
2987 // ----------------------------------- 2987 // -----------------------------------
2988 ElementsKind elements_kind = receiver_map->elements_kind(); 2988 ElementsKind elements_kind = receiver_map->elements_kind();
2989 if (receiver_map->has_fast_elements() || 2989 if (receiver_map->has_fast_elements() ||
2990 receiver_map->has_external_array_elements()) { 2990 receiver_map->has_external_array_elements()) {
2991 Handle<Code> stub = KeyedLoadFastElementStub( 2991 Handle<Code> stub = KeyedLoadFastElementStub(
2992 receiver_map->instance_type() == JS_ARRAY_TYPE, 2992 receiver_map->instance_type() == JS_ARRAY_TYPE,
2993 elements_kind).GetCode(isolate()); 2993 elements_kind).GetCode(isolate());
2994 __ DispatchMap(r1, r2, receiver_map, stub, DO_SMI_CHECK); 2994 __ DispatchMap(r1, r2, receiver_map, stub, DO_SMI_CHECK);
2995 } else { 2995 } else {
2996 Handle<Code> stub = 2996 Handle<Code> stub =
2997 KeyedLoadDictionaryElementStub().GetCode(isolate()); 2997 KeyedLoadDictionaryElementStub().GetCode(isolate());
2998 __ DispatchMap(r1, r2, receiver_map, stub, DO_SMI_CHECK); 2998 __ DispatchMap(r1, r2, receiver_map, stub, DO_SMI_CHECK);
2999 } 2999 }
3000 3000
3001 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3001 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3002 __ Jump(ic, RelocInfo::CODE_TARGET); 3002 __ Jump(ic, RelocInfo::CODE_TARGET);
3003 3003
3004 // Return the generated code. 3004 // Return the generated code.
3005 return GetCode(Code::IC_FRAGMENT, Code::NORMAL, factory()->empty_string()); 3005 return GetICCode(kind(), Code::NORMAL, factory()->empty_string());
3006 } 3006 }
3007 3007
3008 3008
3009 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC( 3009 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC(
3010 MapHandleList* receiver_maps, 3010 MapHandleList* receiver_maps,
3011 CodeHandleList* handlers, 3011 CodeHandleList* handlers,
3012 Handle<Name> name, 3012 Handle<Name> name,
3013 Code::StubType type, 3013 Code::StubType type,
3014 IcCheckType check) { 3014 IcCheckType check) {
3015 Label miss; 3015 Label miss;
(...skipping 12 matching lines...) Expand all
3028 __ cmp(map_reg, ip); 3028 __ cmp(map_reg, ip);
3029 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq); 3029 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq);
3030 } 3030 }
3031 3031
3032 __ bind(&miss); 3032 __ bind(&miss);
3033 GenerateLoadMiss(masm(), kind()); 3033 GenerateLoadMiss(masm(), kind());
3034 3034
3035 // Return the generated code. 3035 // Return the generated code.
3036 InlineCacheState state = 3036 InlineCacheState state =
3037 receiver_maps->length() > 1 ? POLYMORPHIC : MONOMORPHIC; 3037 receiver_maps->length() > 1 ? POLYMORPHIC : MONOMORPHIC;
3038 return GetCode(Code::IC_FRAGMENT, type, name, state); 3038 return GetICCode(kind(), type, name, state);
3039 } 3039 }
3040 3040
3041 3041
3042 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, 3042 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
3043 int index, 3043 int index,
3044 Handle<Map> transition, 3044 Handle<Map> transition,
3045 Handle<Name> name) { 3045 Handle<Name> name) {
3046 // ----------- S t a t e ------------- 3046 // ----------- S t a t e -------------
3047 // -- r0 : value 3047 // -- r0 : value
3048 // -- r1 : name 3048 // -- r1 : name
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4083 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4084 } 4084 }
4085 } 4085 }
4086 4086
4087 4087
4088 #undef __ 4088 #undef __
4089 4089
4090 } } // namespace v8::internal 4090 } } // namespace v8::internal
4091 4091
4092 #endif // V8_TARGET_ARCH_ARM 4092 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698