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

Side by Side Diff: include/v8.h

Issue 588623002: Implemented GetSample like POSIX backtrace() Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Printing return value of GetSample (for ARM try server) Created 6 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 bool IsEval() const; 1408 bool IsEval() const;
1409 1409
1410 /** 1410 /**
1411 * Returns whether or not the associated function is called as a 1411 * Returns whether or not the associated function is called as a
1412 * constructor via "new". 1412 * constructor via "new".
1413 */ 1413 */
1414 bool IsConstructor() const; 1414 bool IsConstructor() const;
1415 }; 1415 };
1416 1416
1417 1417
1418 struct RegisterState {
1419 RegisterState() : pc(NULL), sp(NULL), fp(NULL) {}
1420 void* pc; // Instruction pointer.
1421 void* sp; // Stack pointer.
1422 void* fp; // Frame pointer.
1423 };
1424
1425
1418 /** 1426 /**
1419 * A JSON Parser. 1427 * A JSON Parser.
1420 */ 1428 */
1421 class V8_EXPORT JSON { 1429 class V8_EXPORT JSON {
1422 public: 1430 public:
1423 /** 1431 /**
1424 * Tries to parse the string |json_string| and returns it as value if 1432 * Tries to parse the string |json_string| and returns it as value if
1425 * successful. 1433 * successful.
1426 * 1434 *
1427 * \param json_string The string to parse. 1435 * \param json_string The string to parse.
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
4541 * are in the range of 0 - GetNumberOfDataSlots() - 1. 4549 * are in the range of 0 - GetNumberOfDataSlots() - 1.
4542 */ 4550 */
4543 V8_INLINE static uint32_t GetNumberOfDataSlots(); 4551 V8_INLINE static uint32_t GetNumberOfDataSlots();
4544 4552
4545 /** 4553 /**
4546 * Get statistics about the heap memory usage. 4554 * Get statistics about the heap memory usage.
4547 */ 4555 */
4548 void GetHeapStatistics(HeapStatistics* heap_statistics); 4556 void GetHeapStatistics(HeapStatistics* heap_statistics);
4549 4557
4550 /** 4558 /**
4559 * Get a sample from the isolate.
4560 * Fills out the pointer array provided in buffer
4561 * up to depth elements with the stack trace pointers.
4562 *
4563 * \param state RegisterState which contains values of program counter (pc),
4564 * stack pointer (sp), and frame pointer (fp)
4565 * \param buffer The pointer array to be filled.
4566 * \return captured stack depth on success
4567 * -1 on failure.
4568 * \note GetSample should only be called when the JS thread is paused or
4569 * interrupted. If that is not the case,
4570 * GetSample behaviour is undefined.
4571 */
4572 int GetSample(const RegisterState& state, void** buffer, unsigned int depth);
4573
4574 /**
4551 * Adjusts the amount of registered external memory. Used to give V8 an 4575 * Adjusts the amount of registered external memory. Used to give V8 an
4552 * indication of the amount of externally allocated memory that is kept alive 4576 * indication of the amount of externally allocated memory that is kept alive
4553 * by JavaScript objects. V8 uses this to decide when to perform global 4577 * by JavaScript objects. V8 uses this to decide when to perform global
4554 * garbage collections. Registering externally allocated memory will trigger 4578 * garbage collections. Registering externally allocated memory will trigger
4555 * global garbage collections more often than it would otherwise in an attempt 4579 * global garbage collections more often than it would otherwise in an attempt
4556 * to garbage collect the JavaScript objects that keep the externally 4580 * to garbage collect the JavaScript objects that keep the externally
4557 * allocated memory alive. 4581 * allocated memory alive.
4558 * 4582 *
4559 * \param change_in_bytes the change in externally allocated memory that is 4583 * \param change_in_bytes the change in externally allocated memory that is
4560 * kept alive by JavaScript objects. 4584 * kept alive by JavaScript objects.
(...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after
6949 */ 6973 */
6950 6974
6951 6975
6952 } // namespace v8 6976 } // namespace v8
6953 6977
6954 6978
6955 #undef TYPE_CHECK 6979 #undef TYPE_CHECK
6956 6980
6957 6981
6958 #endif // V8_H_ 6982 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698