Permalink
Browse files

Upgrade V8 to 2.2.18

  • Loading branch information...
1 parent 187f191 commit 1c6671aa67c3d7f731fec415a58f7676e1468a15 @ry ry committed Jun 16, 2010
Showing with 2,475 additions and 729 deletions.
  1. +14 −0 deps/v8/ChangeLog
  2. +139 −0 deps/v8/include/v8-profiler.h
  3. +13 −49 deps/v8/include/v8.h
  4. +288 −15 deps/v8/src/api.cc
  5. +53 −5 deps/v8/src/arm/assembler-arm.cc
  6. +24 −0 deps/v8/src/arm/assembler-arm.h
  7. +10 −10 deps/v8/src/arm/builtins-arm.cc
  8. +147 −128 deps/v8/src/arm/codegen-arm.cc
  9. +6 −0 deps/v8/src/arm/codegen-arm.h
  10. +34 −17 deps/v8/src/arm/full-codegen-arm.cc
  11. +331 −117 deps/v8/src/arm/ic-arm.cc
  12. +54 −0 deps/v8/src/arm/macro-assembler-arm.cc
  13. +8 −0 deps/v8/src/arm/macro-assembler-arm.h
  14. +20 −0 deps/v8/src/arm/stub-cache-arm.cc
  15. +1 −0 deps/v8/src/arm/virtual-frame-arm.cc
  16. +2 −3 deps/v8/src/arm/virtual-frame-arm.h
  17. +70 −1 deps/v8/src/heap-profiler.cc
  18. +24 −1 deps/v8/src/heap-profiler.h
  19. +2 −2 deps/v8/src/heap.h
  20. +42 −34 deps/v8/src/ia32/codegen-ia32.cc
  21. +71 −63 deps/v8/src/ia32/ic-ia32.cc
  22. +11 −6 deps/v8/src/ic.cc
  23. +5 −12 deps/v8/src/objects.cc
  24. +10 −5 deps/v8/src/objects.h
  25. +14 −5 deps/v8/src/profile-generator.cc
  26. +9 −9 deps/v8/src/profile-generator.h
  27. +23 −4 deps/v8/src/runtime.cc
  28. +32 −20 deps/v8/src/serialize.cc
  29. +16 −17 deps/v8/src/stub-cache.cc
  30. +35 −0 deps/v8/src/utils.h
  31. +4 −0 deps/v8/src/v8.cc
  32. +1 −1 deps/v8/src/version.cc
  33. +3 −1 deps/v8/src/virtual-frame-light-inl.h
  34. +57 −53 deps/v8/src/x64/codegen-x64.cc
  35. +44 −18 deps/v8/src/x64/full-codegen-x64.cc
  36. +366 −110 deps/v8/src/x64/ic-x64.cc
  37. +21 −0 deps/v8/src/x64/stub-cache-x64.cc
  38. +19 −0 deps/v8/src/x64/virtual-frame-x64.cc
  39. +2 −0 deps/v8/src/x64/virtual-frame-x64.h
  40. +60 −12 deps/v8/test/cctest/test-api.cc
  41. +0 −2 deps/v8/test/cctest/test-debug.cc
  42. +0 −2 deps/v8/test/cctest/test-decls.cc
  43. +39 −0 deps/v8/test/cctest/test-disasm-arm.cc
  44. +175 −0 deps/v8/test/cctest/test-heap-profiler.cc
  45. +4 −4 deps/v8/test/cctest/test-serialize.cc
  46. +17 −0 deps/v8/test/mjsunit/keyed-call-generic.js
  47. +153 −0 deps/v8/test/mjsunit/object-define-property.js
  48. +2 −3 deps/v8/test/mjsunit/{bugs/bug-619.js → regress/regress-619.js}
View
@@ -1,3 +1,17 @@
+2010-06-16: Version 2.2.18
+
+ Added API functions to retrieve information on indexed properties
+ managed by the embedding layer. Fixes bug 737.
+
+ Make ES5 Object.defineProperty support array elements. Fixes bug 619.
+
+ Add heap profiling to the API.
+
+ Remove old named property query from the API.
+
+ Incremental performance improvements.
+
+
2010-06-14: Version 2.2.17
Improved debugger support for stepping out of functions.
@@ -184,6 +184,145 @@ class V8EXPORT CpuProfiler {
};
+class HeapGraphNode;
+
+
+/**
+ * HeapSnapshotEdge represents a directed connection between heap
+ * graph nodes: from retaners to retained nodes.
+ */
+class V8EXPORT HeapGraphEdge {
+ public:
+ enum Type {
+ CONTEXT_VARIABLE = 0, // A variable from a function context.
+ ELEMENT = 1, // An element of an array.
+ PROPERTY = 2 // A named object property.
+ };
+
+ /** Returns edge type (see HeapGraphEdge::Type). */
+ Type GetType() const;
+
+ /**
+ * Returns edge name. This can be a variable name, an element index, or
+ * a property name.
+ */
+ Handle<Value> GetName() const;
+
+ /** Returns origin node. */
+ const HeapGraphNode* GetFromNode() const;
+
+ /** Returns destination node. */
+ const HeapGraphNode* GetToNode() const;
+};
+
+
+class V8EXPORT HeapGraphPath {
+ public:
+ /** Returns the number of edges in the path. */
+ int GetEdgesCount() const;
+
+ /** Returns an edge from the path. */
+ const HeapGraphEdge* GetEdge(int index) const;
+
+ /** Returns origin node. */
+ const HeapGraphNode* GetFromNode() const;
+
+ /** Returns destination node. */
+ const HeapGraphNode* GetToNode() const;
+};
+
+
+/**
+ * HeapGraphNode represents a node in a heap graph.
+ */
+class V8EXPORT HeapGraphNode {
+ public:
+ enum Type {
+ INTERNAL = 0, // Internal node, a virtual one, for housekeeping.
+ ARRAY = 1, // An array of elements.
+ STRING = 2, // A string.
+ OBJECT = 3, // A JS object (except for arrays and strings).
+ CODE = 4, // Compiled code.
+ CLOSURE = 5 // Function closure.
+ };
+
+ /** Returns node type (see HeapGraphNode::Type). */
+ Type GetType() const;
+
+ /**
+ * Returns node name. Depending on node's type this can be the name
+ * of the constructor (for objects), the name of the function (for
+ * closures), string value, or an empty string (for compiled code).
+ */
+ Handle<String> GetName() const;
+
+ /** Returns node's own size, in bytes. */
+ int GetSelfSize() const;
+
+ /** Returns node's network (self + reachable nodes) size, in bytes. */
+ int GetTotalSize() const;
+
+ /**
+ * Returns node's private size, in bytes. That is, the size of memory
+ * that will be reclaimed having this node collected.
+ */
+ int GetPrivateSize() const;
+
+ /** Returns child nodes count of the node. */
+ int GetChildrenCount() const;
+
+ /** Retrieves a child by index. */
+ const HeapGraphEdge* GetChild(int index) const;
+
+ /** Returns retainer nodes count of the node. */
+ int GetRetainersCount() const;
+
+ /** Returns a retainer by index. */
+ const HeapGraphEdge* GetRetainer(int index) const;
+
+ /** Returns the number of simple retaining paths from the root to the node. */
+ int GetRetainingPathsCount() const;
+
+ /** Returns a retaining path by index. */
+ const HeapGraphPath* GetRetainingPath(int index) const;
+};
+
+
+/**
+ * HeapSnapshots record the state of the JS heap at some moment.
+ */
+class V8EXPORT HeapSnapshot {
+ public:
+ /** Returns heap snapshot UID (assigned by the profiler.) */
+ unsigned GetUid() const;
+
+ /** Returns heap snapshot title. */
+ Handle<String> GetTitle() const;
+
+ /** Returns the root node of the heap graph. */
+ const HeapGraphNode* GetHead() const;
+};
+
+
+/**
+ * Interface for controlling heap profiling.
+ */
+class V8EXPORT HeapProfiler {
+ public:
+ /** Returns the number of snapshots taken. */
+ static int GetSnapshotsCount();
+
+ /** Returns a snapshot by index. */
+ static const HeapSnapshot* GetSnapshot(int index);
+
+ /** Returns a profile by uid. */
+ static const HeapSnapshot* FindSnapshot(unsigned uid);
+
+ /** Takes a heap snapshot and returns it. Title may be an empty string. */
+ static const HeapSnapshot* TakeSnapshot(Handle<String> title);
+};
+
+
} // namespace v8
View
@@ -1570,6 +1570,9 @@ class V8EXPORT Object : public Value {
* the backing store is preserved while V8 has a reference.
*/
void SetIndexedPropertiesToPixelData(uint8_t* data, int length);
+ bool HasIndexedPropertiesInPixelData();
+ uint8_t* GetIndexedPropertiesPixelData();
+ int GetIndexedPropertiesPixelDataLength();
/**
* Set the backing store of the indexed properties to be managed by the
@@ -1581,6 +1584,10 @@ class V8EXPORT Object : public Value {
void SetIndexedPropertiesToExternalArrayData(void* data,
ExternalArrayType array_type,
int number_of_elements);
+ bool HasIndexedPropertiesInExternalArrayData();
+ void* GetIndexedPropertiesExternalArrayData();
+ ExternalArrayType GetIndexedPropertiesExternalArrayDataType();
+ int GetIndexedPropertiesExternalArrayDataLength();
static Local<Object> New();
static inline Object* Cast(Value* obj);
@@ -1761,20 +1768,11 @@ typedef Handle<Value> (*NamedPropertySetter)(Local<String> property,
/**
* Returns a non-empty handle if the interceptor intercepts the request.
- * The result is either boolean (true if property exists and false
- * otherwise) or an integer encoding property attributes.
+ * The result is an integer encoding property attributes (like v8::None,
+ * v8::DontEnum, etc.)
*/
-#ifdef USE_NEW_QUERY_CALLBACKS
typedef Handle<Integer> (*NamedPropertyQuery)(Local<String> property,
const AccessorInfo& info);
-#else
-typedef Handle<Boolean> (*NamedPropertyQuery)(Local<String> property,
- const AccessorInfo& info);
-#endif
-
-typedef Handle<Value> (*NamedPropertyQueryImpl)(Local<String> property,
- const AccessorInfo& info);
-
/**
@@ -2026,16 +2024,7 @@ class V8EXPORT FunctionTemplate : public Template {
NamedPropertyQuery query,
NamedPropertyDeleter remover,
NamedPropertyEnumerator enumerator,
- Handle<Value> data) {
- NamedPropertyQueryImpl casted =
- reinterpret_cast<NamedPropertyQueryImpl>(query);
- SetNamedInstancePropertyHandlerImpl(getter,
- setter,
- casted,
- remover,
- enumerator,
- data);
- }
+ Handle<Value> data);
void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter,
IndexedPropertySetter setter,
IndexedPropertyQuery query,
@@ -2047,13 +2036,6 @@ class V8EXPORT FunctionTemplate : public Template {
friend class Context;
friend class ObjectTemplate;
- private:
- void SetNamedInstancePropertyHandlerImpl(NamedPropertyGetter getter,
- NamedPropertySetter setter,
- NamedPropertyQueryImpl query,
- NamedPropertyDeleter remover,
- NamedPropertyEnumerator enumerator,
- Handle<Value> data);
};
@@ -2111,7 +2093,8 @@ class V8EXPORT ObjectTemplate : public Template {
*
* \param getter The callback to invoke when getting a property.
* \param setter The callback to invoke when setting a property.
- * \param query The callback to invoke to check if an object has a property.
+ * \param query The callback to invoke to check if a property is present,
+ * and if present, get its attributes.
* \param deleter The callback to invoke when deleting a property.
* \param enumerator The callback to invoke to enumerate all the named
* properties of an object.
@@ -2123,26 +2106,7 @@ class V8EXPORT ObjectTemplate : public Template {
NamedPropertyQuery query = 0,
NamedPropertyDeleter deleter = 0,
NamedPropertyEnumerator enumerator = 0,
- Handle<Value> data = Handle<Value>()) {
- NamedPropertyQueryImpl casted =
- reinterpret_cast<NamedPropertyQueryImpl>(query);
- SetNamedPropertyHandlerImpl(getter,
- setter,
- casted,
- deleter,
- enumerator,
- data);
- }
-
- private:
- void SetNamedPropertyHandlerImpl(NamedPropertyGetter getter,
- NamedPropertySetter setter,
- NamedPropertyQueryImpl query,
- NamedPropertyDeleter deleter,
- NamedPropertyEnumerator enumerator,
- Handle<Value> data);
-
- public:
+ Handle<Value> data = Handle<Value>());
/**
* Sets an indexed property handler on the object template.
Oops, something went wrong.

0 comments on commit 1c6671a

Please sign in to comment.