| 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 4933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4944 bool smi_and_map_check) { | 4944 bool smi_and_map_check) { |
| 4945 ASSERT(lookup->IsFound()); | 4945 ASSERT(lookup->IsFound()); |
| 4946 if (smi_and_map_check) { | 4946 if (smi_and_map_check) { |
| 4947 AddInstruction(new(zone()) HCheckNonSmi(object)); | 4947 AddInstruction(new(zone()) HCheckNonSmi(object)); |
| 4948 AddInstruction(HCheckMaps::NewWithTransitions(object, type, zone())); | 4948 AddInstruction(HCheckMaps::NewWithTransitions(object, type, zone())); |
| 4949 } | 4949 } |
| 4950 | 4950 |
| 4951 // If the property does not exist yet, we have to check that it wasn't made | 4951 // If the property does not exist yet, we have to check that it wasn't made |
| 4952 // readonly or turned into a setter by some meanwhile modifications on the | 4952 // readonly or turned into a setter by some meanwhile modifications on the |
| 4953 // prototype chain. | 4953 // prototype chain. |
| 4954 if (!lookup->IsProperty()) { | 4954 if (!lookup->IsProperty() && type->prototype()->IsJSReceiver()) { |
| 4955 Object* proto = type->prototype(); | 4955 Object* proto = type->prototype(); |
| 4956 // First check that the prototype chain isn't affected already. | 4956 // First check that the prototype chain isn't affected already. |
| 4957 LookupResult proto_result(isolate()); | 4957 LookupResult proto_result(isolate()); |
| 4958 proto->Lookup(*name, &proto_result); | 4958 proto->Lookup(*name, &proto_result); |
| 4959 if (proto_result.IsProperty()) { | 4959 if (proto_result.IsProperty()) { |
| 4960 // If the inherited property could induce readonly-ness, bail out. | 4960 // If the inherited property could induce readonly-ness, bail out. |
| 4961 if (proto_result.IsReadOnly() || !proto_result.IsCacheable()) { | 4961 if (proto_result.IsReadOnly() || !proto_result.IsCacheable()) { |
| 4962 Bailout("improper object on prototype chain for store"); | 4962 Bailout("improper object on prototype chain for store"); |
| 4963 return NULL; | 4963 return NULL; |
| 4964 } | 4964 } |
| (...skipping 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9442 } | 9442 } |
| 9443 } | 9443 } |
| 9444 | 9444 |
| 9445 #ifdef DEBUG | 9445 #ifdef DEBUG |
| 9446 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 9446 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 9447 if (allocator_ != NULL) allocator_->Verify(); | 9447 if (allocator_ != NULL) allocator_->Verify(); |
| 9448 #endif | 9448 #endif |
| 9449 } | 9449 } |
| 9450 | 9450 |
| 9451 } } // namespace v8::internal | 9451 } } // namespace v8::internal |
| OLD | NEW |