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

Unified Diff: src/objects-inl.h

Issue 24714004: Thumb2 Backend: Update Code objects with mode, separate Assembler methods for Thumb2 Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 89abe5043358c14642512f8d677104151b72a2d5..8a281901f9902af1c3251f0560da1fa3dd05e46d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1228,6 +1228,7 @@ void HeapObject::set_map_word(MapWord map_word) {
HeapObject* HeapObject::FromAddress(Address address) {
+ address = (Address)((uint32_t)address & ~1);
ASSERT_TAG_ALIGNED(address);
return reinterpret_cast<HeapObject*>(address + kHeapObjectTag);
}
@@ -3870,6 +3871,11 @@ void Code::set_is_pregenerated(bool value) {
}
+bool Code::is_thumb_mode() {
+ return IsThumbModeField::decode(flags());
+}
+
+
bool Code::optimizable() {
ASSERT_EQ(FUNCTION, kind());
return READ_BYTE_FIELD(this, kOptimizableOffset) == 1;
@@ -4082,12 +4088,18 @@ bool Code::is_debug_stub() {
}
+Code::Flags Code::SetThumbModeInFlags(Code::Flags flag) {
+ return static_cast<Flags>(flag | IsThumbModeField::encode(true));
+}
+
+
Code::Flags Code::ComputeFlags(Kind kind,
InlineCacheState ic_state,
ExtraICState extra_ic_state,
StubType type,
int argc,
- InlineCacheHolderFlag holder) {
+ InlineCacheHolderFlag holder,
+ bool thumb_mode) {
ASSERT(argc <= Code::kMaxArguments);
// Since the extended extra ic state overlaps with the argument count
// for CALL_ICs, do so checks to make sure that they don't interfere.
@@ -4099,7 +4111,8 @@ Code::Flags Code::ComputeFlags(Kind kind,
| ICStateField::encode(ic_state)
| TypeField::encode(type)
| ExtendedExtraICStateField::encode(extra_ic_state)
- | CacheHolderField::encode(holder);
+ | CacheHolderField::encode(holder)
+ | IsThumbModeField::encode(thumb_mode);
if (!Code::needs_extended_extra_ic_state(kind)) {
bits |= (argc << kArgumentsCountShift);
}
@@ -4159,6 +4172,7 @@ Code::Flags Code::RemoveTypeFromFlags(Flags flags) {
Code* Code::GetCodeFromTargetAddress(Address address) {
+ address = (Address)((uint32_t)address & ~3);
HeapObject* code = HeapObject::FromAddress(address - Code::kHeaderSize);
// GetCodeFromTargetAddress might be called when marking objects during mark
// sweep. reinterpret_cast is therefore used instead of the more appropriate
@@ -4171,7 +4185,9 @@ Code* Code::GetCodeFromTargetAddress(Address address) {
Object* Code::GetObjectFromEntryAddress(Address location_of_address) {
return HeapObject::
- FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
+ FromAddress(
+ Memory::Address_at((Address)((uint32_t)location_of_address & ~1))
+ - Code::kHeaderSize);
}
@@ -5351,7 +5367,8 @@ int Code::relocation_size() {
byte* Code::entry() {
- return instruction_start();
+ int mode_encoding = is_thumb_mode() ? 1 : 0;
+ return mode_encoding + instruction_start();
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698