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

Unified Diff: src/profile-generator.h

Issue 700963002: Replace C++ bitfields with our own BitFields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed AST node field sizes; more scanner fixes; undid hydrogen.h/cc changes Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.h
diff --git a/src/profile-generator.h b/src/profile-generator.h
index 5ebb92bba3b0ed6ed87b02e2dbe6f02280c30a9f..f78beb041b068ea6d661b03bca14c532d5737a51 100644
--- a/src/profile-generator.h
+++ b/src/profile-generator.h
@@ -55,7 +55,7 @@ class CodeEntry {
int column_number = v8::CpuProfileNode::kNoColumnNumberInfo);
~CodeEntry();
- bool is_js_function() const { return is_js_function_tag(tag_); }
+ bool is_js_function() const { return is_js_function_tag(tag()); }
const char* name_prefix() const { return name_prefix_; }
bool has_name_prefix() const { return name_prefix_[0] != '\0'; }
const char* name() const { return name_; }
@@ -78,7 +78,9 @@ class CodeEntry {
}
void SetBuiltinId(Builtins::Name id);
- Builtins::Name builtin_id() const { return builtin_id_; }
+ Builtins::Name builtin_id() const {
+ return BuiltinIdField::decode(bit_field_);
+ }
uint32_t GetCallUid() const;
bool IsSameAs(CodeEntry* entry) const;
@@ -88,8 +90,11 @@ class CodeEntry {
static const char* const kEmptyBailoutReason;
private:
- Logger::LogEventsAndTags tag_ : 8;
- Builtins::Name builtin_id_ : 8;
+ class TagField : public BitField<Logger::LogEventsAndTags, 0, 8> {};
+ class BuiltinIdField : public BitField<Builtins::Name, 8, 8> {};
+ Logger::LogEventsAndTags tag() const { return TagField::decode(bit_field_); }
+
+ uint32_t bit_field_;
const char* name_prefix_;
const char* name_;
const char* resource_name_;
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698