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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1435 |
1436 if (details.type() != CALLBACKS && details.attributes() == NONE && | 1436 if (details.type() != CALLBACKS && details.attributes() == NONE && |
1437 holder->HasFastProperties()) { | 1437 holder->HasFastProperties()) { |
1438 return compiler.CompileStoreTransition(transition, name); | 1438 return compiler.CompileStoreTransition(transition, name); |
1439 } | 1439 } |
1440 } else { | 1440 } else { |
1441 switch (lookup->type()) { | 1441 switch (lookup->type()) { |
1442 case FIELD: | 1442 case FIELD: |
1443 return compiler.CompileStoreField(lookup, name); | 1443 return compiler.CompileStoreField(lookup, name); |
1444 case NORMAL: | 1444 case NORMAL: |
1445 if (kind() == Code::KEYED_STORE_IC) break; | |
1446 if (receiver->IsJSGlobalProxy() || receiver->IsGlobalObject()) { | 1445 if (receiver->IsJSGlobalProxy() || receiver->IsGlobalObject()) { |
1447 // The stub generated for the global object picks the value directly | 1446 // The stub generated for the global object picks the value directly |
1448 // from the property cell. So the property must be directly on the | 1447 // from the property cell. So the property must be directly on the |
1449 // global object. | 1448 // global object. |
1450 PrototypeIterator iter(isolate(), receiver); | 1449 PrototypeIterator iter(isolate(), receiver); |
1451 Handle<GlobalObject> global = | 1450 Handle<GlobalObject> global = |
1452 receiver->IsJSGlobalProxy() | 1451 receiver->IsJSGlobalProxy() |
1453 ? Handle<GlobalObject>::cast( | 1452 ? Handle<GlobalObject>::cast( |
1454 PrototypeIterator::GetCurrent(iter)) | 1453 PrototypeIterator::GetCurrent(iter)) |
1455 : Handle<GlobalObject>::cast(receiver); | 1454 : Handle<GlobalObject>::cast(receiver); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1490 call_optimization); | 1489 call_optimization); |
1491 } | 1490 } |
1492 return compiler.CompileStoreViaSetter( | 1491 return compiler.CompileStoreViaSetter( |
1493 receiver, name, Handle<JSFunction>::cast(setter)); | 1492 receiver, name, Handle<JSFunction>::cast(setter)); |
1494 } | 1493 } |
1495 // TODO(dcarney): Handle correctly. | 1494 // TODO(dcarney): Handle correctly. |
1496 DCHECK(callback->IsDeclaredAccessorInfo()); | 1495 DCHECK(callback->IsDeclaredAccessorInfo()); |
1497 break; | 1496 break; |
1498 } | 1497 } |
1499 case INTERCEPTOR: | 1498 case INTERCEPTOR: |
1500 if (kind() == Code::KEYED_STORE_IC) break; | |
1501 DCHECK(HasInterceptorSetter(*holder)); | 1499 DCHECK(HasInterceptorSetter(*holder)); |
1502 return compiler.CompileStoreInterceptor(name); | 1500 return compiler.CompileStoreInterceptor(name); |
1503 case CONSTANT: | 1501 case CONSTANT: |
1504 break; | 1502 break; |
1505 case NONEXISTENT: | 1503 case NONEXISTENT: |
1506 case HANDLER: | 1504 case HANDLER: |
1507 UNREACHABLE(); | 1505 UNREACHABLE(); |
1508 break; | 1506 break; |
1509 } | 1507 } |
1510 } | 1508 } |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 #undef ADDR | 3058 #undef ADDR |
3061 }; | 3059 }; |
3062 | 3060 |
3063 | 3061 |
3064 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3062 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3065 return IC_utilities[id]; | 3063 return IC_utilities[id]; |
3066 } | 3064 } |
3067 | 3065 |
3068 | 3066 |
3069 } } // namespace v8::internal | 3067 } } // namespace v8::internal |
OLD | NEW |