summaryrefslogtreecommitdiff
path: root/deps/v8/src/api.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-10-30 11:13:37 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-10-30 11:13:37 -0700
commit268bcbde7c62e7bc781c79c8b07ea067bd4b9b59 (patch)
tree968b595dd7df5e0ea7390b780c4883cbcb8ee8f3 /deps/v8/src/api.h
parentccdd979a690f5d0172f22b821f31672063629a31 (diff)
downloadnode-new-268bcbde7c62e7bc781c79c8b07ea067bd4b9b59.tar.gz
Upgrade V8 to 2.5.2
Diffstat (limited to 'deps/v8/src/api.h')
-rw-r--r--deps/v8/src/api.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/deps/v8/src/api.h b/deps/v8/src/api.h
index e179e35672..e36160cf4a 100644
--- a/deps/v8/src/api.h
+++ b/deps/v8/src/api.h
@@ -353,7 +353,7 @@ class HandleScopeImplementer {
inline internal::Object** GetSpareOrNewBlock();
- inline void DeleteExtensions(int extensions);
+ inline void DeleteExtensions(internal::Object** prev_limit);
inline void IncrementCallDepth() {call_depth_++;}
inline void DecrementCallDepth() {call_depth_--;}
@@ -465,25 +465,28 @@ internal::Object** HandleScopeImplementer::GetSpareOrNewBlock() {
}
-void HandleScopeImplementer::DeleteExtensions(int extensions) {
- if (spare_ != NULL) {
- DeleteArray(spare_);
- spare_ = NULL;
- }
- for (int i = extensions; i > 1; --i) {
- internal::Object** block = blocks_.RemoveLast();
+void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) {
+ while (!blocks_.is_empty()) {
+ internal::Object** block_start = blocks_.last();
+ internal::Object** block_limit = block_start + kHandleBlockSize;
#ifdef DEBUG
- v8::ImplementationUtilities::ZapHandleRange(block,
- &block[kHandleBlockSize]);
+ // NoHandleAllocation may make the prev_limit to point inside the block.
+ if (block_start <= prev_limit && prev_limit <= block_limit) break;
+#else
+ if (prev_limit == block_limit) break;
#endif
- DeleteArray(block);
- }
- spare_ = blocks_.RemoveLast();
+
+ blocks_.RemoveLast();
#ifdef DEBUG
- v8::ImplementationUtilities::ZapHandleRange(
- spare_,
- &spare_[kHandleBlockSize]);
+ v8::ImplementationUtilities::ZapHandleRange(block_start, block_limit);
#endif
+ if (spare_ != NULL) {
+ DeleteArray(spare_);
+ }
+ spare_ = block_start;
+ }
+ ASSERT((blocks_.is_empty() && prev_limit == NULL) ||
+ (!blocks_.is_empty() && prev_limit != NULL));
}
} } // namespace v8::internal