diff options
author | Ben Murdoch <benm@google.com> | 2012-03-05 14:35:55 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2012-04-11 15:40:15 +0100 |
commit | c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9 (patch) | |
tree | 6f84ef396408af3c9f08eaac783ecf1a957b0fee /include | |
parent | 592a9fc1d8ea420377a2e7efd0600e20b058be2b (diff) | |
download | android_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.tar.gz android_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.tar.bz2 android_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.zip |
Merge V8 at 3.8.9.11
Bug: 5688872
Change-Id: Ie3b1dd67a730ec5e82686b7b37dba26f6a9bb24f
Diffstat (limited to 'include')
-rw-r--r-- | include/v8-profiler.h | 3 | ||||
-rw-r--r-- | include/v8.h | 60 | ||||
-rw-r--r-- | include/v8stdint.h | 3 |
3 files changed, 58 insertions, 8 deletions
diff --git a/include/v8-profiler.h b/include/v8-profiler.h index f67646f5..27b3c6de 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -219,8 +219,9 @@ class V8EXPORT HeapGraphEdge { // (e.g. parts of a ConsString). kHidden = 4, // A link that is needed for proper sizes // calculation, but may be hidden from user. - kShortcut = 5 // A link that must not be followed during + kShortcut = 5, // A link that must not be followed during // sizes calculation. + kWeak = 6 // A weak reference (ignored by the GC). }; /** Returns edge type (see HeapGraphEdge::Type). */ diff --git a/include/v8.h b/include/v8.h index 7cad7b62..08c2fa2b 100644 --- a/include/v8.h +++ b/include/v8.h @@ -1732,6 +1732,14 @@ class Function : public Object { V8EXPORT Handle<Value> GetName() const; /** + * Name inferred from variable or property assignment of this function. + * Used to facilitate debugging and profiling of JavaScript code written + * in an OO style, where many functions are anonymous but are assigned + * to object properties. + */ + V8EXPORT Handle<Value> GetInferredName() const; + + /** * Returns zero based line number of function body and * kLineOffsetNotFound if no information available. */ @@ -2635,6 +2643,9 @@ typedef void (*MemoryAllocationCallback)(ObjectSpace space, AllocationAction action, int size); +// --- Leave Script Callback --- +typedef void (*CallCompletedCallback)(); + // --- Failed Access Check Callback --- typedef void (*FailedAccessCheckCallback)(Local<Object> target, AccessType type, @@ -2714,7 +2725,7 @@ class RetainedObjectInfo; * default isolate is implicitly created and entered. The embedder * can create additional isolates and use them in parallel in multiple * threads. An isolate can be entered by at most one thread at any - * given time. The Locker/Unlocker API can be used to synchronize. + * given time. The Locker/Unlocker API must be used to synchronize. */ class V8EXPORT Isolate { public: @@ -2845,6 +2856,17 @@ class V8EXPORT StartupDataDecompressor { // NOLINT */ typedef bool (*EntropySource)(unsigned char* buffer, size_t length); + +/** + * Interface for iterating though all external resources in the heap. + */ +class V8EXPORT ExternalResourceVisitor { // NOLINT + public: + virtual ~ExternalResourceVisitor() {} + virtual void VisitExternalString(Handle<String> string) {} +}; + + /** * Container class for static utility functions. */ @@ -3033,12 +3055,25 @@ class V8EXPORT V8 { AllocationAction action); /** - * This function removes callback which was installed by - * AddMemoryAllocationCallback function. + * Removes callback that was installed by AddMemoryAllocationCallback. */ static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); /** + * Adds a callback to notify the host application when a script finished + * running. If a script re-enters the runtime during executing, the + * CallCompletedCallback is only invoked when the outer-most script + * execution ends. Executing scripts inside the callback do not trigger + * further callbacks. + */ + static void AddCallCompletedCallback(CallCompletedCallback callback); + + /** + * Removes callback that was installed by AddCallCompletedCallback. + */ + static void RemoveCallCompletedCallback(CallCompletedCallback callback); + + /** * Allows the host application to group objects together. If one * object in the group is alive, all objects in the group are alive. * After each garbage collection, object groups are removed. It is @@ -3188,14 +3223,25 @@ class V8EXPORT V8 { static void GetHeapStatistics(HeapStatistics* heap_statistics); /** + * Iterates through all external resources referenced from current isolate + * heap. This method is not expected to be used except for debugging purposes + * and may be quite slow. + */ + static void VisitExternalResources(ExternalResourceVisitor* visitor); + + /** * Optional notification that the embedder is idle. * V8 uses the notification to reduce memory footprint. * This call can be used repeatedly if the embedder remains idle. * Returns true if the embedder should stop calling IdleNotification * until real work has been done. This indicates that V8 has done * as much cleanup as it will be able to do. + * + * The hint argument specifies the amount of work to be done in the function + * on scale from 1 to 1000. There is no guarantee that the actual work will + * match the hint. */ - static bool IdleNotification(); + static bool IdleNotification(int hint = 1000); /** * Optional notification that the system is running low on memory. @@ -3521,7 +3567,9 @@ class V8EXPORT Context { * accessing handles or holding onto object pointers obtained * from V8 handles while in the particular V8 isolate. It is up * to the user of V8 to ensure (perhaps with locking) that this - * constraint is not violated. + * constraint is not violated. In addition to any other synchronization + * mechanism that may be used, the v8::Locker and v8::Unlocker classes + * must be used to signal thead switches to V8. * * v8::Locker is a scoped lock object. While it's * active (i.e. between its construction and destruction) the current thread is @@ -3796,7 +3844,7 @@ class Internals { static const int kFullStringRepresentationMask = 0x07; static const int kExternalTwoByteRepresentationTag = 0x02; - static const int kJSObjectType = 0xa6; + static const int kJSObjectType = 0xa7; static const int kFirstNonstringType = 0x80; static const int kForeignType = 0x85; diff --git a/include/v8stdint.h b/include/v8stdint.h index 50b4f29a..7c12e1f4 100644 --- a/include/v8stdint.h +++ b/include/v8stdint.h @@ -1,4 +1,4 @@ -// Copyright 2010 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -30,6 +30,7 @@ #ifndef V8STDINT_H_ #define V8STDINT_H_ +#include <stddef.h> #include <stdio.h> #if defined(_WIN32) && !defined(__MINGW32__) |