| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 default: UNREACHABLE(); | 229 default: UNREACHABLE(); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 void CallIC::Clear(Address address, Code* target) { | 234 void CallIC::Clear(Address address, Code* target) { |
| 235 State state = target->ic_state(); | 235 State state = target->ic_state(); |
| 236 InLoopFlag in_loop = target->ic_in_loop(); | 236 InLoopFlag in_loop = target->ic_in_loop(); |
| 237 if (state == UNINITIALIZED) return; | 237 if (state == UNINITIALIZED) return; |
| 238 Code* code = | 238 Code* code = |
| 239 StubCache::FindCallInitialize(target->arguments_count(), in_loop); | 239 Isolate::Current()->stub_cache()->FindCallInitialize( |
| 240 target->arguments_count(), |
| 241 in_loop); |
| 240 SetTargetAtAddress(address, code); | 242 SetTargetAtAddress(address, code); |
| 241 } | 243 } |
| 242 | 244 |
| 243 | 245 |
| 244 void KeyedLoadIC::Clear(Address address, Code* target) { | 246 void KeyedLoadIC::Clear(Address address, Code* target) { |
| 245 if (target->ic_state() == UNINITIALIZED) return; | 247 if (target->ic_state() == UNINITIALIZED) return; |
| 246 // Make sure to also clear the map used in inline fast cases. If we | 248 // Make sure to also clear the map used in inline fast cases. If we |
| 247 // do not clear these maps, cached code can keep objects alive | 249 // do not clear these maps, cached code can keep objects alive |
| 248 // through the embedded maps. | 250 // through the embedded maps. |
| 249 ClearInlinedVersion(address); | 251 ClearInlinedVersion(address); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 int argc = target()->arguments_count(); | 494 int argc = target()->arguments_count(); |
| 493 InLoopFlag in_loop = target()->ic_in_loop(); | 495 InLoopFlag in_loop = target()->ic_in_loop(); |
| 494 Object* code = NULL; | 496 Object* code = NULL; |
| 495 | 497 |
| 496 if (state == UNINITIALIZED) { | 498 if (state == UNINITIALIZED) { |
| 497 // This is the first time we execute this inline cache. | 499 // This is the first time we execute this inline cache. |
| 498 // Set the target to the pre monomorphic stub to delay | 500 // Set the target to the pre monomorphic stub to delay |
| 499 // setting the monomorphic state. | 501 // setting the monomorphic state. |
| 500 code = StubCache::ComputeCallPreMonomorphic(argc, in_loop); | 502 code = StubCache::ComputeCallPreMonomorphic(argc, in_loop); |
| 501 } else if (state == MONOMORPHIC) { | 503 } else if (state == MONOMORPHIC) { |
| 502 code = StubCache::ComputeCallMegamorphic(argc, in_loop); | 504 code = Isolate::Current()->stub_cache()->ComputeCallMegamorphic(argc, |
| 505 in_loop); |
| 503 } else { | 506 } else { |
| 504 // Compute monomorphic stub. | 507 // Compute monomorphic stub. |
| 505 switch (lookup->type()) { | 508 switch (lookup->type()) { |
| 506 case FIELD: { | 509 case FIELD: { |
| 507 int index = lookup->GetFieldIndex(); | 510 int index = lookup->GetFieldIndex(); |
| 508 code = Isolate::Current()->stub_cache()->ComputeCallField( | 511 code = Isolate::Current()->stub_cache()->ComputeCallField( |
| 509 argc, | 512 argc, |
| 510 in_loop, | 513 in_loop, |
| 511 *name, | 514 *name, |
| 512 *object, | 515 *object, |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 #undef ADDR | 1575 #undef ADDR |
| 1573 }; | 1576 }; |
| 1574 | 1577 |
| 1575 | 1578 |
| 1576 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1579 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1577 return IC_utilities[id]; | 1580 return IC_utilities[id]; |
| 1578 } | 1581 } |
| 1579 | 1582 |
| 1580 | 1583 |
| 1581 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
| OLD | NEW |