rethrow_(false),
has_terminated_(false) {
Reset();
- js_stack_comparable_address_ = this;
-#ifdef V8_USE_ADDRESS_SANITIZER
- void* asan_fake_stack_handle = __asan_get_current_fake_stack();
- if (asan_fake_stack_handle != NULL) {
- js_stack_comparable_address_ = __asan_addr_is_in_fake_stack(
- asan_fake_stack_handle, js_stack_comparable_address_, NULL, NULL);
- CHECK(js_stack_comparable_address_ != NULL);
- }
-#endif
// Special handling for simulators which have a separate JS stack.
- js_stack_comparable_address_ = reinterpret_cast<void*>(
- v8::internal::SimulatorStack::RegisterCTryCatch(
- reinterpret_cast<uintptr_t>(js_stack_comparable_address_)));
+ js_stack_comparable_address_ =
+ reinterpret_cast<void*>(v8::internal::SimulatorStack::RegisterCTryCatch(
+ GetCurrentStackPosition()));
isolate_->RegisterTryCatchHandler(this);
}
};
// Parser/Scanner needs a stack limit.
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
uintptr_t stack_limit = CcTest::i_isolate()->stack_guard()->real_climit();
for (int i = 0; tests[i]; i++) {
const i::byte* source =
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
// Source containing functions that might be lazily compiled and all types
// of symbols (string, propertyName, regexp).
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
const char* good_code =
"function this_is_lazy() { var a; } function foo() { return 25; } foo();";
TEST(StandAlonePreParser) {
v8::V8::Initialize();
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
const char* programs[] = {
"{label: 42}",
TEST(StandAlonePreParserNoNatives) {
v8::V8::Initialize();
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
const char* programs[] = {
"%ArgleBargle(glop);",
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
{
const char* source = "var myo = {if: \"foo\"}; myo.if;";
v8::V8::Initialize();
i::Isolate* isolate = CcTest::i_isolate();
- int marker;
- isolate->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ isolate->stack_guard()->SetStackLimit(GetCurrentStackPosition() - 128 * 1024);
const char* program = "var x = 'something';\n"
"escape: function() {}";
// as with-content, which made it assume that a function inside
// the block could be lazily compiled, and an extra, unexpected,
// entry was added to the data.
- int marker;
- isolate->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ isolate->stack_guard()->SetStackLimit(GetCurrentStackPosition() - 128 * 1024);
const char* program =
"try { } catch (e) { var foo = function () { /* first */ } }"
TEST(PreParseOverflow) {
v8::V8::Initialize();
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
size_t kProgramSize = 1024 * 1024;
i::SmartArrayPointer<char> program(i::NewArray<char>(kProgramSize + 1));
v8::Handle<v8::Context> context = v8::Context::New(CcTest::isolate());
v8::Context::Scope context_scope(context);
- int marker;
- isolate->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ isolate->stack_guard()->SetStackLimit(GetCurrentStackPosition() - 128 * 1024);
for (int i = 0; source_data[i].outer_prefix; i++) {
int kPrefixLen = Utf8LengthHelper(source_data[i].outer_prefix);
v8::Handle<v8::Context> context = v8::Context::New(CcTest::isolate());
v8::Context::Scope context_scope(context);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
static const ParserFlag flags1[] = {
kAllowLazy, kAllowHarmonyScoping, kAllowModules, kAllowGenerators,
v8::Handle<v8::Context> context = v8::Context::New(CcTest::isolate());
v8::Context::Scope context_scope(context);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
static const ParserFlag default_flags[] = {
kAllowLazy, kAllowHarmonyScoping, kAllowModules, kAllowGenerators,
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handles(isolate);
- int marker;
- CcTest::i_isolate()->stack_guard()->SetStackLimit(
- reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+ CcTest::i_isolate()->stack_guard()->SetStackLimit(GetCurrentStackPosition() -
+ 128 * 1024);
struct TestCase {
const char* program;