| 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 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 break; | 255 break; |
| 256 } | 256 } |
| 257 case LookupIterator::ACCESS_CHECK: | 257 case LookupIterator::ACCESS_CHECK: |
| 258 // PropertyHandlerCompiler::CheckPrototypes() knows how to emit | 258 // PropertyHandlerCompiler::CheckPrototypes() knows how to emit |
| 259 // access checks for global proxies. | 259 // access checks for global proxies. |
| 260 if (it->GetHolder<JSObject>()->IsJSGlobalProxy() && it->HasAccess()) { | 260 if (it->GetHolder<JSObject>()->IsJSGlobalProxy() && it->HasAccess()) { |
| 261 break; | 261 break; |
| 262 } | 262 } |
| 263 return; | 263 return; |
| 264 case LookupIterator::ACCESSOR: | 264 case LookupIterator::ACCESSOR: |
| 265 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 265 case LookupIterator::DATA: | 266 case LookupIterator::DATA: |
| 266 return; | 267 return; |
| 267 } | 268 } |
| 268 } | 269 } |
| 269 } | 270 } |
| 270 | 271 |
| 271 | 272 |
| 272 bool IC::TryRemoveInvalidPrototypeDependentStub(Handle<Object> receiver, | 273 bool IC::TryRemoveInvalidPrototypeDependentStub(Handle<Object> receiver, |
| 273 Handle<String> name) { | 274 Handle<String> name) { |
| 274 if (!IsNameCompatibleWithPrototypeFailure(name)) return false; | 275 if (!IsNameCompatibleWithPrototypeFailure(name)) return false; |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 DCHECK(lookup->property_details().type() == DATA_CONSTANT); | 1310 DCHECK(lookup->property_details().type() == DATA_CONSTANT); |
| 1310 if (receiver_is_holder) { | 1311 if (receiver_is_holder) { |
| 1311 LoadConstantStub stub(isolate(), lookup->GetConstantIndex()); | 1312 LoadConstantStub stub(isolate(), lookup->GetConstantIndex()); |
| 1312 return stub.GetCode(); | 1313 return stub.GetCode(); |
| 1313 } | 1314 } |
| 1314 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); | 1315 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder); |
| 1315 return compiler.CompileLoadConstant(lookup->name(), | 1316 return compiler.CompileLoadConstant(lookup->name(), |
| 1316 lookup->GetConstantIndex()); | 1317 lookup->GetConstantIndex()); |
| 1317 } | 1318 } |
| 1318 | 1319 |
| 1320 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 1321 return slow_stub(); |
| 1319 case LookupIterator::ACCESS_CHECK: | 1322 case LookupIterator::ACCESS_CHECK: |
| 1320 case LookupIterator::JSPROXY: | 1323 case LookupIterator::JSPROXY: |
| 1321 case LookupIterator::NOT_FOUND: | 1324 case LookupIterator::NOT_FOUND: |
| 1322 case LookupIterator::TRANSITION: | 1325 case LookupIterator::TRANSITION: |
| 1323 UNREACHABLE(); | 1326 UNREACHABLE(); |
| 1324 } | 1327 } |
| 1325 | 1328 |
| 1326 return slow_stub(); | 1329 return slow_stub(); |
| 1327 } | 1330 } |
| 1328 | 1331 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 !info->query()->IsUndefined()) { | 1502 !info->query()->IsUndefined()) { |
| 1500 return false; | 1503 return false; |
| 1501 } | 1504 } |
| 1502 break; | 1505 break; |
| 1503 } | 1506 } |
| 1504 case LookupIterator::ACCESS_CHECK: | 1507 case LookupIterator::ACCESS_CHECK: |
| 1505 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; | 1508 if (it->GetHolder<JSObject>()->IsAccessCheckNeeded()) return false; |
| 1506 break; | 1509 break; |
| 1507 case LookupIterator::ACCESSOR: | 1510 case LookupIterator::ACCESSOR: |
| 1508 return !it->IsReadOnly(); | 1511 return !it->IsReadOnly(); |
| 1512 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 1513 return false; |
| 1509 case LookupIterator::DATA: { | 1514 case LookupIterator::DATA: { |
| 1510 if (it->IsReadOnly()) return false; | 1515 if (it->IsReadOnly()) return false; |
| 1511 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 1516 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
| 1512 if (receiver.is_identical_to(holder)) { | 1517 if (receiver.is_identical_to(holder)) { |
| 1513 it->PrepareForDataProperty(value); | 1518 it->PrepareForDataProperty(value); |
| 1514 // The previous receiver map might just have been deprecated, | 1519 // The previous receiver map might just have been deprecated, |
| 1515 // so reload it. | 1520 // so reload it. |
| 1516 update_receiver_map(receiver); | 1521 update_receiver_map(receiver); |
| 1517 return true; | 1522 return true; |
| 1518 } | 1523 } |
| 1519 | 1524 |
| 1520 // Receiver != holder. | 1525 // Receiver != holder. |
| 1521 PrototypeIterator iter(it->isolate(), receiver); | 1526 PrototypeIterator iter(it->isolate(), receiver); |
| 1522 if (receiver->IsJSGlobalProxy()) { | 1527 if (receiver->IsJSGlobalProxy()) { |
| 1523 return it->GetHolder<Object>().is_identical_to( | 1528 return it->GetHolder<Object>().is_identical_to( |
| 1524 PrototypeIterator::GetCurrent(iter)); | 1529 PrototypeIterator::GetCurrent(iter)); |
| 1525 } | 1530 } |
| 1526 | 1531 |
| 1527 it->PrepareTransitionToDataProperty(value, NONE, store_mode); | 1532 it->PrepareTransitionToDataProperty(value, NONE, store_mode); |
| 1528 return it->IsCacheableTransition(); | 1533 return it->IsCacheableTransition(); |
| 1529 } | 1534 } |
| 1530 } | 1535 } |
| 1531 } | 1536 } |
| 1532 | 1537 |
| 1533 if (it->IsSpecialNumericIndex()) return false; | |
| 1534 it->PrepareTransitionToDataProperty(value, NONE, store_mode); | 1538 it->PrepareTransitionToDataProperty(value, NONE, store_mode); |
| 1535 return it->IsCacheableTransition(); | 1539 return it->IsCacheableTransition(); |
| 1536 } | 1540 } |
| 1537 | 1541 |
| 1538 | 1542 |
| 1539 MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, | 1543 MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, |
| 1540 Handle<Object> value, | 1544 Handle<Object> value, |
| 1541 JSReceiver::StoreFromKeyed store_mode) { | 1545 JSReceiver::StoreFromKeyed store_mode) { |
| 1542 if (FLAG_harmony_scoping && object->IsGlobalObject() && name->IsString()) { | 1546 if (FLAG_harmony_scoping && object->IsGlobalObject() && name->IsString()) { |
| 1543 // Look up in script context table. | 1547 // Look up in script context table. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); | 1832 NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder); |
| 1829 return compiler.CompileStoreField(lookup); | 1833 return compiler.CompileStoreField(lookup); |
| 1830 } | 1834 } |
| 1831 | 1835 |
| 1832 // -------------- Constant properties -------------- | 1836 // -------------- Constant properties -------------- |
| 1833 DCHECK(lookup->property_details().type() == DATA_CONSTANT); | 1837 DCHECK(lookup->property_details().type() == DATA_CONSTANT); |
| 1834 TRACE_GENERIC_IC(isolate(), "StoreIC", "constant property"); | 1838 TRACE_GENERIC_IC(isolate(), "StoreIC", "constant property"); |
| 1835 break; | 1839 break; |
| 1836 } | 1840 } |
| 1837 | 1841 |
| 1842 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 1838 case LookupIterator::ACCESS_CHECK: | 1843 case LookupIterator::ACCESS_CHECK: |
| 1839 case LookupIterator::JSPROXY: | 1844 case LookupIterator::JSPROXY: |
| 1840 case LookupIterator::NOT_FOUND: | 1845 case LookupIterator::NOT_FOUND: |
| 1841 UNREACHABLE(); | 1846 UNREACHABLE(); |
| 1842 } | 1847 } |
| 1843 return slow_stub(); | 1848 return slow_stub(); |
| 1844 } | 1849 } |
| 1845 | 1850 |
| 1846 | 1851 |
| 1847 Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver, | 1852 Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver, |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3050 static const Address IC_utilities[] = { | 3055 static const Address IC_utilities[] = { |
| 3051 #define ADDR(name) FUNCTION_ADDR(name), | 3056 #define ADDR(name) FUNCTION_ADDR(name), |
| 3052 IC_UTIL_LIST(ADDR) NULL | 3057 IC_UTIL_LIST(ADDR) NULL |
| 3053 #undef ADDR | 3058 #undef ADDR |
| 3054 }; | 3059 }; |
| 3055 | 3060 |
| 3056 | 3061 |
| 3057 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3062 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
| 3058 } | 3063 } |
| 3059 } // namespace v8::internal | 3064 } // namespace v8::internal |
| OLD | NEW |