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

Side by Side Diff: src/objects-inl.h

Issue 2526243002: [GC] Fix code flushing to use bytecode if it exists. (Closed)
Patch Set: Fix cctests Created 4 years 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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/heap/test-heap.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 6226 matching lines...) Expand 10 before | Expand all | Expand 10 after
6237 } 6237 }
6238 6238
6239 6239
6240 Code* SharedFunctionInfo::code() const { 6240 Code* SharedFunctionInfo::code() const {
6241 return Code::cast(READ_FIELD(this, kCodeOffset)); 6241 return Code::cast(READ_FIELD(this, kCodeOffset));
6242 } 6242 }
6243 6243
6244 6244
6245 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { 6245 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) {
6246 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION); 6246 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION);
6247 // If the SharedFunctionInfo has bytecode we should never mark it for lazy
6248 // compile, since the bytecode is never flushed.
6249 DCHECK(value != GetIsolate()->builtins()->builtin(Builtins::kCompileLazy) ||
6250 !HasBytecodeArray());
6247 WRITE_FIELD(this, kCodeOffset, value); 6251 WRITE_FIELD(this, kCodeOffset, value);
6248 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode); 6252 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode);
6249 } 6253 }
6250 6254
6251 6255
6252 void SharedFunctionInfo::ReplaceCode(Code* value) { 6256 void SharedFunctionInfo::ReplaceCode(Code* value) {
6253 // If the GC metadata field is already used then the function was 6257 // If the GC metadata field is already used then the function was
6254 // enqueued as a code flushing candidate and we remove it now. 6258 // enqueued as a code flushing candidate and we remove it now.
6255 if (code()->gc_metadata() != NULL) { 6259 if (code()->gc_metadata() != NULL) {
6256 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); 6260 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher();
(...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after
8441 #undef WRITE_INT64_FIELD 8445 #undef WRITE_INT64_FIELD
8442 #undef READ_BYTE_FIELD 8446 #undef READ_BYTE_FIELD
8443 #undef WRITE_BYTE_FIELD 8447 #undef WRITE_BYTE_FIELD
8444 #undef NOBARRIER_READ_BYTE_FIELD 8448 #undef NOBARRIER_READ_BYTE_FIELD
8445 #undef NOBARRIER_WRITE_BYTE_FIELD 8449 #undef NOBARRIER_WRITE_BYTE_FIELD
8446 8450
8447 } // namespace internal 8451 } // namespace internal
8448 } // namespace v8 8452 } // namespace v8
8449 8453
8450 #endif // V8_OBJECTS_INL_H_ 8454 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698