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

Side by Side Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 3357023: [Isolates] Pass current isolate address to the regexp native functions (Closed)
Patch Set: Made helper function private(ARM) Created 10 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 unified diff | Download patch
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | src/x64/simulator-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 * - r8 : code object pointer. Used to convert between absolute and 61 * - r8 : code object pointer. Used to convert between absolute and
62 * code-object-relative addresses. 62 * code-object-relative addresses.
63 * 63 *
64 * The registers rax, rbx, r9 and r11 are free to use for computations. 64 * The registers rax, rbx, r9 and r11 are free to use for computations.
65 * If changed to use r12+, they should be saved as callee-save registers. 65 * If changed to use r12+, they should be saved as callee-save registers.
66 * 66 *
67 * Each call to a C++ method should retain these registers. 67 * Each call to a C++ method should retain these registers.
68 * 68 *
69 * The stack will have the following content, in some order, indexable from the 69 * The stack will have the following content, in some order, indexable from the
70 * frame pointer (see, e.g., kStackHighEnd): 70 * frame pointer (see, e.g., kStackHighEnd):
71 * - Isolate* isolate (Address of the current isolate)
71 * - direct_call (if 1, direct call from JavaScript code, if 0 call 72 * - direct_call (if 1, direct call from JavaScript code, if 0 call
72 * through the runtime system) 73 * through the runtime system)
73 * - stack_area_base (High end of the memory area to use as 74 * - stack_area_base (High end of the memory area to use as
74 * backtracking stack) 75 * backtracking stack)
75 * - int* capture_array (int[num_saved_registers_], for output). 76 * - int* capture_array (int[num_saved_registers_], for output).
76 * - end of input (Address of end of string) 77 * - end of input (Address of end of string)
77 * - start of input (Address of first character in string) 78 * - start of input (Address of first character in string)
78 * - start index (character index of start) 79 * - start index (character index of start)
79 * - String* input_string (input string) 80 * - String* input_string (input string)
80 * - return address 81 * - return address
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 // Helper function for reading a value out of a stack frame. 1125 // Helper function for reading a value out of a stack frame.
1125 template <typename T> 1126 template <typename T>
1126 static T& frame_entry(Address re_frame, int frame_offset) { 1127 static T& frame_entry(Address re_frame, int frame_offset) {
1127 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset)); 1128 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset));
1128 } 1129 }
1129 1130
1130 1131
1131 int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address, 1132 int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
1132 Code* re_code, 1133 Code* re_code,
1133 Address re_frame) { 1134 Address re_frame) {
1134 if (Isolate::Current()->stack_guard()->IsStackOverflow()) { 1135 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
1135 Isolate::Current()->StackOverflow(); 1136 ASSERT(isolate == Isolate::Current());
1137 if (isolate->stack_guard()->IsStackOverflow()) {
1138 isolate->StackOverflow();
1136 return EXCEPTION; 1139 return EXCEPTION;
1137 } 1140 }
1138 1141
1139 // If not real stack overflow the stack guard was used to interrupt 1142 // If not real stack overflow the stack guard was used to interrupt
1140 // execution for another purpose. 1143 // execution for another purpose.
1141 1144
1142 // If this is a direct call from JavaScript retry the RegExp forcing the call 1145 // If this is a direct call from JavaScript retry the RegExp forcing the call
1143 // through the runtime system. Currently the direct call cannot handle a GC. 1146 // through the runtime system. Currently the direct call cannot handle a GC.
1144 if (frame_entry<int>(re_frame, kDirectCall) == 1) { 1147 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1145 return RETRY; 1148 return RETRY;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 } 1366 }
1364 } 1367 }
1365 1368
1366 #undef __ 1369 #undef __
1367 1370
1368 #endif // V8_INTERPRETED_REGEXP 1371 #endif // V8_INTERPRETED_REGEXP
1369 1372
1370 }} // namespace v8::internal 1373 }} // namespace v8::internal
1371 1374
1372 #endif // V8_TARGET_ARCH_X64 1375 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | src/x64/simulator-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698