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

Side by Side Diff: src/arm/regexp-macro-assembler-arm.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/arm/regexp-macro-assembler-arm.h ('k') | src/arm/simulator-arm.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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 * - r10 : End of input (points to byte after last character in input). 53 * - r10 : End of input (points to byte after last character in input).
54 * - r11 : Frame pointer. Used to access arguments, local variables and 54 * - r11 : Frame pointer. Used to access arguments, local variables and
55 * RegExp registers. 55 * RegExp registers.
56 * - r12 : IP register, used by assembler. Very volatile. 56 * - r12 : IP register, used by assembler. Very volatile.
57 * - r13/sp : points to tip of C stack. 57 * - r13/sp : points to tip of C stack.
58 * 58 *
59 * The remaining registers are free for computations. 59 * The remaining registers are free for computations.
60 * 60 *
61 * Each call to a public method should retain this convention. 61 * Each call to a public method should retain this convention.
62 * The stack will have the following structure: 62 * The stack will have the following structure:
63 * - Isolate* isolate (Address of the current isolate)
63 * - direct_call (if 1, direct call from JavaScript code, if 0 call 64 * - direct_call (if 1, direct call from JavaScript code, if 0 call
64 * through the runtime system) 65 * through the runtime system)
65 * - stack_area_base (High end of the memory area to use as 66 * - stack_area_base (High end of the memory area to use as
66 * backtracking stack) 67 * backtracking stack)
67 * - int* capture_array (int[num_saved_registers_], for output). 68 * - int* capture_array (int[num_saved_registers_], for output).
68 * --- sp when called --- 69 * --- sp when called ---
69 * - link address 70 * - link address
70 * - backup of registers r4..r11 71 * - backup of registers r4..r11
71 * - end of input (Address of end of string) 72 * - end of input (Address of end of string)
72 * - start of input (Address of first character in string) 73 * - start of input (Address of first character in string)
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 // Helper function for reading a value out of a stack frame. 986 // Helper function for reading a value out of a stack frame.
986 template <typename T> 987 template <typename T>
987 static T& frame_entry(Address re_frame, int frame_offset) { 988 static T& frame_entry(Address re_frame, int frame_offset) {
988 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset)); 989 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset));
989 } 990 }
990 991
991 992
992 int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address, 993 int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address,
993 Code* re_code, 994 Code* re_code,
994 Address re_frame) { 995 Address re_frame) {
995 if (Isolate::Current()->stack_guard()->IsStackOverflow()) { 996 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
996 Isolate::Current()->StackOverflow(); 997 ASSERT(isolate == Isolate::Current());
998 if (isolate->stack_guard()->IsStackOverflow()) {
999 isolate->StackOverflow();
997 return EXCEPTION; 1000 return EXCEPTION;
998 } 1001 }
999 1002
1000 // If not real stack overflow the stack guard was used to interrupt 1003 // If not real stack overflow the stack guard was used to interrupt
1001 // execution for another purpose. 1004 // execution for another purpose.
1002 1005
1003 // If this is a direct call from JavaScript retry the RegExp forcing the call 1006 // If this is a direct call from JavaScript retry the RegExp forcing the call
1004 // through the runtime system. Currently the direct call cannot handle a GC. 1007 // through the runtime system. Currently the direct call cannot handle a GC.
1005 if (frame_entry<int>(re_frame, kDirectCall) == 1) { 1008 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1006 return RETRY; 1009 return RETRY;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1253 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1251 } 1254 }
1252 1255
1253 #undef __ 1256 #undef __
1254 1257
1255 #endif // V8_INTERPRETED_REGEXP 1258 #endif // V8_INTERPRETED_REGEXP
1256 1259
1257 }} // namespace v8::internal 1260 }} // namespace v8::internal
1258 1261
1259 #endif // V8_TARGET_ARCH_ARM 1262 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/regexp-macro-assembler-arm.h ('k') | src/arm/simulator-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698