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

Side by Side Diff: src/objects.h

Issue 39179: Adding support for reporting addresses of JIT compiled code to OProfile (Closed)
Patch Set: Fixes according to Kasper's comments Created 11 years, 9 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
« no previous file with comments | « src/log.cc ('k') | src/oprofile-agent.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 void CopyFrom(const CodeDesc& desc); 2251 void CopyFrom(const CodeDesc& desc);
2252 2252
2253 // Returns the object size for a given body and sinfo size (Used for 2253 // Returns the object size for a given body and sinfo size (Used for
2254 // allocation). 2254 // allocation).
2255 static int SizeFor(int body_size, int sinfo_size) { 2255 static int SizeFor(int body_size, int sinfo_size) {
2256 ASSERT_SIZE_TAG_ALIGNED(body_size); 2256 ASSERT_SIZE_TAG_ALIGNED(body_size);
2257 ASSERT_SIZE_TAG_ALIGNED(sinfo_size); 2257 ASSERT_SIZE_TAG_ALIGNED(sinfo_size);
2258 return RoundUp(kHeaderSize + body_size + sinfo_size, kCodeAlignment); 2258 return RoundUp(kHeaderSize + body_size + sinfo_size, kCodeAlignment);
2259 } 2259 }
2260 2260
2261 // Calculate the size of the code object to report for log events. This takes
2262 // the layout of the code object into account.
2263 int ExecutableSize() {
2264 // Check that the assumptions about the layout of the code object holds.
2265 ASSERT_EQ(reinterpret_cast<unsigned int>(instruction_start()) -
2266 reinterpret_cast<unsigned int>(address()),
2267 Code::kHeaderSize);
2268 return instruction_size() + Code::kHeaderSize;
2269 }
2270
2261 // Locating source position. 2271 // Locating source position.
2262 int SourcePosition(Address pc); 2272 int SourcePosition(Address pc);
2263 int SourceStatementPosition(Address pc); 2273 int SourceStatementPosition(Address pc);
2264 2274
2265 // Casting. 2275 // Casting.
2266 static inline Code* cast(Object* obj); 2276 static inline Code* cast(Object* obj);
2267 2277
2268 // Dispatched behavior. 2278 // Dispatched behavior.
2269 int CodeSize() { return SizeFor(body_size(), sinfo_size()); } 2279 int CodeSize() { return SizeFor(body_size(), sinfo_size()); }
2270 void CodeIterateBody(ObjectVisitor* v); 2280 void CodeIterateBody(ObjectVisitor* v);
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
4279 } else { 4289 } else {
4280 value &= ~(1 << bit_position); 4290 value &= ~(1 << bit_position);
4281 } 4291 }
4282 return value; 4292 return value;
4283 } 4293 }
4284 }; 4294 };
4285 4295
4286 } } // namespace v8::internal 4296 } } // namespace v8::internal
4287 4297
4288 #endif // V8_OBJECTS_H_ 4298 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/oprofile-agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698