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

Side by Side Diff: include/v8.h

Issue 578163002: Implemented GetSample. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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') | 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /** 1418 /**
1419 * Isolate::GetSample collects the current JS execution state as a sample.
1420 * A collected sample contains program counter values.
1421 */
1422 class V8_EXPORT Sample {
1423 public:
1424 enum { kMaxSize = 255u };
1425
1426 Sample() : size_(0) {}
1427 template <class InputIterator>
1428 Sample(InputIterator first, InputIterator last)
loislo 2014/09/18 13:07:28 Looks like it should be a v8 internal constructor
gholap 2014/09/18 23:24:14 We start with: We don't want to expose the private
loislo 2014/09/19 08:58:16 Got it. The only thing that still bother me is the
1429 : size_(0) {
1430 for (; first != last && size_ < kMaxSize; ++first) data_[size_++] = *first;
1431 }
1432
1433 typedef const void* const* const_iterator;
1434 const_iterator begin() const { return &data_[0]; }
1435 const_iterator end() const { return &data_[size_]; }
1436 size_t size() const { return size_; }
1437
1438 private:
1439 const void* data_[kMaxSize];
1440 size_t size_;
1441 };
1442
1443
1444 /**
1419 * A JSON Parser. 1445 * A JSON Parser.
1420 */ 1446 */
1421 class V8_EXPORT JSON { 1447 class V8_EXPORT JSON {
1422 public: 1448 public:
1423 /** 1449 /**
1424 * Tries to parse the string |json_string| and returns it as value if 1450 * Tries to parse the string |json_string| and returns it as value if
1425 * successful. 1451 * successful.
1426 * 1452 *
1427 * \param json_string The string to parse. 1453 * \param json_string The string to parse.
1428 * \return The corresponding value if successfully parsed. 1454 * \return The corresponding value if successfully parsed.
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
4542 * are in the range of 0 - GetNumberOfDataSlots() - 1. 4568 * are in the range of 0 - GetNumberOfDataSlots() - 1.
4543 */ 4569 */
4544 V8_INLINE static uint32_t GetNumberOfDataSlots(); 4570 V8_INLINE static uint32_t GetNumberOfDataSlots();
4545 4571
4546 /** 4572 /**
4547 * Get statistics about the heap memory usage. 4573 * Get statistics about the heap memory usage.
4548 */ 4574 */
4549 void GetHeapStatistics(HeapStatistics* heap_statistics); 4575 void GetHeapStatistics(HeapStatistics* heap_statistics);
4550 4576
4551 /** 4577 /**
4578 * Get a sample from the isolate.
4579 * \param sp Stack pointer.
4580 * \param fp Frame pointer.
4581 * \param sample Pointer to (a pre-allocated) sample which will be filled.
4582 * \note GetSample should only be called when the JS thread is paused or
4583 * interrupted. If that is not the case,
4584 * GetSample behaviour is undefined.
4585 */
4586 void GetSample(void* sp, void* fp, Sample* sample);
4587
4588 /**
4552 * Adjusts the amount of registered external memory. Used to give V8 an 4589 * Adjusts the amount of registered external memory. Used to give V8 an
4553 * indication of the amount of externally allocated memory that is kept alive 4590 * indication of the amount of externally allocated memory that is kept alive
4554 * by JavaScript objects. V8 uses this to decide when to perform global 4591 * by JavaScript objects. V8 uses this to decide when to perform global
4555 * garbage collections. Registering externally allocated memory will trigger 4592 * garbage collections. Registering externally allocated memory will trigger
4556 * global garbage collections more often than it would otherwise in an attempt 4593 * global garbage collections more often than it would otherwise in an attempt
4557 * to garbage collect the JavaScript objects that keep the externally 4594 * to garbage collect the JavaScript objects that keep the externally
4558 * allocated memory alive. 4595 * allocated memory alive.
4559 * 4596 *
4560 * \param change_in_bytes the change in externally allocated memory that is 4597 * \param change_in_bytes the change in externally allocated memory that is
4561 * kept alive by JavaScript objects. 4598 * kept alive by JavaScript objects.
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
6995 */ 7032 */
6996 7033
6997 7034
6998 } // namespace v8 7035 } // namespace v8
6999 7036
7000 7037
7001 #undef TYPE_CHECK 7038 #undef TYPE_CHECK
7002 7039
7003 7040
7004 #endif // V8_H_ 7041 #endif // 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