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 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 TRACE_IC("StoreIC", name, state, *stub); | 1456 TRACE_IC("StoreIC", name, state, *stub); |
1457 } | 1457 } |
1458 return receiver->SetProperty(*name, *value, NONE, strict_mode, store_mode); | 1458 return receiver->SetProperty(*name, *value, NONE, strict_mode, store_mode); |
1459 } | 1459 } |
1460 | 1460 |
1461 LookupResult lookup(isolate()); | 1461 LookupResult lookup(isolate()); |
1462 if (LookupForWrite(receiver, name, &lookup)) { | 1462 if (LookupForWrite(receiver, name, &lookup)) { |
1463 if (FLAG_use_ic) { | 1463 if (FLAG_use_ic) { |
1464 UpdateStoreCaches(&lookup, state, strict_mode, receiver, name, value); | 1464 UpdateStoreCaches(&lookup, state, strict_mode, receiver, name, value); |
1465 } | 1465 } |
1466 } else if (strict_mode == kStrictMode && IsUndeclaredGlobal(object)) { | 1466 } else if (strict_mode == kStrictMode && |
| 1467 !(lookup.IsProperty() && lookup.IsReadOnly()) && |
| 1468 IsUndeclaredGlobal(object)) { |
1467 // Strict mode doesn't allow setting non-existent global property. | 1469 // Strict mode doesn't allow setting non-existent global property. |
1468 return ReferenceError("not_defined", name); | 1470 return ReferenceError("not_defined", name); |
1469 } | 1471 } |
1470 | 1472 |
1471 // Set the property. | 1473 // Set the property. |
1472 return receiver->SetProperty(*name, *value, NONE, strict_mode, store_mode); | 1474 return receiver->SetProperty(*name, *value, NONE, strict_mode, store_mode); |
1473 } | 1475 } |
1474 | 1476 |
1475 | 1477 |
1476 void StoreIC::UpdateStoreCaches(LookupResult* lookup, | 1478 void StoreIC::UpdateStoreCaches(LookupResult* lookup, |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 #undef ADDR | 2672 #undef ADDR |
2671 }; | 2673 }; |
2672 | 2674 |
2673 | 2675 |
2674 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2676 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2675 return IC_utilities[id]; | 2677 return IC_utilities[id]; |
2676 } | 2678 } |
2677 | 2679 |
2678 | 2680 |
2679 } } // namespace v8::internal | 2681 } } // namespace v8::internal |
OLD | NEW |