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

Unified Diff: src/regexp/regexp-macro-assembler.cc

Issue 1108013003: Introduce --zap-cpp-pointers (off by default) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes Created 3 years, 7 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/property-descriptor.cc ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-macro-assembler.cc
diff --git a/src/regexp/regexp-macro-assembler.cc b/src/regexp/regexp-macro-assembler.cc
index 681acc13255fb42ffa735471b126ab2fb8d34c1a..63de1726fe5573d5fa1b29f2d3a505bfbb432952 100644
--- a/src/regexp/regexp-macro-assembler.cc
+++ b/src/regexp/regexp-macro-assembler.cc
@@ -165,9 +165,12 @@ int NativeRegExpMacroAssembler::CheckStackGuardState(
int return_value = 0;
// Prepare for possible GC.
HandleScope handles(isolate);
+ intptr_t return_address_offset =
+ *return_address - re_code->instruction_start();
Handle<Code> code_handle(re_code);
Handle<String> subject_handle(*subject);
bool is_one_byte = subject_handle->IsOneByteRepresentationUnderneath();
+ intptr_t byte_length = *input_end - *input_start;
StackLimitCheck check(isolate);
bool js_has_overflowed = check.JsHasOverflowed();
@@ -189,11 +192,8 @@ int NativeRegExpMacroAssembler::CheckStackGuardState(
DisallowHeapAllocation no_gc;
- if (*code_handle != re_code) { // Return address no longer valid
- intptr_t delta = code_handle->address() - re_code->address();
- // Overwrite the return address on the stack.
- *return_address += delta;
- }
+ // Fix up the return address (it might be no longer valid after GC).
+ *return_address = code_handle->instruction_start() + return_address_offset;
// If we continue, we need to update the subject string addresses.
if (return_value == 0) {
@@ -205,7 +205,6 @@ int NativeRegExpMacroAssembler::CheckStackGuardState(
return_value = RETRY;
} else {
*subject = *subject_handle;
- intptr_t byte_length = *input_end - *input_start;
*input_start = StringCharacterPosition(*subject, start_index);
*input_end = *input_start + byte_length;
}
« no previous file with comments | « src/property-descriptor.cc ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698