| OLD | NEW | 
|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 330     int position = source_positions[i]; | 330     int position = source_positions[i]; | 
| 331     InlineCacheState state = target->ic_state(); | 331     InlineCacheState state = target->ic_state(); | 
| 332     Code::Kind kind = target->kind(); | 332     Code::Kind kind = target->kind(); | 
| 333     if (kind == Code::BINARY_OP_IC || | 333     if (kind == Code::BINARY_OP_IC || | 
| 334         kind == Code::TYPE_RECORDING_BINARY_OP_IC || | 334         kind == Code::TYPE_RECORDING_BINARY_OP_IC || | 
| 335         kind == Code::COMPARE_IC) { | 335         kind == Code::COMPARE_IC) { | 
| 336       // TODO(kasperl): Avoid having multiple ICs with the same | 336       // TODO(kasperl): Avoid having multiple ICs with the same | 
| 337       // position by making sure that we have position information | 337       // position by making sure that we have position information | 
| 338       // recorded for all binary ICs. | 338       // recorded for all binary ICs. | 
| 339       if (GetElement(map_, position)->IsUndefined()) { | 339       if (GetElement(map_, position)->IsUndefined()) { | 
| 340         SetElement(map_, position, target); | 340         SetElement(map_, position, target, kNonStrictMode); | 
| 341       } | 341       } | 
| 342     } else if (state == MONOMORPHIC) { | 342     } else if (state == MONOMORPHIC) { | 
| 343       if (target->kind() != Code::CALL_IC || | 343       if (target->kind() != Code::CALL_IC || | 
| 344           target->check_type() == RECEIVER_MAP_CHECK) { | 344           target->check_type() == RECEIVER_MAP_CHECK) { | 
| 345         Handle<Map> map = Handle<Map>(target->FindFirstMap()); | 345         Handle<Map> map = Handle<Map>(target->FindFirstMap()); | 
| 346         if (*map == NULL) { | 346         if (*map == NULL) { | 
| 347           SetElement(map_, position, target); | 347           SetElement(map_, position, target, kNonStrictMode); | 
| 348         } else { | 348         } else { | 
| 349           SetElement(map_, position, map); | 349           SetElement(map_, position, map, kNonStrictMode); | 
| 350         } | 350         } | 
| 351       } else { | 351       } else { | 
| 352         ASSERT(target->kind() == Code::CALL_IC); | 352         ASSERT(target->kind() == Code::CALL_IC); | 
| 353         CheckType check = target->check_type(); | 353         CheckType check = target->check_type(); | 
| 354         ASSERT(check != RECEIVER_MAP_CHECK); | 354         ASSERT(check != RECEIVER_MAP_CHECK); | 
| 355         SetElement(map_, position, Handle<Object>(Smi::FromInt(check))); | 355         SetElement(map_, position, | 
|  | 356                    Handle<Object>(Smi::FromInt(check)), kNonStrictMode); | 
| 356         ASSERT(Smi::cast(*GetElement(map_, position))->value() == check); | 357         ASSERT(Smi::cast(*GetElement(map_, position))->value() == check); | 
| 357       } | 358       } | 
| 358     } else if (state == MEGAMORPHIC) { | 359     } else if (state == MEGAMORPHIC) { | 
| 359       SetElement(map_, position, target); | 360       SetElement(map_, position, target, kNonStrictMode); | 
| 360     } | 361     } | 
| 361   } | 362   } | 
| 362 } | 363 } | 
| 363 | 364 | 
| 364 | 365 | 
| 365 void TypeFeedbackOracle::CollectPositions(Code* code, | 366 void TypeFeedbackOracle::CollectPositions(Code* code, | 
| 366                                           List<int>* code_positions, | 367                                           List<int>* code_positions, | 
| 367                                           List<int>* source_positions) { | 368                                           List<int>* source_positions) { | 
| 368   AssertNoAllocation no_allocation; | 369   AssertNoAllocation no_allocation; | 
| 369   int position = 0; | 370   int position = 0; | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 397         source_positions->Add(position); | 398         source_positions->Add(position); | 
| 398       } | 399       } | 
| 399     } else { | 400     } else { | 
| 400       ASSERT(RelocInfo::IsPosition(mode)); | 401       ASSERT(RelocInfo::IsPosition(mode)); | 
| 401       position = static_cast<int>(info->data()); | 402       position = static_cast<int>(info->data()); | 
| 402     } | 403     } | 
| 403   } | 404   } | 
| 404 } | 405 } | 
| 405 | 406 | 
| 406 } }  // namespace v8::internal | 407 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|