OLD | NEW |
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 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 __ bind(&miss); | 2887 __ bind(&miss); |
2888 __ IncrementCounter(counters->named_store_global_inline_miss(), 1, r4, r3); | 2888 __ IncrementCounter(counters->named_store_global_inline_miss(), 1, r4, r3); |
2889 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2889 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
2890 __ Jump(ic, RelocInfo::CODE_TARGET); | 2890 __ Jump(ic, RelocInfo::CODE_TARGET); |
2891 | 2891 |
2892 // Return the generated code. | 2892 // Return the generated code. |
2893 return GetCode(Code::NORMAL, name); | 2893 return GetCode(Code::NORMAL, name); |
2894 } | 2894 } |
2895 | 2895 |
2896 | 2896 |
2897 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, | 2897 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
2898 Handle<JSObject> object, | 2898 Handle<String> name, |
2899 Handle<JSObject> last) { | 2899 Handle<JSObject> object, |
| 2900 Handle<JSObject> last, |
| 2901 Handle<GlobalObject> global) { |
2900 // ----------- S t a t e ------------- | 2902 // ----------- S t a t e ------------- |
2901 // -- r0 : receiver | 2903 // -- r0 : receiver |
2902 // -- lr : return address | 2904 // -- lr : return address |
2903 // ----------------------------------- | 2905 // ----------------------------------- |
2904 Label miss; | 2906 Label miss; |
2905 | 2907 |
2906 // Check that receiver is not a smi. | 2908 // Check that receiver is not a smi. |
2907 __ JumpIfSmi(r0, &miss); | 2909 __ JumpIfSmi(r0, &miss); |
2908 | 2910 |
| 2911 |
| 2912 Register scratch = r1; |
| 2913 |
2909 // Check the maps of the full prototype chain. | 2914 // Check the maps of the full prototype chain. |
2910 CheckPrototypes(object, r0, last, r3, r1, r4, name, &miss); | 2915 Register result = |
| 2916 CheckPrototypes(object, r0, last, r3, scratch, r4, name, &miss); |
2911 | 2917 |
2912 // If the last object in the prototype chain is a global object, | 2918 // If the last object in the prototype chain is a global object, |
2913 // check that the global property cell is empty. | 2919 // check that the global property cell is empty. |
2914 if (last->IsGlobalObject()) { | 2920 if (!global.is_null()) { |
2915 GenerateCheckPropertyCell( | 2921 GenerateCheckPropertyCell(masm(), global, name, scratch, &miss); |
2916 masm(), Handle<GlobalObject>::cast(last), name, r1, &miss); | 2922 } |
| 2923 |
| 2924 if (!last->HasFastProperties()) { |
| 2925 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 2926 __ ldr(scratch, FieldMemOperand(scratch, Map::kPrototypeOffset)); |
| 2927 __ cmp(scratch, Operand(isolate()->factory()->null_value())); |
| 2928 __ b(ne, &miss); |
2917 } | 2929 } |
2918 | 2930 |
2919 // Return undefined if maps of the full prototype chain are still the | 2931 // Return undefined if maps of the full prototype chain are still the |
2920 // same and no global property with this name contains a value. | 2932 // same and no global property with this name contains a value. |
2921 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 2933 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
2922 __ Ret(); | 2934 __ Ret(); |
2923 | 2935 |
2924 __ bind(&miss); | 2936 __ bind(&miss); |
2925 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2937 GenerateLoadMiss(masm(), Code::LOAD_IC); |
2926 | 2938 |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4313 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4325 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4314 } | 4326 } |
4315 } | 4327 } |
4316 | 4328 |
4317 | 4329 |
4318 #undef __ | 4330 #undef __ |
4319 | 4331 |
4320 } } // namespace v8::internal | 4332 } } // namespace v8::internal |
4321 | 4333 |
4322 #endif // V8_TARGET_ARCH_ARM | 4334 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |