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

Unified Diff: src/compiler.h

Issue 1581083009: Move SourcePosition into separate header file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Include what you use. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index 9b439397c3c18f25503787d7476edff9ca95ec56..bda2f26c3e0469e89f11b7c83277a87d501a4af7 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -10,79 +10,18 @@
#include "src/bailout-reason.h"
#include "src/compilation-dependencies.h"
#include "src/signature.h"
+#include "src/source-position.h"
#include "src/zone.h"
namespace v8 {
namespace internal {
-class AstValueFactory;
-class HydrogenCodeStub;
+// Forward declarations.
class JavaScriptFrame;
class ParseInfo;
class ScriptData;
-// This class encapsulates encoding and decoding of sources positions from
-// which hydrogen values originated.
-// When FLAG_track_hydrogen_positions is set this object encodes the
-// identifier of the inlining and absolute offset from the start of the
-// inlined function.
-// When the flag is not set we simply track absolute offset from the
-// script start.
-class SourcePosition {
- public:
- static SourcePosition Unknown() {
- return SourcePosition::FromRaw(kNoPosition);
- }
-
- bool IsUnknown() const { return value_ == kNoPosition; }
-
- uint32_t position() const { return PositionField::decode(value_); }
- void set_position(uint32_t position) {
- if (FLAG_hydrogen_track_positions) {
- value_ = static_cast<uint32_t>(PositionField::update(value_, position));
- } else {
- value_ = position;
- }
- }
-
- uint32_t inlining_id() const { return InliningIdField::decode(value_); }
- void set_inlining_id(uint32_t inlining_id) {
- if (FLAG_hydrogen_track_positions) {
- value_ =
- static_cast<uint32_t>(InliningIdField::update(value_, inlining_id));
- }
- }
-
- uint32_t raw() const { return value_; }
-
- private:
- static const uint32_t kNoPosition =
- static_cast<uint32_t>(RelocInfo::kNoPosition);
- typedef BitField<uint32_t, 0, 9> InliningIdField;
-
- // Offset from the start of the inlined function.
- typedef BitField<uint32_t, 9, 23> PositionField;
-
- friend class HPositionInfo;
- friend class Deoptimizer;
-
- static SourcePosition FromRaw(uint32_t raw_position) {
- SourcePosition position;
- position.value_ = raw_position;
- return position;
- }
-
- // If FLAG_hydrogen_track_positions is set contains bitfields InliningIdField
- // and PositionField.
- // Otherwise contains absolute offset from the script start.
- uint32_t value_;
-};
-
-
-std::ostream& operator<<(std::ostream& os, const SourcePosition& p);
-
-
struct InlinedFunctionInfo {
InlinedFunctionInfo(int parent_id, SourcePosition inline_position,
int script_id, int start_position)
« no previous file with comments | « src/assembler.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698