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

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

Issue 12092043: Support slow-mode prototypes for load and call ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/stub-cache-arm.cc ('k') | src/ic.cc » ('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 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 } 2957 }
2958 __ bind(&miss); 2958 __ bind(&miss);
2959 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); 2959 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss();
2960 __ jmp(miss_ic, RelocInfo::CODE_TARGET); 2960 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
2961 2961
2962 // Return the generated code. 2962 // Return the generated code.
2963 return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 2963 return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
2964 } 2964 }
2965 2965
2966 2966
2967 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, 2967 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
2968 Handle<JSObject> object, 2968 Handle<String> name,
2969 Handle<JSObject> last) { 2969 Handle<JSObject> object,
2970 Handle<JSObject> last,
2971 Handle<GlobalObject> global) {
2970 // ----------- S t a t e ------------- 2972 // ----------- S t a t e -------------
2971 // -- ecx : name 2973 // -- ecx : name
2972 // -- edx : receiver 2974 // -- edx : receiver
2973 // -- esp[0] : return address 2975 // -- esp[0] : return address
2974 // ----------------------------------- 2976 // -----------------------------------
2975 Label miss; 2977 Label miss;
2976 2978
2977 // Check that the receiver isn't a smi. 2979 // Check that the receiver isn't a smi.
2978 __ JumpIfSmi(edx, &miss); 2980 __ JumpIfSmi(edx, &miss);
2979 2981
2980 ASSERT(last->IsGlobalObject() || last->HasFastProperties()); 2982 Register scratch = eax;
2981 2983
2982 // Check the maps of the full prototype chain. Also check that 2984 // Check the maps of the full prototype chain. Also check that
2983 // global property cells up to (but not including) the last object 2985 // global property cells up to (but not including) the last object
2984 // in the prototype chain are empty. 2986 // in the prototype chain are empty.
2985 CheckPrototypes(object, edx, last, ebx, eax, edi, name, &miss); 2987 Register result =
2988 CheckPrototypes(object, edx, last, ebx, scratch, edi, name, &miss);
2986 2989
2987 // If the last object in the prototype chain is a global object, 2990 // If the last object in the prototype chain is a global object,
2988 // check that the global property cell is empty. 2991 // check that the global property cell is empty.
2989 if (last->IsGlobalObject()) { 2992 if (!global.is_null()) {
2990 GenerateCheckPropertyCell( 2993 GenerateCheckPropertyCell(masm(), global, name, scratch, &miss);
2991 masm(), Handle<GlobalObject>::cast(last), name, eax, &miss); 2994 }
2995
2996 if (!last->HasFastProperties()) {
2997 __ mov(scratch, FieldOperand(result, HeapObject::kMapOffset));
2998 __ mov(scratch, FieldOperand(scratch, Map::kPrototypeOffset));
2999 __ cmp(scratch, isolate()->factory()->null_value());
3000 __ j(not_equal, &miss);
2992 } 3001 }
2993 3002
2994 // Return undefined if maps of the full prototype chain are still the 3003 // Return undefined if maps of the full prototype chain are still the
2995 // same and no global property with this name contains a value. 3004 // same and no global property with this name contains a value.
2996 __ mov(eax, isolate()->factory()->undefined_value()); 3005 __ mov(eax, isolate()->factory()->undefined_value());
2997 __ ret(0); 3006 __ ret(0);
2998 3007
2999 __ bind(&miss); 3008 __ bind(&miss);
3000 GenerateLoadMiss(masm(), Code::LOAD_IC); 3009 GenerateLoadMiss(masm(), Code::LOAD_IC);
3001 3010
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
4095 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4104 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4096 } 4105 }
4097 } 4106 }
4098 4107
4099 4108
4100 #undef __ 4109 #undef __
4101 4110
4102 } } // namespace v8::internal 4111 } } // namespace v8::internal
4103 4112
4104 #endif // V8_TARGET_ARCH_IA32 4113 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698