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

Side by Side Diff: src/interpreter-irregexp.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/simulator-ia32.h ('k') | src/jsregexp.cc » ('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 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // If the cache is not empty reuse the previously allocated stack. 156 // If the cache is not empty reuse the previously allocated stack.
157 data_ = isolate->irregexp_interpreter_backtrack_stack_cache(); 157 data_ = isolate->irregexp_interpreter_backtrack_stack_cache();
158 isolate->set_irregexp_interpreter_backtrack_stack_cache(NULL); 158 isolate->set_irregexp_interpreter_backtrack_stack_cache(NULL);
159 } else { 159 } else {
160 // Cache was empty. Allocate a new backtrack stack. 160 // Cache was empty. Allocate a new backtrack stack.
161 data_ = NewArray<int>(kBacktrackStackSize); 161 data_ = NewArray<int>(kBacktrackStackSize);
162 } 162 }
163 } 163 }
164 164
165 ~BacktrackStack() { 165 ~BacktrackStack() {
166 Isolate* isolate = Isolate::Current(); 166 if (isolate_->irregexp_interpreter_backtrack_stack_cache() == NULL) {
167 if (isolate->irregexp_interpreter_backtrack_stack_cache() == NULL) {
168 // The cache is empty. Keep this backtrack stack around. 167 // The cache is empty. Keep this backtrack stack around.
169 isolate->set_irregexp_interpreter_backtrack_stack_cache(data_); 168 isolate_->set_irregexp_interpreter_backtrack_stack_cache(data_);
170 } else { 169 } else {
171 // A backtrack stack was already cached, just release this one. 170 // A backtrack stack was already cached, just release this one.
172 DeleteArray(data_); 171 DeleteArray(data_);
173 } 172 }
174 } 173 }
175 174
176 int* data() const { return data_; } 175 int* data() const { return data_; }
177 176
178 int max_size() const { return kBacktrackStackSize; } 177 int max_size() const { return kBacktrackStackSize; }
179 178
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return RawMatch(isolate, 641 return RawMatch(isolate,
643 code_base, 642 code_base,
644 subject_vector, 643 subject_vector,
645 registers, 644 registers,
646 start_position, 645 start_position,
647 previous_char); 646 previous_char);
648 } 647 }
649 } 648 }
650 649
651 } } // namespace v8::internal 650 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/simulator-ia32.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698