HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Nougat 7.0
|
7.0.0_r31
下载
查看原文件
收藏
根目录
external
v8
src
compiler.h
// Copyright 2012 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_COMPILER_H_ #define V8_COMPILER_H_ #include "src/allocation.h" #include "src/ast/ast.h" #include "src/bailout-reason.h" #include "src/compilation-dependencies.h" #include "src/signature.h" #include "src/zone.h" namespace v8 { namespace internal { class AstValueFactory; class HydrogenCodeStub; 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
(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
(InliningIdField::update(value_, inlining_id)); } } uint32_t raw() const { return value_; } private: static const uint32_t kNoPosition = static_cast
(RelocInfo::kNoPosition); typedef BitField
InliningIdField; // Offset from the start of the inlined function. typedef BitField
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) : parent_id(parent_id), inline_position(inline_position), script_id(script_id), start_position(start_position) {} int parent_id; SourcePosition inline_position; int script_id; int start_position; std::vector
deopt_pc_offsets; static const int kNoParentId = -1; }; // CompilationInfo encapsulates some information known at compile time. It // is constructed based on the resources available at compile-time. class CompilationInfo { public: // Various configuration flags for a compilation, as well as some properties // of the compiled code produced by a compilation. enum Flag { kDeferredCalling = 1 << 0, kNonDeferredCalling = 1 << 1, kSavesCallerDoubles = 1 << 2, kRequiresFrame = 1 << 3, kMustNotHaveEagerFrame = 1 << 4, kDeoptimizationSupport = 1 << 5, kDebug = 1 << 6, kSerializing = 1 << 7, kFunctionContextSpecializing = 1 << 8, kFrameSpecializing = 1 << 9, kNativeContextSpecializing = 1 << 10, kInliningEnabled = 1 << 11, kTypingEnabled = 1 << 12, kDisableFutureOptimization = 1 << 13, kSplittingEnabled = 1 << 14, kDeoptimizationEnabled = 1 << 16, kSourcePositionsEnabled = 1 << 17, kFirstCompile = 1 << 18, }; explicit CompilationInfo(ParseInfo* parse_info); CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone); virtual ~CompilationInfo(); ParseInfo* parse_info() const { return parse_info_; } // ----------------------------------------------------------- // TODO(titzer): inline and delete accessors of ParseInfo // ----------------------------------------------------------- Handle
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册