| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 Register scratch2, | 446 Register scratch2, |
| 447 Register scratch3, | 447 Register scratch3, |
| 448 Label* miss_label, | 448 Label* miss_label, |
| 449 Label* miss_restore_name, | 449 Label* miss_restore_name, |
| 450 Label* slow) { | 450 Label* slow) { |
| 451 // a0 : value. | 451 // a0 : value. |
| 452 Label exit; | 452 Label exit; |
| 453 | 453 |
| 454 // Check that the map of the object hasn't changed. | 454 // Check that the map of the object hasn't changed. |
| 455 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, | 455 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, |
| 456 DO_SMI_CHECK, REQUIRE_EXACT_MAP); | 456 DO_SMI_CHECK); |
| 457 | 457 |
| 458 // Perform global security token check if needed. | 458 // Perform global security token check if needed. |
| 459 if (object->IsJSGlobalProxy()) { | 459 if (object->IsJSGlobalProxy()) { |
| 460 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); | 460 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); |
| 461 } | 461 } |
| 462 | 462 |
| 463 int descriptor = transition->LastAdded(); | 463 int descriptor = transition->LastAdded(); |
| 464 DescriptorArray* descriptors = transition->instance_descriptors(); | 464 DescriptorArray* descriptors = transition->instance_descriptors(); |
| 465 PropertyDetails details = descriptors->GetDetails(descriptor); | 465 PropertyDetails details = descriptors->GetDetails(descriptor); |
| 466 Representation representation = details.representation(); | 466 Representation representation = details.representation(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 Register name_reg, | 649 Register name_reg, |
| 650 Register value_reg, | 650 Register value_reg, |
| 651 Register scratch1, | 651 Register scratch1, |
| 652 Register scratch2, | 652 Register scratch2, |
| 653 Label* miss_label) { | 653 Label* miss_label) { |
| 654 // a0 : value | 654 // a0 : value |
| 655 Label exit; | 655 Label exit; |
| 656 | 656 |
| 657 // Check that the map of the object hasn't changed. | 657 // Check that the map of the object hasn't changed. |
| 658 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, | 658 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, |
| 659 DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | 659 DO_SMI_CHECK); |
| 660 | 660 |
| 661 // Perform global security token check if needed. | 661 // Perform global security token check if needed. |
| 662 if (object->IsJSGlobalProxy()) { | 662 if (object->IsJSGlobalProxy()) { |
| 663 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); | 663 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); |
| 664 } | 664 } |
| 665 | 665 |
| 666 // Stub never generated for non-global objects that require access | 666 // Stub never generated for non-global objects that require access |
| 667 // checks. | 667 // checks. |
| 668 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 668 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
| 669 | 669 |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 scratch1, scratch2); | 1242 scratch1, scratch2); |
| 1243 | 1243 |
| 1244 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 1244 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 1245 reg = holder_reg; // From now on the object will be in holder_reg. | 1245 reg = holder_reg; // From now on the object will be in holder_reg. |
| 1246 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 1246 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
| 1247 } else { | 1247 } else { |
| 1248 Register map_reg = scratch1; | 1248 Register map_reg = scratch1; |
| 1249 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) { | 1249 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) { |
| 1250 Handle<Map> current_map(current->map()); | 1250 Handle<Map> current_map(current->map()); |
| 1251 // CheckMap implicitly loads the map of |reg| into |map_reg|. | 1251 // CheckMap implicitly loads the map of |reg| into |map_reg|. |
| 1252 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK, | 1252 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK); |
| 1253 ALLOW_ELEMENT_TRANSITION_MAPS); | |
| 1254 } else { | 1253 } else { |
| 1255 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 1254 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 1256 } | 1255 } |
| 1257 // Check access rights to the global object. This has to happen after | 1256 // Check access rights to the global object. This has to happen after |
| 1258 // the map check so that we know that the object is actually a global | 1257 // the map check so that we know that the object is actually a global |
| 1259 // object. | 1258 // object. |
| 1260 if (current->IsJSGlobalProxy()) { | 1259 if (current->IsJSGlobalProxy()) { |
| 1261 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 1260 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
| 1262 } | 1261 } |
| 1263 reg = holder_reg; // From now on the object will be in holder_reg. | 1262 reg = holder_reg; // From now on the object will be in holder_reg. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1279 // Go to the next object in the prototype chain. | 1278 // Go to the next object in the prototype chain. |
| 1280 current = prototype; | 1279 current = prototype; |
| 1281 } | 1280 } |
| 1282 | 1281 |
| 1283 // Log the check depth. | 1282 // Log the check depth. |
| 1284 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 1283 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| 1285 | 1284 |
| 1286 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { | 1285 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { |
| 1287 // Check the holder map. | 1286 // Check the holder map. |
| 1288 __ CheckMap(reg, scratch1, Handle<Map>(holder->map()), miss, | 1287 __ CheckMap(reg, scratch1, Handle<Map>(holder->map()), miss, |
| 1289 DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | 1288 DONT_DO_SMI_CHECK); |
| 1290 } | 1289 } |
| 1291 | 1290 |
| 1292 // Perform security check for access to the global object. | 1291 // Perform security check for access to the global object. |
| 1293 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); | 1292 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); |
| 1294 if (holder->IsJSGlobalProxy()) { | 1293 if (holder->IsJSGlobalProxy()) { |
| 1295 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 1294 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
| 1296 } | 1295 } |
| 1297 | 1296 |
| 1298 // If we've skipped any global objects, it's not enough to verify that | 1297 // If we've skipped any global objects, it's not enough to verify that |
| 1299 // their maps haven't changed. We also need to check that the property | 1298 // their maps haven't changed. We also need to check that the property |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 #define __ ACCESS_MASM(masm()) | 2841 #define __ ACCESS_MASM(masm()) |
| 2843 | 2842 |
| 2844 | 2843 |
| 2845 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( | 2844 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
| 2846 Handle<JSObject> object, | 2845 Handle<JSObject> object, |
| 2847 Handle<Name> name) { | 2846 Handle<Name> name) { |
| 2848 Label miss; | 2847 Label miss; |
| 2849 | 2848 |
| 2850 // Check that the map of the object hasn't changed. | 2849 // Check that the map of the object hasn't changed. |
| 2851 __ CheckMap(receiver(), scratch1(), Handle<Map>(object->map()), &miss, | 2850 __ CheckMap(receiver(), scratch1(), Handle<Map>(object->map()), &miss, |
| 2852 DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); | 2851 DO_SMI_CHECK); |
| 2853 | 2852 |
| 2854 // Perform global security token check if needed. | 2853 // Perform global security token check if needed. |
| 2855 if (object->IsJSGlobalProxy()) { | 2854 if (object->IsJSGlobalProxy()) { |
| 2856 __ CheckAccessGlobalProxy(receiver(), scratch1(), &miss); | 2855 __ CheckAccessGlobalProxy(receiver(), scratch1(), &miss); |
| 2857 } | 2856 } |
| 2858 | 2857 |
| 2859 // Stub is never generated for non-global objects that require access | 2858 // Stub is never generated for non-global objects that require access |
| 2860 // checks. | 2859 // checks. |
| 2861 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 2860 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
| 2862 | 2861 |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3885 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3884 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
| 3886 } | 3885 } |
| 3887 } | 3886 } |
| 3888 | 3887 |
| 3889 | 3888 |
| 3890 #undef __ | 3889 #undef __ |
| 3891 | 3890 |
| 3892 } } // namespace v8::internal | 3891 } } // namespace v8::internal |
| 3893 | 3892 |
| 3894 #endif // V8_TARGET_ARCH_MIPS | 3893 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |