Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: src/serialize.cc

Issue 10795074: Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Amend docs per Mikhail's comment. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 Object** limit = current + (size >> kPointerSizeLog2); 739 Object** limit = current + (size >> kPointerSizeLog2);
740 if (FLAG_log_snapshot_positions) { 740 if (FLAG_log_snapshot_positions) {
741 LOG(isolate_, SnapshotPositionEvent(address, source_->position())); 741 LOG(isolate_, SnapshotPositionEvent(address, source_->position()));
742 } 742 }
743 ReadChunk(current, limit, space_number, address); 743 ReadChunk(current, limit, space_number, address);
744 #ifdef DEBUG 744 #ifdef DEBUG
745 bool is_codespace = (space == HEAP->code_space()) || 745 bool is_codespace = (space == HEAP->code_space()) ||
746 ((space == HEAP->lo_space()) && (space_number == kLargeCode)); 746 ((space == HEAP->lo_space()) && (space_number == kLargeCode));
747 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace); 747 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace);
748 #endif 748 #endif
749 if (HeapObject::FromAddress(address)->IsCode()) {
danno 2012/08/02 11:22:36 The deserializer is very performance sensitive, by
750 Code* code = Code::cast(HeapObject::FromAddress(address));
751
752 JIT_CODE_EVENT(AddCode(code));
753 }
749 } 754 }
750 755
751 756
752 // This macro is always used with a constant argument so it should all fold 757 // This macro is always used with a constant argument so it should all fold
753 // away to almost nothing in the generated code. It might be nicer to do this 758 // away to almost nothing in the generated code. It might be nicer to do this
754 // with the ternary operator but there are type issues with that. 759 // with the ternary operator but there are type issues with that.
755 #define ASSIGN_DEST_SPACE(space_number) \ 760 #define ASSIGN_DEST_SPACE(space_number) \
756 Space* dest_space; \ 761 Space* dest_space; \
757 if (space_number == NEW_SPACE) { \ 762 if (space_number == NEW_SPACE) { \
758 dest_space = isolate->heap()->new_space(); \ 763 dest_space = isolate->heap()->new_space(); \
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 int Serializer::SpaceAreaSize(int space) { 1687 int Serializer::SpaceAreaSize(int space) {
1683 if (space == CODE_SPACE) { 1688 if (space == CODE_SPACE) {
1684 return isolate_->memory_allocator()->CodePageAreaSize(); 1689 return isolate_->memory_allocator()->CodePageAreaSize();
1685 } else { 1690 } else {
1686 return Page::kPageSize - Page::kObjectStartOffset; 1691 return Page::kPageSize - Page::kObjectStartOffset;
1687 } 1692 }
1688 } 1693 }
1689 1694
1690 1695
1691 } } // namespace v8::internal 1696 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698