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

Side by Side Diff: src/heap.cc

Issue 19785004: Move FindCodeObject from Heap to Isolate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/heap.h ('k') | src/ic.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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1104
1105 FlushNumberStringCache(); 1105 FlushNumberStringCache();
1106 if (FLAG_cleanup_code_caches_at_gc) { 1106 if (FLAG_cleanup_code_caches_at_gc) {
1107 polymorphic_code_cache()->set_cache(undefined_value()); 1107 polymorphic_code_cache()->set_cache(undefined_value());
1108 } 1108 }
1109 1109
1110 ClearNormalizedMapCaches(); 1110 ClearNormalizedMapCaches();
1111 } 1111 }
1112 1112
1113 1113
1114 Object* Heap::FindCodeObject(Address a) {
1115 return isolate()->inner_pointer_to_code_cache()->
1116 GcSafeFindCodeForInnerPointer(a);
1117 }
1118
1119
1120 // Helper class for copying HeapObjects 1114 // Helper class for copying HeapObjects
1121 class ScavengeVisitor: public ObjectVisitor { 1115 class ScavengeVisitor: public ObjectVisitor {
1122 public: 1116 public:
1123 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {} 1117 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {}
1124 1118
1125 void VisitPointer(Object** p) { ScavengePointer(p); } 1119 void VisitPointer(Object** p) { ScavengePointer(p); }
1126 1120
1127 void VisitPointers(Object** start, Object** end) { 1121 void VisitPointers(Object** start, Object** end) {
1128 // Copy all HeapObject pointers in [start, end) 1122 // Copy all HeapObject pointers in [start, end)
1129 for (Object** p = start; p < end; p++) ScavengePointer(p); 1123 for (Object** p = start; p < end; p++) ScavengePointer(p);
(...skipping 7045 matching lines...) Expand 10 before | Expand all | Expand 10 after
8175 if (FLAG_parallel_recompilation) { 8169 if (FLAG_parallel_recompilation) {
8176 heap_->relocation_mutex_->Lock(); 8170 heap_->relocation_mutex_->Lock();
8177 #ifdef DEBUG 8171 #ifdef DEBUG
8178 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8172 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8179 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8173 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8180 #endif // DEBUG 8174 #endif // DEBUG
8181 } 8175 }
8182 } 8176 }
8183 8177
8184 } } // namespace v8::internal 8178 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698