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

Unified Diff: src/factory.h

Issue 71163006: Merge bleeding_edge r17376:17693. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Fix all.gyp Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/elements.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index ee25bf23d87c4c917896ba872ecd88a5ae774914..663f56f755ef2ec06889ef54ef1f718ed6911d3f 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -74,7 +74,9 @@ class Factory {
Handle<ObjectHashSet> NewObjectHashSet(int at_least_space_for);
- Handle<ObjectHashTable> NewObjectHashTable(int at_least_space_for);
+ Handle<ObjectHashTable> NewObjectHashTable(
+ int at_least_space_for,
+ MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY);
Handle<WeakHashTable> NewWeakHashTable(int at_least_space_for);
@@ -184,6 +186,7 @@ class Factory {
// Create a symbol.
Handle<Symbol> NewSymbol();
+ Handle<Symbol> NewPrivateSymbol();
// Create a global (but otherwise uninitialized) context.
Handle<Context> NewNativeContext();
@@ -341,6 +344,8 @@ class Factory {
void SetContent(Handle<JSArray> array, Handle<FixedArrayBase> elements);
+ Handle<JSGeneratorObject> NewJSGeneratorObject(Handle<JSFunction> function);
+
Handle<JSArrayBuffer> NewJSArrayBuffer();
Handle<JSTypedArray> NewJSTypedArray(ExternalArrayType type);
@@ -584,101 +589,6 @@ Handle<Object> Factory::NewNumberFromSize(size_t value,
}
-// Used to "safely" transition from pointer-based runtime code to Handle-based
-// runtime code. When a GC happens during the called Handle-based code, a
-// failure object is returned to the pointer-based code to cause it abort and
-// re-trigger a gc of it's own. Since this double-gc will cause the Handle-based
-// code to be called twice, it must be idempotent.
-class IdempotentPointerToHandleCodeTrampoline {
- public:
- explicit IdempotentPointerToHandleCodeTrampoline(Isolate* isolate)
- : isolate_(isolate) {}
-
- template<typename R>
- MUST_USE_RESULT MaybeObject* Call(R (*function)()) {
- int collections = isolate_->heap()->gc_count();
- (*function)();
- return (collections == isolate_->heap()->gc_count())
- ? isolate_->heap()->true_value()
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R>
- MUST_USE_RESULT MaybeObject* CallWithReturnValue(R (*function)()) {
- int collections = isolate_->heap()->gc_count();
- Object* result = (*function)();
- return (collections == isolate_->heap()->gc_count())
- ? result
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R, typename P1>
- MUST_USE_RESULT MaybeObject* Call(R (*function)(P1), P1 p1) {
- int collections = isolate_->heap()->gc_count();
- (*function)(p1);
- return (collections == isolate_->heap()->gc_count())
- ? isolate_->heap()->true_value()
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R, typename P1>
- MUST_USE_RESULT MaybeObject* CallWithReturnValue(
- R (*function)(P1),
- P1 p1) {
- int collections = isolate_->heap()->gc_count();
- Object* result = (*function)(p1);
- return (collections == isolate_->heap()->gc_count())
- ? result
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R, typename P1, typename P2>
- MUST_USE_RESULT MaybeObject* Call(
- R (*function)(P1, P2),
- P1 p1,
- P2 p2) {
- int collections = isolate_->heap()->gc_count();
- (*function)(p1, p2);
- return (collections == isolate_->heap()->gc_count())
- ? isolate_->heap()->true_value()
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R, typename P1, typename P2>
- MUST_USE_RESULT MaybeObject* CallWithReturnValue(
- R (*function)(P1, P2),
- P1 p1,
- P2 p2) {
- int collections = isolate_->heap()->gc_count();
- Object* result = (*function)(p1, p2);
- return (collections == isolate_->heap()->gc_count())
- ? result
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- template<typename R, typename P1, typename P2, typename P3, typename P4,
- typename P5, typename P6, typename P7>
- MUST_USE_RESULT MaybeObject* CallWithReturnValue(
- R (*function)(P1, P2, P3, P4, P5, P6, P7),
- P1 p1,
- P2 p2,
- P3 p3,
- P4 p4,
- P5 p5,
- P6 p6,
- P7 p7) {
- int collections = isolate_->heap()->gc_count();
- Handle<Object> result = (*function)(p1, p2, p3, p4, p5, p6, p7);
- return (collections == isolate_->heap()->gc_count())
- ? *result
- : reinterpret_cast<MaybeObject*>(Failure::RetryAfterGC());
- }
-
- private:
- Isolate* isolate_;
-};
-
-
} } // namespace v8::internal
#endif // V8_FACTORY_H_
« no previous file with comments | « src/elements.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698