Revision: 24283
Author: [email protected]
Date: Mon Sep 29 12:17:31 2014 UTC
Log: Add a getter for the address and size of the code range to the
pulic API
Since the x64 backend currently doesn't emit ABI compliant code, it is
not possible to unwind the stack. During Win64 SEH this will cause the
exception handling to abort, and not even call the unhandled exception
handler. Embedders are advised to install a custom unwind callback using
RtlInstallFunctionTableCallback for the entire code range to catch
unwind attempts for exception handling.
BUG=v8:3598
[email protected]
LOG=y
Review URL: https://codereview.chromium.org/612043002
https://code.google.com/p/v8/source/detail?r=24283
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/heap/spaces.h
=======================================
--- /branches/bleeding_edge/include/v8.h Mon Sep 29 10:22:56 2014 UTC
+++ /branches/bleeding_edge/include/v8.h Mon Sep 29 12:17:31 2014 UTC
@@ -4847,6 +4847,18 @@
*/
void SetStackLimit(uintptr_t stack_limit);
+ /**
+ * Returns a memory range that can potentially contain jitted code.
+ *
+ * On Win64, embedders are advised to install function table callbacks
for
+ * these ranges, as default SEH won't be able to unwind through jitted
code.
+ *
+ * Might be empty on other platforms.
+ *
+ * https://code.google.com/p/v8/issues/detail?id=3598
+ */
+ void GetCodeRange(void** start, size_t* length_in_bytes);
+
private:
template<class K, class V, class Traits> friend class PersistentValueMap;
=======================================
--- /branches/bleeding_edge/src/api.cc Mon Sep 29 10:22:56 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Mon Sep 29 12:17:31 2014 UTC
@@ -6824,6 +6824,18 @@
CHECK(stack_limit);
isolate->stack_guard()->SetStackLimit(stack_limit);
}
+
+
+void v8::Isolate::GetCodeRange(void** start, size_t* length_in_bytes) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ if (isolate->code_range()->valid()) {
+ *start = isolate->code_range()->start();
+ *length_in_bytes = isolate->code_range()->size();
+ } else {
+ *start = NULL;
+ *length_in_bytes = 0;
+ }
+}
String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
=======================================
--- /branches/bleeding_edge/src/heap/spaces.h Thu Sep 25 07:32:13 2014 UTC
+++ /branches/bleeding_edge/src/heap/spaces.h Mon Sep 29 12:17:31 2014 UTC
@@ -880,6 +880,10 @@
DCHECK(valid());
return static_cast<Address>(code_range_->address());
}
+ size_t size() {
+ DCHECK(valid());
+ return code_range_->size();
+ }
bool contains(Address address) {
if (!valid()) return false;
Address start = static_cast<Address>(code_range_->address());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.