Revision: 8676
Author: [email protected]
Date: Mon Jul 18 07:46:35 2011
Log: Encapsulated the AST ID recording a bit, this time for MIPS.
Review URL: http://codereview.chromium.org/7400019
http://code.google.com/p/v8/source/detail?r=8676
Modified:
/branches/bleeding_edge/src/mips/assembler-mips.cc
/branches/bleeding_edge/src/mips/assembler-mips.h
/branches/bleeding_edge/src/mips/macro-assembler-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.cc Tue Jun 28 00:31:42
2011
+++ /branches/bleeding_edge/src/mips/assembler-mips.cc Mon Jul 18 07:46:35
2011
@@ -285,7 +285,7 @@
unbound_labels_count_ = 0;
block_buffer_growth_ = false;
- ast_id_for_reloc_info_ = kNoASTId;
+ ClearRecordedAstId();
}
@@ -1947,9 +1947,8 @@
}
ASSERT(buffer_space() >= kMaxRelocSize); // Too late to grow buffer
here.
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
- ASSERT(ast_id_for_reloc_info_ != kNoASTId);
- RelocInfo reloc_info_with_ast_id(pc_, rmode, ast_id_for_reloc_info_);
- ast_id_for_reloc_info_ = kNoASTId;
+ RelocInfo reloc_info_with_ast_id(pc_, rmode, RecordedAstId());
+ ClearRecordedAstId();
reloc_info_writer.Write(&reloc_info_with_ast_id);
} else {
reloc_info_writer.Write(&rinfo);
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Sun Jul 10 23:45:27
2011
+++ /branches/bleeding_edge/src/mips/assembler-mips.h Mon Jul 18 07:46:35
2011
@@ -833,7 +833,17 @@
// Record the AST id of the CallIC being compiled, so that it can be
placed
// in the relocation information.
- void RecordAstId(unsigned ast_id) { ast_id_for_reloc_info_ = ast_id; }
+ void SetRecordedAstId(unsigned ast_id) {
+ ASSERT(recorded_ast_id_ == kNoASTId);
+ recorded_ast_id_ = ast_id;
+ }
+
+ unsigned RecordedAstId() {
+ ASSERT(recorded_ast_id_ != kNoASTId);
+ return recorded_ast_id_;
+ }
+
+ void ClearRecordedAstId() { recorded_ast_id_ = kNoASTId; }
// Record a comment relocation entry that can be used by a disassembler.
// Use --code-comments to enable.
@@ -926,7 +936,7 @@
// Relocation for a type-recording IC has the AST id added to it. This
// member variable is a way to pass the information from the call site to
// the relocation info.
- unsigned ast_id_for_reloc_info_;
+ unsigned recorded_ast_id_;
bool emit_debug_code() const { return emit_debug_code_; }
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Sun Jul 10
23:45:27 2011
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Mon Jul 18
07:46:35 2011
@@ -2080,8 +2080,7 @@
bind(&start);
ASSERT(RelocInfo::IsCodeTarget(rmode));
if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) {
- ASSERT(ast_id_for_reloc_info_ == kNoASTId);
- ast_id_for_reloc_info_ = ast_id;
+ SetRecordedAstId(ast_id);
rmode = RelocInfo::CODE_TARGET_WITH_ID;
}
Call(reinterpret_cast<Address>(code.location()), rmode, cond, rs, rt,
bd);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev