OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 if (current_map->IsJSGlobalProxyMap()) { | 878 if (current_map->IsJSGlobalProxyMap()) { |
879 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 879 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
880 } else if (current_map->IsJSGlobalObjectMap()) { | 880 } else if (current_map->IsJSGlobalObjectMap()) { |
881 GenerateCheckPropertyCell( | 881 GenerateCheckPropertyCell( |
882 masm(), Handle<JSGlobalObject>::cast(current), name, | 882 masm(), Handle<JSGlobalObject>::cast(current), name, |
883 scratch2, miss); | 883 scratch2, miss); |
884 } | 884 } |
885 | 885 |
886 reg = holder_reg; // From now on the object will be in holder_reg. | 886 reg = holder_reg; // From now on the object will be in holder_reg. |
887 | 887 |
888 if (heap()->InNewSpace(*prototype)) { | 888 // Two possible reasons for loading the prototype from the map: |
889 // The prototype is in new space; we cannot store a reference to it | 889 // (1) Can't store references to new space in code. |
890 // in the code. Load it from the map. | 890 // (2) Handler is shared for all receivers with the same prototype |
| 891 // map (but not necessarily the same prototype instance). |
| 892 bool load_prototype_from_map = |
| 893 heap()->InNewSpace(*prototype) || depth == 1; |
| 894 if (load_prototype_from_map) { |
891 __ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); | 895 __ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); |
892 } else { | 896 } else { |
893 // The prototype is in old space; load it directly. | |
894 __ li(reg, Operand(prototype)); | 897 __ li(reg, Operand(prototype)); |
895 } | 898 } |
896 } | 899 } |
897 | 900 |
898 // Go to the next object in the prototype chain. | 901 // Go to the next object in the prototype chain. |
899 current = prototype; | 902 current = prototype; |
900 current_map = handle(current->map()); | 903 current_map = handle(current->map()); |
901 } | 904 } |
902 | 905 |
903 // Log the check depth. | 906 // Log the check depth. |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 | 1501 |
1499 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1502 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1500 } | 1503 } |
1501 | 1504 |
1502 | 1505 |
1503 #undef __ | 1506 #undef __ |
1504 | 1507 |
1505 } } // namespace v8::internal | 1508 } } // namespace v8::internal |
1506 | 1509 |
1507 #endif // V8_TARGET_ARCH_MIPS | 1510 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |