Revision: 8671
Author: [email protected]
Date: Mon Jul 18 03:44:13 2011
Log: Fixed confusion between AST IDs and condition codes on ARM.
C++'s 'great' idea of implicitly converting an enum to an integral value
hit us
again, this time resulting in silly (but currently non-harmful) entries in
the
relocation table. Encapsulated the AST ID recording a bit, which helped a
lot to
find the culprit.
Review URL: http://codereview.chromium.org/7400016
http://code.google.com/p/v8/source/detail?r=8671
Modified:
/branches/bleeding_edge/src/arm/assembler-arm.cc
/branches/bleeding_edge/src/arm/assembler-arm.h
/branches/bleeding_edge/src/arm/macro-assembler-arm.cc
=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.cc Thu Jun 16 00:00:46
2011
+++ /branches/bleeding_edge/src/arm/assembler-arm.cc Mon Jul 18 03:44:13
2011
@@ -326,7 +326,7 @@
no_const_pool_before_ = 0;
first_const_pool_use_ = -1;
last_bound_pos_ = 0;
- ast_id_for_reloc_info_ = kNoASTId;
+ ClearRecordedAstId();
}
@@ -2537,9 +2537,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/arm/assembler-arm.h Thu Jun 30 04:26:15 2011
+++ /branches/bleeding_edge/src/arm/assembler-arm.h Mon Jul 18 03:44:13 2011
@@ -1178,7 +1178,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.
@@ -1244,7 +1254,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/arm/macro-assembler-arm.cc Wed Jul 13
06:50:27 2011
+++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Jul 18
03:44:13 2011
@@ -192,13 +192,13 @@
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;
}
// 'code' is always generated ARM code, never THUMB code
Call(reinterpret_cast<Address>(code.location()), rmode, cond);
- ASSERT_EQ(CallSize(code, rmode, cond), SizeOfCodeGeneratedSince(&start));
+ ASSERT_EQ(CallSize(code, rmode, ast_id, cond),
+ SizeOfCodeGeneratedSince(&start));
}
@@ -1862,7 +1862,7 @@
void MacroAssembler::CallStub(CodeStub* stub, Condition cond) {
ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
- Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
+ Call(stub->GetCode(), RelocInfo::CODE_TARGET, kNoASTId, cond);
}
@@ -1872,7 +1872,8 @@
{ MaybeObject* maybe_result = stub->TryGetCode();
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- Call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET, cond);
+ Handle<Code> code(Code::cast(result));
+ Call(code, RelocInfo::CODE_TARGET, kNoASTId, cond);
return result;
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev