Revision: 7872
Author: [email protected]
Date: Thu May 12 06:13:00 2011
Log: Make the code flushing candidate field explicit in code objects.
This way it is counted and the rounding of the size will just work
without extra tweaking if you want to add an extra field to code
objects.
[email protected]
BUG=
TEST=
Review URL: http://codereview.chromium.org/6969037
http://code.google.com/p/v8/source/detail?r=7872
Modified:
/branches/bleeding_edge/src/heap.cc
/branches/bleeding_edge/src/mark-compact.cc
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects.h
=======================================
--- /branches/bleeding_edge/src/heap.cc Tue May 3 01:23:58 2011
+++ /branches/bleeding_edge/src/heap.cc Thu May 12 06:13:00 2011
@@ -2799,6 +2799,7 @@
code->set_check_type(RECEIVER_MAP_CHECK);
}
code->set_deoptimization_data(empty_fixed_array());
+ code->set_next_code_flushing_candidate(undefined_value());
// Allow self references to created code object by patching the handle to
// point to the newly allocated Code object.
if (!self_reference.is_null()) {
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Tue Apr 26 02:44:55 2011
+++ /branches/bleeding_edge/src/mark-compact.cc Thu May 12 06:13:00 2011
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -304,14 +304,12 @@
JSFunction* next_candidate) {
*GetNextCandidateField(candidate) = next_candidate;
}
-
- STATIC_ASSERT(kPointerSize <= Code::kHeaderSize -
Code::kHeaderPaddingStart);
static SharedFunctionInfo** GetNextCandidateField(
SharedFunctionInfo* candidate) {
Code* code = candidate->unchecked_code();
return reinterpret_cast<SharedFunctionInfo**>(
- code->address() + Code::kHeaderPaddingStart);
+ code->address() + Code::kNextCodeFlushingCandidateOffset);
}
static SharedFunctionInfo* GetNextCandidate(SharedFunctionInfo*
candidate) {
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Wed May 11 01:53:46 2011
+++ /branches/bleeding_edge/src/objects-inl.h Thu May 12 06:13:00 2011
@@ -3548,6 +3548,8 @@
INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
+ACCESSORS(Code, next_code_flushing_candidate,
+ Object, kNextCodeFlushingCandidateOffset)
byte* Code::instruction_start() {
=======================================
--- /branches/bleeding_edge/src/objects.h Tue May 10 07:17:23 2011
+++ /branches/bleeding_edge/src/objects.h Thu May 12 06:13:00 2011
@@ -3317,6 +3317,12 @@
// [deoptimization_data]: Array containing data for deopt.
DECL_ACCESSORS(deoptimization_data, FixedArray)
+ // [code_flushing_candidate]: Field only used during garbage
+ // collection to hold code flushing candidates. The contents of this
+ // field does not have to be traced during garbage collection since
+ // it is only used by the garbage collector itself.
+ DECL_ACCESSORS(next_code_flushing_candidate, Object)
+
// Unchecked accessors to be used during GC.
inline ByteArray* unchecked_relocation_info();
inline FixedArray* unchecked_deoptimization_data();
@@ -3537,9 +3543,12 @@
static const int kRelocationInfoOffset = kInstructionSizeOffset +
kIntSize;
static const int kDeoptimizationDataOffset =
kRelocationInfoOffset + kPointerSize;
- static const int kFlagsOffset = kDeoptimizationDataOffset + kPointerSize;
- static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize;
-
+ static const int kNextCodeFlushingCandidateOffset =
+ kDeoptimizationDataOffset + kPointerSize;
+ static const int kFlagsOffset =
+ kNextCodeFlushingCandidateOffset + kPointerSize;
+
+ static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize;
static const int kKindSpecificFlagsSize = 2 * kIntSize;
static const int kHeaderPaddingStart = kKindSpecificFlagsOffset +
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev