OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 namespace internal { | 32 namespace internal { |
33 | 33 |
34 RegExpStackScope::RegExpStackScope(Isolate* isolate) | 34 RegExpStackScope::RegExpStackScope(Isolate* isolate) |
35 : regexp_stack_(isolate->regexp_stack()) { | 35 : regexp_stack_(isolate->regexp_stack()) { |
36 // Initialize, if not already initialized. | 36 // Initialize, if not already initialized. |
37 regexp_stack_->EnsureCapacity(0); | 37 regexp_stack_->EnsureCapacity(0); |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 RegExpStackScope::~RegExpStackScope() { | 41 RegExpStackScope::~RegExpStackScope() { |
42 ASSERT(Isolate::Current() == regexp_stack_->isolate_); | |
43 // Reset the buffer if it has grown. | 42 // Reset the buffer if it has grown. |
44 regexp_stack_->Reset(); | 43 regexp_stack_->Reset(); |
45 } | 44 } |
46 | 45 |
47 | 46 |
48 RegExpStack::RegExpStack() | 47 RegExpStack::RegExpStack() |
49 : isolate_(NULL) { | 48 : isolate_(NULL) { |
50 } | 49 } |
51 | 50 |
52 | 51 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 101 } |
103 thread_local_.memory_ = new_memory; | 102 thread_local_.memory_ = new_memory; |
104 thread_local_.memory_size_ = size; | 103 thread_local_.memory_size_ = size; |
105 thread_local_.limit_ = new_memory + kStackLimitSlack * kPointerSize; | 104 thread_local_.limit_ = new_memory + kStackLimitSlack * kPointerSize; |
106 } | 105 } |
107 return thread_local_.memory_ + thread_local_.memory_size_; | 106 return thread_local_.memory_ + thread_local_.memory_size_; |
108 } | 107 } |
109 | 108 |
110 | 109 |
111 }} // namespace v8::internal | 110 }} // namespace v8::internal |
OLD | NEW |