OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // Get the constant function and compute the code stub for this | 412 // Get the constant function and compute the code stub for this |
413 // call; used for rewriting to monomorphic state and making sure | 413 // call; used for rewriting to monomorphic state and making sure |
414 // that the code stub is in the stub cache. | 414 // that the code stub is in the stub cache. |
415 JSFunction* function = lookup->GetConstantFunction(); | 415 JSFunction* function = lookup->GetConstantFunction(); |
416 code = StubCache::ComputeCallConstant(argc, in_loop, *name, *object, | 416 code = StubCache::ComputeCallConstant(argc, in_loop, *name, *object, |
417 lookup->holder(), function); | 417 lookup->holder(), function); |
418 break; | 418 break; |
419 } | 419 } |
420 case NORMAL: { | 420 case NORMAL: { |
421 if (!object->IsJSObject()) return; | 421 if (!object->IsJSObject()) return; |
422 if (object->IsJSGlobalObject()) { | 422 if (object->IsGlobalObject()) { |
423 // The stub generated for the global object picks the value directly | 423 // The stub generated for the global object picks the value directly |
424 // from the property cell. So the property must be directly on the | 424 // from the property cell. So the property must be directly on the |
425 // global object. | 425 // global object. |
426 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(object); | 426 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); |
427 if (lookup->holder() != *global) return; | 427 if (lookup->holder() != *global) return; |
428 JSGlobalPropertyCell* cell = | 428 JSGlobalPropertyCell* cell = |
429 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); | 429 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); |
430 if (cell->value()->IsJSFunction()) { | 430 if (cell->value()->IsJSFunction()) { |
431 JSFunction* function = JSFunction::cast(cell->value()); | 431 JSFunction* function = JSFunction::cast(cell->value()); |
432 code = StubCache::ComputeCallGlobal(argc, in_loop, *name, *global, | 432 code = StubCache::ComputeCallGlobal(argc, in_loop, *name, *global, |
433 cell, function); | 433 cell, function); |
434 } | 434 } |
435 } else { | 435 } else { |
436 // There is only one shared stub for calling normalized | 436 // There is only one shared stub for calling normalized |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 lookup->GetFieldIndex()); | 617 lookup->GetFieldIndex()); |
618 break; | 618 break; |
619 } | 619 } |
620 case CONSTANT_FUNCTION: { | 620 case CONSTANT_FUNCTION: { |
621 Object* constant = lookup->GetConstantFunction(); | 621 Object* constant = lookup->GetConstantFunction(); |
622 code = StubCache::ComputeLoadConstant(*name, *receiver, | 622 code = StubCache::ComputeLoadConstant(*name, *receiver, |
623 lookup->holder(), constant); | 623 lookup->holder(), constant); |
624 break; | 624 break; |
625 } | 625 } |
626 case NORMAL: { | 626 case NORMAL: { |
627 if (object->IsJSGlobalObject()) { | 627 if (object->IsGlobalObject()) { |
628 // The stub generated for the global object picks the value directly | 628 // The stub generated for the global object picks the value directly |
629 // from the property cell. So the property must be directly on the | 629 // from the property cell. So the property must be directly on the |
630 // global object. | 630 // global object. |
631 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(object); | 631 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); |
632 if (lookup->holder() != *global) return; | 632 if (lookup->holder() != *global) return; |
633 JSGlobalPropertyCell* cell = | 633 JSGlobalPropertyCell* cell = |
634 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); | 634 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); |
635 code = StubCache::ComputeLoadGlobal(*name, *global, | 635 code = StubCache::ComputeLoadGlobal(*name, *global, |
636 cell, lookup->IsDontDelete()); | 636 cell, lookup->IsDontDelete()); |
637 } else { | 637 } else { |
638 // There is only one shared stub for loading normalized | 638 // There is only one shared stub for loading normalized |
639 // properties. It does not traverse the prototype chain, so the | 639 // properties. It does not traverse the prototype chain, so the |
640 // property must be found in the receiver for the stub to be | 640 // property must be found in the receiver for the stub to be |
641 // applicable. | 641 // applicable. |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 case MAP_TRANSITION: { | 969 case MAP_TRANSITION: { |
970 if (lookup->GetAttributes() != NONE) return; | 970 if (lookup->GetAttributes() != NONE) return; |
971 HandleScope scope; | 971 HandleScope scope; |
972 ASSERT(type == MAP_TRANSITION); | 972 ASSERT(type == MAP_TRANSITION); |
973 Handle<Map> transition(lookup->GetTransitionMap()); | 973 Handle<Map> transition(lookup->GetTransitionMap()); |
974 int index = transition->PropertyIndexFor(*name); | 974 int index = transition->PropertyIndexFor(*name); |
975 code = StubCache::ComputeStoreField(*name, *receiver, index, *transition); | 975 code = StubCache::ComputeStoreField(*name, *receiver, index, *transition); |
976 break; | 976 break; |
977 } | 977 } |
978 case NORMAL: { | 978 case NORMAL: { |
979 if (!receiver->IsJSGlobalObject()) { | 979 if (!receiver->IsGlobalObject()) { |
980 return; | 980 return; |
981 } | 981 } |
982 // The stub generated for the global object picks the value directly | 982 // The stub generated for the global object picks the value directly |
983 // from the property cell. So the property must be directly on the | 983 // from the property cell. So the property must be directly on the |
984 // global object. | 984 // global object. |
985 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(receiver); | 985 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); |
986 JSGlobalPropertyCell* cell = | 986 JSGlobalPropertyCell* cell = |
987 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); | 987 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); |
988 code = StubCache::ComputeStoreGlobal(*name, *global, cell); | 988 code = StubCache::ComputeStoreGlobal(*name, *global, cell); |
989 break; | 989 break; |
990 } | 990 } |
991 case CALLBACKS: { | 991 case CALLBACKS: { |
992 if (!lookup->GetCallbackObject()->IsAccessorInfo()) return; | 992 if (!lookup->GetCallbackObject()->IsAccessorInfo()) return; |
993 AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject()); | 993 AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject()); |
994 if (v8::ToCData<Address>(callback->setter()) == 0) return; | 994 if (v8::ToCData<Address>(callback->setter()) == 0) return; |
995 code = StubCache::ComputeStoreCallback(*name, *receiver, callback); | 995 code = StubCache::ComputeStoreCallback(*name, *receiver, callback); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 #undef ADDR | 1319 #undef ADDR |
1320 }; | 1320 }; |
1321 | 1321 |
1322 | 1322 |
1323 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1323 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1324 return IC_utilities[id]; | 1324 return IC_utilities[id]; |
1325 } | 1325 } |
1326 | 1326 |
1327 | 1327 |
1328 } } // namespace v8::internal | 1328 } } // namespace v8::internal |
OLD | NEW |