Permalink
Browse files

Version 2.5.8

Removed dependency on Gay's dtoa.

Improved heap profiler precision and speed.

Reduced overhead of callback invocations on ARM.


git-svn-id: https://v8.googlecode.com/svn/trunk@5874 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information...
vegorov@chromium.org
vegorov@chromium.org committed Nov 23, 2010
1 parent 91ff7be commit 8211e79dfca7f01d69d548a13579f2ace2772aea
Showing with 3,148 additions and 6,407 deletions.
  1. +9 −0 ChangeLog
  2. +0 −3 LICENSE
  3. +22 −7 include/v8-profiler.h
  4. +13 −1 samples/shell.cc
  5. +1 −7 src/SConscript
  6. +10 −8 src/api.cc
  7. +3 −0 src/apiutils.h
  8. +3 −2 src/arm/code-stubs-arm.cc
  9. +20 −5 src/arm/codegen-arm.cc
  10. +3 −1 src/arm/codegen-arm.h
  11. +16 −4 src/arm/full-codegen-arm.cc
  12. +199 −36 src/arm/stub-cache-arm.cc
  13. +4 −0 src/array.js
  14. +6 −1 src/ast.h
  15. +7 −14 src/builtins.cc
  16. +0 −10 src/conversions.cc
  17. +0 −5 src/conversions.h
  18. +0 −92 src/dtoa-config.c
  19. +3 −3 src/full-codegen.cc
  20. +1 −1 src/full-codegen.h
  21. +37 −29 src/handles.cc
  22. +11 −5 src/heap-profiler.cc
  23. +2 −1 src/ia32/code-stubs-ia32.cc
  24. +195 −5 src/ia32/codegen-ia32.cc
  25. +3 −1 src/ia32/codegen-ia32.h
  26. +193 −3 src/ia32/full-codegen-ia32.cc
  27. +51 −0 src/ia32/macro-assembler-ia32.cc
  28. +17 −0 src/ia32/macro-assembler-ia32.h
  29. +7 −8 src/ia32/stub-cache-ia32.cc
  30. +23 −46 src/parser.cc
  31. +9 −7 src/parser.h
  32. +2 −2 src/preparser.h
  33. +0 −1,098 src/prescanner.h
  34. +25 −18 src/profile-generator-inl.h
  35. +492 −254 src/profile-generator.cc
  36. +111 −74 src/profile-generator.h
  37. +10 −5 src/runtime.cc
  38. +3 −2 src/runtime.h
  39. +731 −3 src/scanner-base.cc
  40. +360 −13 src/scanner-base.h
  41. +82 −786 src/scanner.cc
  42. +44 −259 src/scanner.h
  43. +2 −5 src/stub-cache.cc
  44. +0 −15 src/third_party/dtoa/COPYING
  45. +0 −3,331 src/third_party/dtoa/dtoa.c
  46. +2 −0 src/utils.h
  47. +1 −1 src/version.cc
  48. +2 −1 src/x64/code-stubs-x64.cc
  49. +16 −5 src/x64/codegen-x64.cc
  50. +3 −1 src/x64/codegen-x64.h
  51. +12 −3 src/x64/full-codegen-x64.cc
  52. +1 −1 src/x64/stub-cache-x64.cc
  53. +5 −3 test/cctest/test-api.cc
  54. +5 −8 test/cctest/test-conversions.cc
  55. +56 −11 test/cctest/test-debug.cc
  56. +107 −79 test/cctest/test-heap-profiler.cc
  57. +4 −4 test/cctest/test-parsing.cc
  58. +38 −0 test/mjsunit/compiler/literals.js
  59. +1 −6 tools/gyp/v8.gyp
  60. +1 −2 tools/visual_studio/README.txt
  61. +28 −64 tools/visual_studio/v8_base.vcproj
  62. +68 −24 tools/visual_studio/v8_base_arm.vcproj
  63. +68 −24 tools/visual_studio/v8_base_x64.vcproj
View
@@ -1,3 +1,12 @@
+2010-11-23: Version 2.5.8
+
+ Removed dependency on Gay's dtoa.
+
+ Improved heap profiler precision and speed.
+
+ Reduced overhead of callback invocations on ARM.
+
+
2010-11-18: Version 2.5.7
Fixed obscure evaluation order bug (issue 931).
View
@@ -12,9 +12,6 @@ are:
based on layout tests from webkit.org which are copyrighted by
Apple Computer, Inc. and released under a 3-clause BSD license.
- - Dtoa, located under third_party/dtoa. This code is copyrighted by
- David M. Gay and released under an MIT license.
-
- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
View
@@ -197,8 +197,13 @@ class V8EXPORT HeapGraphEdge {
kContextVariable = 0, // A variable from a function context.
kElement = 1, // An element of an array.
kProperty = 2, // A named object property.
- kInternal = 3 // A link that can't be accessed from JS,
- // thus, its name isn't a real property name.
+ kInternal = 3, // A link that can't be accessed from JS,
+ // thus, its name isn't a real property name
+ // (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
+ // sizes calculation.
};
/** Returns edge type (see HeapGraphEdge::Type). */
@@ -240,7 +245,8 @@ class V8EXPORT HeapGraphPath {
class V8EXPORT HeapGraphNode {
public:
enum Type {
- kInternal = 0, // Internal node, a virtual one, for housekeeping.
+ kInternal = 0, // For compatibility, will be removed.
+ kHidden = 0, // Hidden node, may be filtered when shown to user.
kArray = 1, // An array of elements.
kString = 2, // A string.
kObject = 3, // A JS object (except for arrays and strings).
@@ -276,16 +282,19 @@ class V8EXPORT HeapGraphNode {
/** Returns node's own size, in bytes. */
int GetSelfSize() const;
- /** Returns node's network (self + reachable nodes) size, in bytes. */
- int GetReachableSize() const;
-
/**
* Returns node's retained size, in bytes. That is, self + sizes of
* the objects that are reachable only from this object. In other
* words, the size of memory that will be reclaimed having this node
* collected.
+ *
+ * Exact retained size calculation has O(N) (number of nodes)
+ * computational complexity, while approximate has O(1). It is
+ * assumed that initially heap profiling tools provide approximate
+ * sizes for all nodes, and then exact sizes are calculated for the
+ * most 'interesting' nodes.
*/
- int GetRetainedSize() const;
+ int GetRetainedSize(bool exact) const;
/** Returns child nodes count of the node. */
int GetChildrenCount() const;
@@ -304,6 +313,12 @@ class V8EXPORT HeapGraphNode {
/** Returns a retaining path by index. */
const HeapGraphPath* GetRetainingPath(int index) const;
+
+ /**
+ * Returns a dominator node. This is the node that participates in every
+ * path from the snapshot root to the current node.
+ */
+ const HeapGraphNode* GetDominatorNode() const;
};
View
@@ -37,6 +37,7 @@ bool ExecuteString(v8::Handle<v8::String> source,
v8::Handle<v8::Value> name,
bool print_result,
bool report_exceptions);
+v8::Handle<v8::Value> PrintToInteger(const v8::Arguments& args);
v8::Handle<v8::Value> Print(const v8::Arguments& args);
v8::Handle<v8::Value> Read(const v8::Arguments& args);
v8::Handle<v8::Value> Load(const v8::Arguments& args);
@@ -53,7 +54,8 @@ int RunMain(int argc, char* argv[]) {
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
// Bind the global 'print' function to the C++ Print callback.
global->Set(v8::String::New("print"), v8::FunctionTemplate::New(Print));
- // Bind the global 'read' function to the C++ Read callback.
+global->Set(v8::String::New("print2int"), v8::FunctionTemplate::New(PrintToInteger));
+// Bind the global 'read' function to the C++ Read callback.
global->Set(v8::String::New("read"), v8::FunctionTemplate::New(Read));
// Bind the global 'load' function to the C++ Load callback.
global->Set(v8::String::New("load"), v8::FunctionTemplate::New(Load));
@@ -138,6 +140,16 @@ v8::Handle<v8::Value> Print(const v8::Arguments& args) {
}
+v8::Handle<v8::Value> PrintToInteger(const v8::Arguments& args) {
+ v8::HandleScope handle_scope;
+ v8::String::Utf8Value str(args[0]);
+ const char* cstr = ToCString(str);
+ printf("%s -> %d\n", cstr, args[0]->ToInt32()->Value());
+ fflush(stdout);
+ return v8::Undefined();
+}
+
+
// The callback that is invoked by v8 whenever the JavaScript 'read'
// function is called. This function loads the content of the file named in
// the argument into a JavaScript string.
View
@@ -297,14 +297,8 @@ def ConfigureObjectFiles():
libraries_src, libraries_empty_src = env.JS2C(['libraries.cc', 'libraries-empty.cc'], library_files, TYPE='CORE')
libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
- # Build dtoa.
- dtoa_env = env.Copy()
- dtoa_env.Replace(**context.flags['dtoa'])
- dtoa_files = ['dtoa-config.c']
- dtoa_obj = context.ConfigureObject(dtoa_env, dtoa_files)
-
source_objs = context.ConfigureObject(env, source_files)
- non_snapshot_files = [dtoa_obj, source_objs]
+ non_snapshot_files = [source_objs]
# Create snapshot if necessary. For cross compilation you should either
# do without snapshots and take the performance hit or you should build a
View
@@ -4669,9 +4669,11 @@ Handle<Value> HeapGraphEdge::GetName() const {
case i::HeapGraphEdge::kContextVariable:
case i::HeapGraphEdge::kInternal:
case i::HeapGraphEdge::kProperty:
+ case i::HeapGraphEdge::kShortcut:
return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol(
edge->name())));
case i::HeapGraphEdge::kElement:
+ case i::HeapGraphEdge::kHidden:
return Handle<Number>(ToApi<Number>(i::Factory::NewNumberFromInt(
edge->index())));
default: UNREACHABLE();
@@ -4761,15 +4763,9 @@ int HeapGraphNode::GetSelfSize() const {
}
-int HeapGraphNode::GetReachableSize() const {
- IsDeadCheck("v8::HeapSnapshot::GetReachableSize");
- return ToInternal(this)->ReachableSize();
-}
-
-
-int HeapGraphNode::GetRetainedSize() const {
+int HeapGraphNode::GetRetainedSize(bool exact) const {
IsDeadCheck("v8::HeapSnapshot::GetRetainedSize");
- return ToInternal(this)->RetainedSize();
+ return ToInternal(this)->RetainedSize(exact);
}
@@ -4812,6 +4808,12 @@ const HeapGraphPath* HeapGraphNode::GetRetainingPath(int index) const {
}
+const HeapGraphNode* HeapGraphNode::GetDominatorNode() const {
+ IsDeadCheck("v8::HeapSnapshot::GetDominatorNode");
+ return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->dominator());
+}
+
+
const HeapGraphNode* HeapSnapshotsDiff::GetAdditionsRoot() const {
IsDeadCheck("v8::HeapSnapshotsDiff::GetAdditionsRoot");
i::HeapSnapshotsDiff* diff =
View
@@ -58,6 +58,9 @@ class ImplementationUtilities {
static v8::Arguments NewArguments(internal::Object** implicit_args,
internal::Object** argv, int argc,
bool is_construct_call) {
+ ASSERT(implicit_args[v8::Arguments::kCalleeIndex]->IsJSFunction());
+ ASSERT(implicit_args[v8::Arguments::kHolderIndex]->IsHeapObject());
+
return v8::Arguments(implicit_args, argv, argc, is_construct_call);
}
@@ -100,8 +100,9 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Create a new closure through the slower runtime call.
__ bind(&gc);
- __ Push(cp, r3);
- __ TailCallRuntime(Runtime::kNewClosure, 2, 1);
+ __ LoadRoot(r4, Heap::kFalseValueRootIndex);
+ __ Push(cp, r3, r4);
+ __ TailCallRuntime(Runtime::kNewClosure, 3, 1);
}
View
@@ -3103,10 +3103,13 @@ void CodeGenerator::VisitDebuggerStatement(DebuggerStatement* node) {
void CodeGenerator::InstantiateFunction(
- Handle<SharedFunctionInfo> function_info) {
+ Handle<SharedFunctionInfo> function_info,
+ bool pretenure) {
// Use the fast case closure allocation code that allocates in new
// space for nested functions that don't need literals cloning.
- if (scope()->is_function_scope() && function_info->num_literals() == 0) {
+ if (scope()->is_function_scope() &&
+ function_info->num_literals() == 0 &&
+ !pretenure) {
FastNewClosureStub stub;
frame_->EmitPush(Operand(function_info));
frame_->SpillAll();
@@ -3116,7 +3119,10 @@ void CodeGenerator::InstantiateFunction(
// Create a new closure.
frame_->EmitPush(cp);
frame_->EmitPush(Operand(function_info));
- frame_->CallRuntime(Runtime::kNewClosure, 2);
+ frame_->EmitPush(Operand(pretenure
+ ? Factory::true_value()
+ : Factory::false_value()));
+ frame_->CallRuntime(Runtime::kNewClosure, 3);
frame_->EmitPush(r0);
}
}
@@ -3136,7 +3142,7 @@ void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) {
ASSERT(frame_->height() == original_height);
return;
}
- InstantiateFunction(function_info);
+ InstantiateFunction(function_info, node->pretenure());
ASSERT_EQ(original_height + 1, frame_->height());
}
@@ -3147,7 +3153,7 @@ void CodeGenerator::VisitSharedFunctionInfoLiteral(
int original_height = frame_->height();
#endif
Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
- InstantiateFunction(node->shared_function_info());
+ InstantiateFunction(node->shared_function_info(), false);
ASSERT_EQ(original_height + 1, frame_->height());
}
@@ -5816,6 +5822,15 @@ void CodeGenerator::GenerateGetCachedArrayIndex(ZoneList<Expression*>* args) {
}
+void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+ ASSERT(args->length() == 2);
+ Load(args->at(0));
+ Register value = frame_->PopToRegister();
+ __ LoadRoot(value, Heap::kUndefinedValueRootIndex);
+ frame_->EmitPush(value);
+}
+
+
void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
#ifdef DEBUG
int original_height = frame_->height();
View
@@ -449,7 +449,8 @@ class CodeGenerator: public AstVisitor {
void DeclareGlobals(Handle<FixedArray> pairs);
// Instantiate the function based on the shared function info.
- void InstantiateFunction(Handle<SharedFunctionInfo> function_info);
+ void InstantiateFunction(Handle<SharedFunctionInfo> function_info,
+ bool pretenure);
// Support for type checks.
void GenerateIsSmi(ZoneList<Expression*>* args);
@@ -528,6 +529,7 @@ class CodeGenerator: public AstVisitor {
void GenerateHasCachedArrayIndex(ZoneList<Expression*>* args);
void GenerateGetCachedArrayIndex(ZoneList<Expression*>* args);
+ void GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args);
// Simple condition analysis.
enum ConditionAnalysis {
@@ -860,18 +860,23 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
}
-void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) {
+void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+ bool pretenure) {
// Use the fast case closure allocation code that allocates in new
// space for nested functions that don't need literals cloning.
- if (scope()->is_function_scope() && info->num_literals() == 0) {
+ if (scope()->is_function_scope() &&
+ info->num_literals() == 0 &&
+ !pretenure) {
FastNewClosureStub stub;
__ mov(r0, Operand(info));
__ push(r0);
__ CallStub(&stub);
} else {
__ mov(r0, Operand(info));
- __ Push(cp, r0);
- __ CallRuntime(Runtime::kNewClosure, 2);
+ __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex
+ : Heap::kFalseValueRootIndex);
+ __ Push(cp, r0, r1);
+ __ CallRuntime(Runtime::kNewClosure, 3);
}
context()->Plug(r0);
}
@@ -2772,6 +2777,13 @@ void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
}
+void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+ __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ context()->Plug(r0);
+ return;
+}
+
+
void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
Handle<String> name = expr->name();
if (name->length() > 0 && name->Get(0) == '_') {
Oops, something went wrong.

0 comments on commit 8211e79

Please sign in to comment.