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

Side by Side Diff: include/v8.h

Issue 1909353002: [wasm] Make wasm info available on the stack trace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-3
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 */ 1521 */
1522 bool IsSharedCrossOrigin() const; 1522 bool IsSharedCrossOrigin() const;
1523 bool IsOpaque() const; 1523 bool IsOpaque() const;
1524 1524
1525 // TODO(1245381): Print to a string instead of on a FILE. 1525 // TODO(1245381): Print to a string instead of on a FILE.
1526 static void PrintCurrentStackTrace(Isolate* isolate, FILE* out); 1526 static void PrintCurrentStackTrace(Isolate* isolate, FILE* out);
1527 1527
1528 static const int kNoLineNumberInfo = 0; 1528 static const int kNoLineNumberInfo = 0;
1529 static const int kNoColumnInfo = 0; 1529 static const int kNoColumnInfo = 0;
1530 static const int kNoScriptIdInfo = 0; 1530 static const int kNoScriptIdInfo = 0;
1531 static const uint32_t kNoWasmByteOffsetInfo = static_cast<uint32_t>(-1);
1531 }; 1532 };
1532 1533
1533 1534
1534 /** 1535 /**
1535 * Representation of a JavaScript stack trace. The information collected is a 1536 * Representation of a JavaScript stack trace. The information collected is a
1536 * snapshot of the execution stack and the information remains valid after 1537 * snapshot of the execution stack and the information remains valid after
1537 * execution continues. 1538 * execution continues.
1538 */ 1539 */
1539 class V8_EXPORT StackTrace { 1540 class V8_EXPORT StackTrace {
1540 public: 1541 public:
1541 /** 1542 /**
1542 * Flags that determine what information is placed captured for each 1543 * Flags that determine what information is placed captured for each
1543 * StackFrame when grabbing the current stack trace. 1544 * StackFrame when grabbing the current stack trace.
1544 */ 1545 */
1545 enum StackTraceOptions { 1546 enum StackTraceOptions {
1546 kLineNumber = 1, 1547 kLineNumber = 1,
1547 kColumnOffset = 1 << 1 | kLineNumber, 1548 kColumnOffset = 1 << 1 | kLineNumber,
1548 kScriptName = 1 << 2, 1549 kScriptName = 1 << 2,
1549 kFunctionName = 1 << 3, 1550 kFunctionName = 1 << 3,
1550 kIsEval = 1 << 4, 1551 kIsEval = 1 << 4,
1551 kIsConstructor = 1 << 5, 1552 kIsConstructor = 1 << 5,
1552 kScriptNameOrSourceURL = 1 << 6, 1553 kScriptNameOrSourceURL = 1 << 6,
1553 kScriptId = 1 << 7, 1554 kScriptId = 1 << 7,
1554 kExposeFramesAcrossSecurityOrigins = 1 << 8, 1555 kExposeFramesAcrossSecurityOrigins = 1 << 8,
1555 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName, 1556 kIsWasm = 1 << 9,
1557 kWasmByteOffset = 1 << 10,
1558 kWasmObject = 1 << 11,
1559 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName |
1560 kIsWasm | kWasmByteOffset | kWasmObject,
1556 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL 1561 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
1557 }; 1562 };
1558 1563
1559 /** 1564 /**
1560 * Returns a StackFrame at a particular index. 1565 * Returns a StackFrame at a particular index.
1561 */ 1566 */
1562 Local<StackFrame> GetFrame(uint32_t index) const; 1567 Local<StackFrame> GetFrame(uint32_t index) const;
1563 1568
1564 /** 1569 /**
1565 * Returns the number of StackFrames. 1570 * Returns the number of StackFrames.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 * Returns whether or not the associated function is compiled via a call to 1643 * Returns whether or not the associated function is compiled via a call to
1639 * eval(). 1644 * eval().
1640 */ 1645 */
1641 bool IsEval() const; 1646 bool IsEval() const;
1642 1647
1643 /** 1648 /**
1644 * Returns whether or not the associated function is called as a 1649 * Returns whether or not the associated function is called as a
1645 * constructor via "new". 1650 * constructor via "new".
1646 */ 1651 */
1647 bool IsConstructor() const; 1652 bool IsConstructor() const;
1653
1654 /**
Yang 2016/04/28 13:08:43 Why do we need these three methods? What changes a
1655 * Returns whether or not the associated function is a wasm function.
1656 * Always returns false if kIsWasm was not passed as an option when capturing
1657 * the StackTrace.
1658 */
1659 bool IsWasm() const;
1660
1661 /**
1662 * Returns the wasm object, or undefined if the associated function of the
1663 * frame is no wasm function or if kWasmObject was not passed as an option
1664 * when capturing the StackTrace.
1665 */
1666 Local<Object> GetWasmObject() const;
1667
1668 /**
1669 * Returns the byte offset in the associated wasm function, or
1670 * Message::kNoWasmByteOffsetInfo if the associated function of the frame is
Yang 2016/04/28 13:08:43 Can we just crash with a check failure if the func
1671 * no wasm function.
1672 */
1673 uint32_t GetWasmByteOffset() const;
1648 }; 1674 };
1649 1675
1650 1676
1651 // A StateTag represents a possible state of the VM. 1677 // A StateTag represents a possible state of the VM.
1652 enum StateTag { JS, GC, COMPILER, OTHER, EXTERNAL, IDLE }; 1678 enum StateTag { JS, GC, COMPILER, OTHER, EXTERNAL, IDLE };
1653 1679
1654 1680
1655 // A RegisterState represents the current state of registers used 1681 // A RegisterState represents the current state of registers used
1656 // by the sampling profiler API. 1682 // by the sampling profiler API.
1657 struct RegisterState { 1683 struct RegisterState {
(...skipping 7116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8774 */ 8800 */
8775 8801
8776 8802
8777 } // namespace v8 8803 } // namespace v8
8778 8804
8779 8805
8780 #undef TYPE_CHECK 8806 #undef TYPE_CHECK
8781 8807
8782 8808
8783 #endif // INCLUDE_V8_H_ 8809 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698