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

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

Issue 13923003: Always require exact maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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/macro-assembler-arm.cc ('k') | src/ia32/lithium-codegen-ia32.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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 Register value_reg, 451 Register value_reg,
452 Register scratch1, 452 Register scratch1,
453 Register scratch2, 453 Register scratch2,
454 Label* miss_label, 454 Label* miss_label,
455 Label* miss_restore_name) { 455 Label* miss_restore_name) {
456 // r0 : value 456 // r0 : value
457 Label exit; 457 Label exit;
458 458
459 // Check that the map of the object hasn't changed. 459 // Check that the map of the object hasn't changed.
460 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, 460 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label,
461 DO_SMI_CHECK, REQUIRE_EXACT_MAP); 461 DO_SMI_CHECK);
462 462
463 // Perform global security token check if needed. 463 // Perform global security token check if needed.
464 if (object->IsJSGlobalProxy()) { 464 if (object->IsJSGlobalProxy()) {
465 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); 465 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
466 } 466 }
467 467
468 // Check that we are allowed to write this. 468 // Check that we are allowed to write this.
469 if (object->GetPrototype()->IsJSObject()) { 469 if (object->GetPrototype()->IsJSObject()) {
470 JSObject* holder; 470 JSObject* holder;
471 // holder == object indicates that no property was found. 471 // holder == object indicates that no property was found.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 Register name_reg, 599 Register name_reg,
600 Register value_reg, 600 Register value_reg,
601 Register scratch1, 601 Register scratch1,
602 Register scratch2, 602 Register scratch2,
603 Label* miss_label) { 603 Label* miss_label) {
604 // r0 : value 604 // r0 : value
605 Label exit; 605 Label exit;
606 606
607 // Check that the map of the object hasn't changed. 607 // Check that the map of the object hasn't changed.
608 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label, 608 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label,
609 DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); 609 DO_SMI_CHECK);
610 610
611 // Perform global security token check if needed. 611 // Perform global security token check if needed.
612 if (object->IsJSGlobalProxy()) { 612 if (object->IsJSGlobalProxy()) {
613 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label); 613 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
614 } 614 }
615 615
616 // Stub never generated for non-global objects that require access 616 // Stub never generated for non-global objects that require access
617 // checks. 617 // checks.
618 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 618 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
619 619
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 scratch1, scratch2); 1125 scratch1, scratch2);
1126 1126
1127 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 1127 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
1128 reg = holder_reg; // From now on the object will be in holder_reg. 1128 reg = holder_reg; // From now on the object will be in holder_reg.
1129 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 1129 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
1130 } else { 1130 } else {
1131 Register map_reg = scratch1; 1131 Register map_reg = scratch1;
1132 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) { 1132 if (!current.is_identical_to(first) || check == CHECK_ALL_MAPS) {
1133 Handle<Map> current_map(current->map()); 1133 Handle<Map> current_map(current->map());
1134 // CheckMap implicitly loads the map of |reg| into |map_reg|. 1134 // CheckMap implicitly loads the map of |reg| into |map_reg|.
1135 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK, 1135 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
1136 ALLOW_ELEMENT_TRANSITION_MAPS);
1137 } else { 1136 } else {
1138 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 1137 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
1139 } 1138 }
1140 1139
1141 // Check access rights to the global object. This has to happen after 1140 // Check access rights to the global object. This has to happen after
1142 // the map check so that we know that the object is actually a global 1141 // the map check so that we know that the object is actually a global
1143 // object. 1142 // object.
1144 if (current->IsJSGlobalProxy()) { 1143 if (current->IsJSGlobalProxy()) {
1145 __ CheckAccessGlobalProxy(reg, scratch2, miss); 1144 __ CheckAccessGlobalProxy(reg, scratch2, miss);
1146 } 1145 }
(...skipping 16 matching lines...) Expand all
1163 // Go to the next object in the prototype chain. 1162 // Go to the next object in the prototype chain.
1164 current = prototype; 1163 current = prototype;
1165 } 1164 }
1166 1165
1167 // Log the check depth. 1166 // Log the check depth.
1168 LOG(masm()->isolate(), IntEvent("check-maps-depth", depth + 1)); 1167 LOG(masm()->isolate(), IntEvent("check-maps-depth", depth + 1));
1169 1168
1170 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { 1169 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) {
1171 // Check the holder map. 1170 // Check the holder map.
1172 __ CheckMap(reg, scratch1, Handle<Map>(holder->map()), miss, 1171 __ CheckMap(reg, scratch1, Handle<Map>(holder->map()), miss,
1173 DONT_DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); 1172 DONT_DO_SMI_CHECK);
1174 } 1173 }
1175 1174
1176 // Perform security check for access to the global object. 1175 // Perform security check for access to the global object.
1177 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); 1176 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
1178 if (holder->IsJSGlobalProxy()) { 1177 if (holder->IsJSGlobalProxy()) {
1179 __ CheckAccessGlobalProxy(reg, scratch1, miss); 1178 __ CheckAccessGlobalProxy(reg, scratch1, miss);
1180 } 1179 }
1181 1180
1182 // If we've skipped any global objects, it's not enough to verify that 1181 // If we've skipped any global objects, it's not enough to verify that
1183 // their maps haven't changed. We also need to check that the property 1182 // their maps haven't changed. We also need to check that the property
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 #define __ ACCESS_MASM(masm()) 2674 #define __ ACCESS_MASM(masm())
2676 2675
2677 2676
2678 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( 2677 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
2679 Handle<JSObject> object, 2678 Handle<JSObject> object,
2680 Handle<Name> name) { 2679 Handle<Name> name) {
2681 Label miss; 2680 Label miss;
2682 2681
2683 // Check that the map of the object hasn't changed. 2682 // Check that the map of the object hasn't changed.
2684 __ CheckMap(receiver(), scratch1(), Handle<Map>(object->map()), &miss, 2683 __ CheckMap(receiver(), scratch1(), Handle<Map>(object->map()), &miss,
2685 DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS); 2684 DO_SMI_CHECK);
2686 2685
2687 // Perform global security token check if needed. 2686 // Perform global security token check if needed.
2688 if (object->IsJSGlobalProxy()) { 2687 if (object->IsJSGlobalProxy()) {
2689 __ CheckAccessGlobalProxy(receiver(), scratch1(), &miss); 2688 __ CheckAccessGlobalProxy(receiver(), scratch1(), &miss);
2690 } 2689 }
2691 2690
2692 // Stub is never generated for non-global objects that require access 2691 // Stub is never generated for non-global objects that require access
2693 // checks. 2692 // checks.
2694 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 2693 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
2695 2694
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3684 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3683 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3685 } 3684 }
3686 } 3685 }
3687 3686
3688 3687
3689 #undef __ 3688 #undef __
3690 3689
3691 } } // namespace v8::internal 3690 } } // namespace v8::internal
3692 3691
3693 #endif // V8_TARGET_ARCH_ARM 3692 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698