Fixed exception reporting bug where certain exceptions were incorrectly reported as uncaught.
Improved the memory allocation strategy used during compilation to make running out of memory when compiling huge scripts less likely.
Optimized String.replace by avoiding the construction of certain sub strings.
Fixed bug in code generation for large switch statements on ARM.
Fixed bug that caused V8 to change the global object template passed in by the user.
Changed the API for creating object groups used during garbage collection. Entire object groups are now passed to V8 instead of individual members of the groups.
git-svn-id: http://v8.googlecode.com/svn/trunk@968 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index e8c4e91..5c70463 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1877,6 +1877,17 @@
}
+Code* Code::GetCodeFromTargetAddress(Address address) {
+ 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
+ // Code::cast. Code::cast does not work when the object's map is
+ // marked.
+ Code* result = reinterpret_cast<Code*>(code);
+ return result;
+}
+
+
Object* Map::prototype() {
return READ_FIELD(this, kPrototypeOffset);
}