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

Side by Side Diff: src/ia32/regexp-macro-assembler-ia32.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/ia32/regexp-macro-assembler-ia32.h ('k') | src/ia32/simulator-ia32.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 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 * - esi : end of input (points to byte after last character in input). 49 * - esi : end of input (points to byte after last character in input).
50 * - ebp : frame pointer. Used to access arguments, local variables and 50 * - ebp : frame pointer. Used to access arguments, local variables and
51 * RegExp registers. 51 * RegExp registers.
52 * - esp : points to tip of C stack. 52 * - esp : points to tip of C stack.
53 * - ecx : points to tip of backtrack stack 53 * - ecx : points to tip of backtrack stack
54 * 54 *
55 * The registers eax and ebx are free to use for computations. 55 * The registers eax and ebx are free to use for computations.
56 * 56 *
57 * Each call to a public method should retain this convention. 57 * Each call to a public method should retain this convention.
58 * The stack will have the following structure: 58 * The stack will have the following structure:
59 * - Isolate* isolate (Address of the current isolate)
59 * - direct_call (if 1, direct call from JavaScript code, if 0 60 * - direct_call (if 1, direct call from JavaScript code, if 0
60 * call through the runtime system) 61 * call through the runtime system)
61 * - stack_area_base (High end of the memory area to use as 62 * - stack_area_base (High end of the memory area to use as
62 * backtracking stack) 63 * backtracking stack)
63 * - int* capture_array (int[num_saved_registers_], for output). 64 * - int* capture_array (int[num_saved_registers_], for output).
64 * - end of input (Address of end of string) 65 * - end of input (Address of end of string)
65 * - start of input (Address of first character in string) 66 * - start of input (Address of first character in string)
66 * - start index (character index of start) 67 * - start index (character index of start)
67 * - String* input_string (location of a handle containing the string) 68 * - String* input_string (location of a handle containing the string)
68 * --- frame alignment (if applicable) --- 69 * --- frame alignment (if applicable) ---
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 // Helper function for reading a value out of a stack frame. 1025 // Helper function for reading a value out of a stack frame.
1025 template <typename T> 1026 template <typename T>
1026 static T& frame_entry(Address re_frame, int frame_offset) { 1027 static T& frame_entry(Address re_frame, int frame_offset) {
1027 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset)); 1028 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset));
1028 } 1029 }
1029 1030
1030 1031
1031 int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address, 1032 int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
1032 Code* re_code, 1033 Code* re_code,
1033 Address re_frame) { 1034 Address re_frame) {
1034 Isolate* isolate = Isolate::Current(); 1035 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
1036 ASSERT(isolate == Isolate::Current());
1035 if (isolate->stack_guard()->IsStackOverflow()) { 1037 if (isolate->stack_guard()->IsStackOverflow()) {
1036 isolate->StackOverflow(); 1038 isolate->StackOverflow();
1037 return EXCEPTION; 1039 return EXCEPTION;
1038 } 1040 }
1039 1041
1040 // If not real stack overflow the stack guard was used to interrupt 1042 // If not real stack overflow the stack guard was used to interrupt
1041 // execution for another purpose. 1043 // execution for another purpose.
1042 1044
1043 // If this is a direct call from JavaScript retry the RegExp forcing the call 1045 // If this is a direct call from JavaScript retry the RegExp forcing the call
1044 // through the runtime system. Currently the direct call cannot handle a GC. 1046 // through the runtime system. Currently the direct call cannot handle a GC.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 } 1239 }
1238 1240
1239 1241
1240 #undef __ 1242 #undef __
1241 1243
1242 #endif // V8_INTERPRETED_REGEXP 1244 #endif // V8_INTERPRETED_REGEXP
1243 1245
1244 }} // namespace v8::internal 1246 }} // namespace v8::internal
1245 1247
1246 #endif // V8_TARGET_ARCH_IA32 1248 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.h ('k') | src/ia32/simulator-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698