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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 List<int> source_positions(kInitialCapacity); | 376 List<int> source_positions(kInitialCapacity); |
377 CollectPositions(*code, &code_positions, &source_positions); | 377 CollectPositions(*code, &code_positions, &source_positions); |
378 | 378 |
379 ASSERT(dictionary_.is_null()); // Only initialize once. | 379 ASSERT(dictionary_.is_null()); // Only initialize once. |
380 dictionary_ = isolate->factory()->NewNumberDictionary( | 380 dictionary_ = isolate->factory()->NewNumberDictionary( |
381 code_positions.length()); | 381 code_positions.length()); |
382 | 382 |
383 int length = code_positions.length(); | 383 int length = code_positions.length(); |
384 ASSERT(source_positions.length() == length); | 384 ASSERT(source_positions.length() == length); |
385 for (int i = 0; i < length; i++) { | 385 for (int i = 0; i < length; i++) { |
386 AssertNoAllocation no_allocation(); | 386 AssertNoAllocation no_allocation; |
387 RelocInfo info(code->instruction_start() + code_positions[i], | 387 RelocInfo info(code->instruction_start() + code_positions[i], |
388 RelocInfo::CODE_TARGET, 0); | 388 RelocInfo::CODE_TARGET, 0); |
389 Code* target = Code::GetCodeFromTargetAddress(info.target_address()); | 389 Code* target = Code::GetCodeFromTargetAddress(info.target_address()); |
390 int position = source_positions[i]; | 390 int position = source_positions[i]; |
391 InlineCacheState state = target->ic_state(); | 391 InlineCacheState state = target->ic_state(); |
392 Code::Kind kind = target->kind(); | 392 Code::Kind kind = target->kind(); |
393 | 393 |
394 if (kind == Code::BINARY_OP_IC || | 394 if (kind == Code::BINARY_OP_IC || |
395 kind == Code::TYPE_RECORDING_BINARY_OP_IC || | 395 kind == Code::TYPE_RECORDING_BINARY_OP_IC || |
396 kind == Code::COMPARE_IC) { | 396 kind == Code::COMPARE_IC) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 source_positions->Add(position); | 463 source_positions->Add(position); |
464 } | 464 } |
465 } else { | 465 } else { |
466 ASSERT(RelocInfo::IsPosition(mode)); | 466 ASSERT(RelocInfo::IsPosition(mode)); |
467 position = static_cast<int>(info->data()); | 467 position = static_cast<int>(info->data()); |
468 } | 468 } |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 } } // namespace v8::internal | 472 } } // namespace v8::internal |
OLD | NEW |