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 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 __ bind(&miss); | 2886 __ bind(&miss); |
2887 __ IncrementCounter(counters->named_store_global_inline_miss(), 1, a1, a3); | 2887 __ IncrementCounter(counters->named_store_global_inline_miss(), 1, a1, a3); |
2888 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2888 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
2889 __ Jump(ic, RelocInfo::CODE_TARGET); | 2889 __ Jump(ic, RelocInfo::CODE_TARGET); |
2890 | 2890 |
2891 // Return the generated code. | 2891 // Return the generated code. |
2892 return GetCode(Code::NORMAL, name); | 2892 return GetCode(Code::NORMAL, name); |
2893 } | 2893 } |
2894 | 2894 |
2895 | 2895 |
2896 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, | 2896 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
2897 Handle<JSObject> object, | 2897 Handle<String> name, |
2898 Handle<JSObject> last) { | 2898 Handle<JSObject> object, |
| 2899 Handle<JSObject> last, |
| 2900 Handle<GlobalObject> global) { |
2899 // ----------- S t a t e ------------- | 2901 // ----------- S t a t e ------------- |
2900 // -- a0 : receiver | 2902 // -- a0 : receiver |
2901 // -- ra : return address | 2903 // -- ra : return address |
2902 // ----------------------------------- | 2904 // ----------------------------------- |
2903 Label miss; | 2905 Label miss; |
2904 | 2906 |
2905 // Check that the receiver is not a smi. | 2907 // Check that the receiver is not a smi. |
2906 __ JumpIfSmi(a0, &miss); | 2908 __ JumpIfSmi(a0, &miss); |
2907 | 2909 |
| 2910 Register scratch = a1; |
| 2911 |
2908 // Check the maps of the full prototype chain. | 2912 // Check the maps of the full prototype chain. |
2909 CheckPrototypes(object, a0, last, a3, a1, t0, name, &miss); | 2913 Register result = |
| 2914 CheckPrototypes(object, a0, last, a3, scratch, t0, name, &miss); |
2910 | 2915 |
2911 // If the last object in the prototype chain is a global object, | 2916 // If the last object in the prototype chain is a global object, |
2912 // check that the global property cell is empty. | 2917 // check that the global property cell is empty. |
2913 if (last->IsGlobalObject()) { | 2918 if (!global.is_null()) { |
2914 GenerateCheckPropertyCell( | 2919 GenerateCheckPropertyCell(masm(), global, name, scratch, &miss); |
2915 masm(), Handle<GlobalObject>::cast(last), name, a1, &miss); | 2920 } |
| 2921 |
| 2922 if (!last->HasFastProperties()) { |
| 2923 __ lw(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 2924 __ lw(scratch, FieldMemOperand(scratch, Map::kPrototypeOffset)); |
| 2925 __ Branch(&miss, ne, scratch, Operand(isolate()->factory()->null_value())); |
2916 } | 2926 } |
2917 | 2927 |
2918 // Return undefined if maps of the full prototype chain is still the same. | 2928 // Return undefined if maps of the full prototype chain is still the same. |
2919 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 2929 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
2920 __ Ret(); | 2930 __ Ret(); |
2921 | 2931 |
2922 __ bind(&miss); | 2932 __ bind(&miss); |
2923 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2933 GenerateLoadMiss(masm(), Code::LOAD_IC); |
2924 | 2934 |
2925 // Return the generated code. | 2935 // Return the generated code. |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4368 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4378 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4369 } | 4379 } |
4370 } | 4380 } |
4371 | 4381 |
4372 | 4382 |
4373 #undef __ | 4383 #undef __ |
4374 | 4384 |
4375 } } // namespace v8::internal | 4385 } } // namespace v8::internal |
4376 | 4386 |
4377 #endif // V8_TARGET_ARCH_MIPS | 4387 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |