v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lithium.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_LITHIUM_H_
29 #define V8_LITHIUM_H_
30 
31 #include "allocation.h"
32 #include "hydrogen.h"
33 #include "safepoint-table.h"
34 
35 namespace v8 {
36 namespace internal {
37 
38 #define LITHIUM_OPERAND_LIST(V) \
39  V(ConstantOperand, CONSTANT_OPERAND) \
40  V(StackSlot, STACK_SLOT) \
41  V(DoubleStackSlot, DOUBLE_STACK_SLOT) \
42  V(Register, REGISTER) \
43  V(DoubleRegister, DOUBLE_REGISTER)
44 
45 
46 class LOperand: public ZoneObject {
47  public:
48  enum Kind {
57  };
58 
59  LOperand() : value_(KindField::encode(INVALID)) { }
60 
61  Kind kind() const { return KindField::decode(value_); }
62  int index() const { return static_cast<int>(value_) >> kKindFieldWidth; }
63 #define LITHIUM_OPERAND_PREDICATE(name, type) \
64  bool Is##name() const { return kind() == type; }
69 #undef LITHIUM_OPERAND_PREDICATE
70  bool Equals(LOperand* other) const { return value_ == other->value_; }
71 
72  void PrintTo(StringStream* stream);
73  void ConvertTo(Kind kind, int index) {
74  value_ = KindField::encode(kind);
75  value_ |= index << kKindFieldWidth;
76  ASSERT(this->index() == index);
77  }
78 
79  // Calls SetUpCache()/TearDownCache() for each subclass.
80  static void SetUpCaches();
81  static void TearDownCaches();
82 
83  protected:
84  static const int kKindFieldWidth = 3;
85  class KindField : public BitField<Kind, 0, kKindFieldWidth> { };
86 
87  LOperand(Kind kind, int index) { ConvertTo(kind, index); }
88 
89  unsigned value_;
90 };
91 
92 
93 class LUnallocated: public LOperand {
94  public:
95  enum Policy {
97  ANY,
104  };
105 
106  // Lifetime of operand inside the instruction.
107  enum Lifetime {
108  // USED_AT_START operand is guaranteed to be live only at
109  // instruction start. Register allocator is free to assign the same register
110  // to some other operand used inside instruction (i.e. temporary or
111  // output).
113 
114  // USED_AT_END operand is treated as live until the end of
115  // instruction. This means that register allocator will not reuse it's
116  // register for any other operand inside instruction.
118  };
119 
121  Initialize(policy, 0, USED_AT_END);
122  }
123 
125  Initialize(policy, fixed_index, USED_AT_END);
126  }
127 
129  Initialize(policy, 0, lifetime);
130  }
131 
132  // The superclass has a KindField. Some policies have a signed fixed
133  // index in the upper bits.
134  static const int kPolicyWidth = 3;
135  static const int kLifetimeWidth = 1;
136  static const int kVirtualRegisterWidth = 15;
137 
138  static const int kPolicyShift = kKindFieldWidth;
141  static const int kFixedIndexShift =
143  static const int kFixedIndexWidth = 32 - kFixedIndexShift;
145 
146  class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { };
147 
149  : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> {
150  };
151 
153  : public BitField<unsigned,
154  kVirtualRegisterShift,
155  kVirtualRegisterWidth> {
156  };
157 
159  static const int kMaxFixedIndex = (1 << kFixedIndexWidth) - 1;
160  static const int kMinFixedIndex = -(1 << kFixedIndexWidth);
161 
162  bool HasAnyPolicy() const {
163  return policy() == ANY;
164  }
165  bool HasFixedPolicy() const {
166  return policy() == FIXED_REGISTER ||
168  policy() == FIXED_SLOT;
169  }
170  bool HasRegisterPolicy() const {
172  }
173  bool HasSameAsInputPolicy() const {
174  return policy() == SAME_AS_FIRST_INPUT;
175  }
178  value_ = PolicyField::update(value_, policy);
179  }
180  int fixed_index() const {
181  return static_cast<int>(value_) >> kFixedIndexShift;
182  }
183 
184  int virtual_register() const {
186  }
187 
188  void set_virtual_register(unsigned id) {
190  }
191 
193  LUnallocated* result = new(zone) LUnallocated(ANY);
195  return result;
196  }
197 
198  static LUnallocated* cast(LOperand* op) {
199  ASSERT(op->IsUnallocated());
200  return reinterpret_cast<LUnallocated*>(op);
201  }
202 
203  bool IsUsedAtStart() {
205  }
206 
207  private:
208  void Initialize(Policy policy, int fixed_index, Lifetime lifetime) {
209  value_ |= PolicyField::encode(policy);
210  value_ |= LifetimeField::encode(lifetime);
211  value_ |= fixed_index << kFixedIndexShift;
212  ASSERT(this->fixed_index() == fixed_index);
213  }
214 };
215 
216 
217 class LMoveOperands BASE_EMBEDDED {
218  public:
219  LMoveOperands(LOperand* source, LOperand* destination)
220  : source_(source), destination_(destination) {
221  }
222 
223  LOperand* source() const { return source_; }
224  void set_source(LOperand* operand) { source_ = operand; }
225 
226  LOperand* destination() const { return destination_; }
227  void set_destination(LOperand* operand) { destination_ = operand; }
228 
229  // The gap resolver marks moves as "in-progress" by clearing the
230  // destination (but not the source).
231  bool IsPending() const {
232  return destination_ == NULL && source_ != NULL;
233  }
234 
235  // True if this move a move into the given destination operand.
236  bool Blocks(LOperand* operand) const {
237  return !IsEliminated() && source()->Equals(operand);
238  }
239 
240  // A move is redundant if it's been eliminated, if its source and
241  // destination are the same, or if its destination is unneeded.
242  bool IsRedundant() const {
243  return IsEliminated() || source_->Equals(destination_) || IsIgnored();
244  }
245 
246  bool IsIgnored() const {
247  return destination_ != NULL && destination_->IsIgnored();
248  }
249 
250  // We clear both operands to indicate move that's been eliminated.
251  void Eliminate() { source_ = destination_ = NULL; }
252  bool IsEliminated() const {
253  ASSERT(source_ != NULL || destination_ == NULL);
254  return source_ == NULL;
255  }
256 
257  private:
258  LOperand* source_;
259  LOperand* destination_;
260 };
261 
262 
263 class LConstantOperand: public LOperand {
264  public:
265  static LConstantOperand* Create(int index, Zone* zone) {
266  ASSERT(index >= 0);
267  if (index < kNumCachedOperands) return &cache[index];
268  return new(zone) LConstantOperand(index);
269  }
270 
272  ASSERT(op->IsConstantOperand());
273  return reinterpret_cast<LConstantOperand*>(op);
274  }
275 
276  static void SetUpCache();
277  static void TearDownCache();
278 
279  private:
280  static const int kNumCachedOperands = 128;
281  static LConstantOperand* cache;
282 
283  LConstantOperand() : LOperand() { }
284  explicit LConstantOperand(int index) : LOperand(CONSTANT_OPERAND, index) { }
285 };
286 
287 
288 class LArgument: public LOperand {
289  public:
290  explicit LArgument(int index) : LOperand(ARGUMENT, index) { }
291 
292  static LArgument* cast(LOperand* op) {
293  ASSERT(op->IsArgument());
294  return reinterpret_cast<LArgument*>(op);
295  }
296 };
297 
298 
299 class LStackSlot: public LOperand {
300  public:
301  static LStackSlot* Create(int index, Zone* zone) {
302  ASSERT(index >= 0);
303  if (index < kNumCachedOperands) return &cache[index];
304  return new(zone) LStackSlot(index);
305  }
306 
307  static LStackSlot* cast(LOperand* op) {
308  ASSERT(op->IsStackSlot());
309  return reinterpret_cast<LStackSlot*>(op);
310  }
311 
312  static void SetUpCache();
313  static void TearDownCache();
314 
315  private:
316  static const int kNumCachedOperands = 128;
317  static LStackSlot* cache;
318 
319  LStackSlot() : LOperand() { }
320  explicit LStackSlot(int index) : LOperand(STACK_SLOT, index) { }
321 };
322 
323 
324 class LDoubleStackSlot: public LOperand {
325  public:
326  static LDoubleStackSlot* Create(int index, Zone* zone) {
327  ASSERT(index >= 0);
328  if (index < kNumCachedOperands) return &cache[index];
329  return new(zone) LDoubleStackSlot(index);
330  }
331 
333  ASSERT(op->IsStackSlot());
334  return reinterpret_cast<LDoubleStackSlot*>(op);
335  }
336 
337  static void SetUpCache();
338  static void TearDownCache();
339 
340  private:
341  static const int kNumCachedOperands = 128;
342  static LDoubleStackSlot* cache;
343 
344  LDoubleStackSlot() : LOperand() { }
345  explicit LDoubleStackSlot(int index) : LOperand(DOUBLE_STACK_SLOT, index) { }
346 };
347 
348 
349 class LRegister: public LOperand {
350  public:
351  static LRegister* Create(int index, Zone* zone) {
352  ASSERT(index >= 0);
353  if (index < kNumCachedOperands) return &cache[index];
354  return new(zone) LRegister(index);
355  }
356 
357  static LRegister* cast(LOperand* op) {
358  ASSERT(op->IsRegister());
359  return reinterpret_cast<LRegister*>(op);
360  }
361 
362  static void SetUpCache();
363  static void TearDownCache();
364 
365  private:
366  static const int kNumCachedOperands = 16;
367  static LRegister* cache;
368 
369  LRegister() : LOperand() { }
370  explicit LRegister(int index) : LOperand(REGISTER, index) { }
371 };
372 
373 
374 class LDoubleRegister: public LOperand {
375  public:
376  static LDoubleRegister* Create(int index, Zone* zone) {
377  ASSERT(index >= 0);
378  if (index < kNumCachedOperands) return &cache[index];
379  return new(zone) LDoubleRegister(index);
380  }
381 
383  ASSERT(op->IsDoubleRegister());
384  return reinterpret_cast<LDoubleRegister*>(op);
385  }
386 
387  static void SetUpCache();
388  static void TearDownCache();
389 
390  private:
391  static const int kNumCachedOperands = 16;
392  static LDoubleRegister* cache;
393 
394  LDoubleRegister() : LOperand() { }
395  explicit LDoubleRegister(int index) : LOperand(DOUBLE_REGISTER, index) { }
396 };
397 
398 
399 class LParallelMove : public ZoneObject {
400  public:
401  explicit LParallelMove(Zone* zone) : move_operands_(4, zone) { }
402 
403  void AddMove(LOperand* from, LOperand* to, Zone* zone) {
404  move_operands_.Add(LMoveOperands(from, to), zone);
405  }
406 
407  bool IsRedundant() const;
408 
410  return &move_operands_;
411  }
412 
413  void PrintDataTo(StringStream* stream) const;
414 
415  private:
416  ZoneList<LMoveOperands> move_operands_;
417 };
418 
419 
420 class LPointerMap: public ZoneObject {
421  public:
422  explicit LPointerMap(int position, Zone* zone)
423  : pointer_operands_(8, zone),
424  untagged_operands_(0, zone),
425  position_(position),
426  lithium_position_(-1) { }
427 
429  for (int i = 0; i < untagged_operands_.length(); ++i) {
430  RemovePointer(untagged_operands_[i]);
431  }
432  untagged_operands_.Clear();
433  return &pointer_operands_;
434  }
435  int position() const { return position_; }
436  int lithium_position() const { return lithium_position_; }
437 
438  void set_lithium_position(int pos) {
439  ASSERT(lithium_position_ == -1);
440  lithium_position_ = pos;
441  }
442 
443  void RecordPointer(LOperand* op, Zone* zone);
444  void RemovePointer(LOperand* op);
445  void RecordUntagged(LOperand* op, Zone* zone);
446  void PrintTo(StringStream* stream);
447 
448  private:
449  ZoneList<LOperand*> pointer_operands_;
450  ZoneList<LOperand*> untagged_operands_;
451  int position_;
452  int lithium_position_;
453 };
454 
455 
456 class LEnvironment: public ZoneObject {
457  public:
461  int parameter_count,
462  int argument_count,
463  int value_count,
466  Zone* zone)
467  : closure_(closure),
468  frame_type_(frame_type),
469  arguments_stack_height_(argument_count),
470  deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
471  translation_index_(-1),
472  ast_id_(ast_id),
473  parameter_count_(parameter_count),
474  pc_offset_(-1),
475  values_(value_count, zone),
476  is_tagged_(value_count, zone),
477  is_uint32_(value_count, zone),
478  spilled_registers_(NULL),
479  spilled_double_registers_(NULL),
480  outer_(outer),
481  entry_(entry),
482  zone_(zone) { }
483 
484  Handle<JSFunction> closure() const { return closure_; }
485  FrameType frame_type() const { return frame_type_; }
486  int arguments_stack_height() const { return arguments_stack_height_; }
487  int deoptimization_index() const { return deoptimization_index_; }
488  int translation_index() const { return translation_index_; }
489  BailoutId ast_id() const { return ast_id_; }
490  int parameter_count() const { return parameter_count_; }
491  int pc_offset() const { return pc_offset_; }
492  LOperand** spilled_registers() const { return spilled_registers_; }
494  return spilled_double_registers_;
495  }
496  const ZoneList<LOperand*>* values() const { return &values_; }
497  LEnvironment* outer() const { return outer_; }
498  HEnterInlined* entry() { return entry_; }
499 
500  void AddValue(LOperand* operand,
501  Representation representation,
502  bool is_uint32) {
503  values_.Add(operand, zone());
504  if (representation.IsTagged()) {
505  ASSERT(!is_uint32);
506  is_tagged_.Add(values_.length() - 1);
507  }
508 
509  if (is_uint32) {
510  is_uint32_.Add(values_.length() - 1);
511  }
512  }
513 
514  bool HasTaggedValueAt(int index) const {
515  return is_tagged_.Contains(index);
516  }
517 
518  bool HasUint32ValueAt(int index) const {
519  return is_uint32_.Contains(index);
520  }
521 
523  int translation_index,
524  int pc_offset) {
526  deoptimization_index_ = deoptimization_index;
527  translation_index_ = translation_index;
528  pc_offset_ = pc_offset;
529  }
530  bool HasBeenRegistered() const {
531  return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
532  }
533 
534  void SetSpilledRegisters(LOperand** registers,
535  LOperand** double_registers) {
536  spilled_registers_ = registers;
537  spilled_double_registers_ = double_registers;
538  }
539 
540  void PrintTo(StringStream* stream);
541 
542  Zone* zone() const { return zone_; }
543 
544  private:
545  Handle<JSFunction> closure_;
546  FrameType frame_type_;
547  int arguments_stack_height_;
548  int deoptimization_index_;
549  int translation_index_;
550  BailoutId ast_id_;
551  int parameter_count_;
552  int pc_offset_;
553  ZoneList<LOperand*> values_;
554  BitVector is_tagged_;
555  BitVector is_uint32_;
556 
557  // Allocation index indexed arrays of spill slot operands for registers
558  // that are also in spill slots at an OSR entry. NULL for environments
559  // that do not correspond to an OSR entry.
560  LOperand** spilled_registers_;
561  LOperand** spilled_double_registers_;
562 
563  LEnvironment* outer_;
564  HEnterInlined* entry_;
565 
566  Zone* zone_;
567 };
568 
569 
570 // Iterates over the non-null, non-constant operands in an environment.
571 class ShallowIterator BASE_EMBEDDED {
572  public:
574  : env_(env),
575  limit_(env != NULL ? env->values()->length() : 0),
576  current_(0) {
577  SkipUninteresting();
578  }
579 
580  bool Done() { return current_ >= limit_; }
581 
583  ASSERT(!Done());
584  return env_->values()->at(current_);
585  }
586 
587  void Advance() {
588  ASSERT(!Done());
589  ++current_;
590  SkipUninteresting();
591  }
592 
593  LEnvironment* env() { return env_; }
594 
595  private:
596  bool ShouldSkip(LOperand* op) {
597  return op == NULL || op->IsConstantOperand() || op->IsArgument();
598  }
599 
600  // Skip until something interesting, beginning with and including current_.
601  void SkipUninteresting() {
602  while (current_ < limit_ && ShouldSkip(env_->values()->at(current_))) {
603  ++current_;
604  }
605  }
606 
607  LEnvironment* env_;
608  int limit_;
609  int current_;
610 };
611 
612 
613 // Iterator for non-null, non-constant operands incl. outer environments.
614 class DeepIterator BASE_EMBEDDED {
615  public:
616  explicit DeepIterator(LEnvironment* env)
617  : current_iterator_(env) {
618  SkipUninteresting();
619  }
620 
621  bool Done() { return current_iterator_.Done(); }
622 
624  ASSERT(!current_iterator_.Done());
625  return current_iterator_.Current();
626  }
627 
628  void Advance() {
629  current_iterator_.Advance();
630  SkipUninteresting();
631  }
632 
633  private:
634  void SkipUninteresting() {
635  while (current_iterator_.env() != NULL && current_iterator_.Done()) {
636  current_iterator_ = ShallowIterator(current_iterator_.env()->outer());
637  }
638  }
639 
640  ShallowIterator current_iterator_;
641 };
642 
643 
644 class LPlatformChunk;
645 class LGap;
646 class LLabel;
647 
648 // Superclass providing data and behavior common to all the
649 // arch-specific LPlatformChunk classes.
650 class LChunk: public ZoneObject {
651  public:
652  static LChunk* NewChunk(HGraph* graph);
653 
654  void AddInstruction(LInstruction* instruction, HBasicBlock* block);
656  HConstant* LookupConstant(LConstantOperand* operand) const;
658 
659  int ParameterAt(int index);
660  int GetParameterStackSlot(int index) const;
661  int spill_slot_count() const { return spill_slot_count_; }
662  CompilationInfo* info() const { return info_; }
663  HGraph* graph() const { return graph_; }
664  const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
665  void AddGapMove(int index, LOperand* from, LOperand* to);
666  LGap* GetGapAt(int index) const;
667  bool IsGapAt(int index) const;
668  int NearestGapPos(int index) const;
669  void MarkEmptyBlocks();
670  const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
671  LLabel* GetLabel(int block_id) const;
672  int LookupDestination(int block_id) const;
673  Label* GetAssemblyLabel(int block_id) const;
674 
676  return &inlined_closures_;
677  }
678 
680  inlined_closures_.Add(closure, zone());
681  }
682 
683  Zone* zone() const { return info_->zone(); }
684 
686 
687  protected:
689  : spill_slot_count_(0),
690  info_(info),
691  graph_(graph),
692  instructions_(32, graph->zone()),
693  pointer_maps_(8, graph->zone()),
694  inlined_closures_(1, graph->zone()) { }
695 
697 
698  private:
699  CompilationInfo* info_;
700  HGraph* const graph_;
701  ZoneList<LInstruction*> instructions_;
702  ZoneList<LPointerMap*> pointer_maps_;
703  ZoneList<Handle<JSFunction> > inlined_closures_;
704 };
705 
706 
707 int ElementsKindToShiftSize(ElementsKind elements_kind);
708 
709 
710 } } // namespace v8::internal
711 
712 #endif // V8_LITHIUM_H_
static const int kFixedIndexShift
Definition: lithium.h:141
int index() const
Definition: lithium.h:62
static LUnallocated * cast(LOperand *op)
Definition: lithium.h:198
bool IsPending() const
Definition: lithium.h:231
const ZoneList< LMoveOperands > * move_operands() const
Definition: lithium.h:409
static LArgument * cast(LOperand *op)
Definition: lithium.h:292
static LConstantOperand * Create(int index, Zone *zone)
Definition: lithium.h:265
bool IsRedundant() const
Definition: lithium.h:242
void AddValue(LOperand *operand, Representation representation, bool is_uint32)
Definition: lithium.h:500
void SetSpilledRegisters(LOperand **registers, LOperand **double_registers)
Definition: lithium.h:534
int GetParameterStackSlot(int index) const
Definition: lithium.cc:341
DeepIterator(LEnvironment *env)
Definition: lithium.h:616
const ZoneList< LOperand * > * GetNormalizedOperands()
Definition: lithium.h:428
static LDoubleRegister * cast(LOperand *op)
Definition: lithium.h:382
static void TearDownCaches()
Definition: lithium.cc:139
int lithium_position() const
Definition: lithium.h:436
LUnallocated(Policy policy)
Definition: lithium.h:120
LParallelMove(Zone *zone)
Definition: lithium.h:401
LEnvironment * outer() const
Definition: lithium.h:497
static const int kVirtualRegisterWidth
Definition: lithium.h:136
int ParameterAt(int index)
Definition: lithium.cc:353
LOperand(Kind kind, int index)
Definition: lithium.h:87
int current_
static const int kPolicyShift
Definition: lithium.h:138
void RemovePointer(LOperand *op)
Definition: lithium.cc:199
LUnallocated * CopyUnconstrained(Zone *zone)
Definition: lithium.h:192
LLabel * GetLabel(int block_id) const
Definition: lithium.cc:260
Handle< Code > Codegen()
Definition: lithium.cc:417
#define ASSERT(condition)
Definition: checks.h:270
bool HasSameAsInputPolicy() const
Definition: lithium.h:173
HEnterInlined * entry()
Definition: lithium.h:498
static void SetUpCaches()
Definition: lithium.cc:132
bool HasRegisterPolicy() const
Definition: lithium.h:170
static LDoubleRegister * Create(int index, Zone *zone)
Definition: lithium.h:376
void PrintTo(StringStream *stream)
Definition: lithium.cc:220
bool is_uint32(int64_t x)
Definition: assembler-x64.h:48
static uint32_t update(uint32_t previous, Policyvalue)
Definition: utils.h:268
int position() const
Definition: lithium.h:435
LChunk(CompilationInfo *info, HGraph *graph)
Definition: lithium.h:688
bool Equals(LOperand *other) const
Definition: lithium.h:70
bool HasBeenRegistered() const
Definition: lithium.h:530
void RecordUntagged(LOperand *op, Zone *zone)
Definition: lithium.cc:212
int translation_index() const
Definition: lithium.h:488
LOperand * destination() const
Definition: lithium.h:226
LGap * GetGapAt(int index) const
Definition: lithium.cc:360
bool Contains(int i) const
Definition: data-flow.h:122
void set_virtual_register(unsigned id)
Definition: lithium.h:188
static void TearDownCache()
#define LITHIUM_OPERAND_PREDICATE(name, type)
Definition: lithium.h:63
int virtual_register() const
Definition: lithium.h:184
static void SetUpCache()
void PrintTo(StringStream *stream)
Definition: lithium.cc:175
static const int kMaxVirtualRegisters
Definition: lithium.h:158
void set_source(LOperand *operand)
Definition: lithium.h:224
void ConvertTo(Kind kind, int index)
Definition: lithium.h:73
Policy policy() const
Definition: lithium.h:176
LMoveOperands(LOperand *source, LOperand *destination)
Definition: lithium.h:219
void AddMove(LOperand *from, LOperand *to, Zone *zone)
Definition: lithium.h:403
static const int kLifetimeWidth
Definition: lithium.h:135
static LDoubleStackSlot * Create(int index, Zone *zone)
Definition: lithium.h:326
void RecordPointer(LOperand *op, Zone *zone)
Definition: lithium.cc:191
int spill_slot_count() const
Definition: lithium.h:661
const ZoneList< LOperand * > * values() const
Definition: lithium.h:496
static LConstantOperand * cast(LOperand *op)
Definition: lithium.h:271
Kind kind() const
Definition: lithium.h:61
bool IsRedundant() const
Definition: lithium.cc:146
bool Blocks(LOperand *operand) const
Definition: lithium.h:236
BailoutId ast_id() const
Definition: lithium.h:489
Handle< JSFunction > closure() const
Definition: lithium.h:484
static const int kPolicyWidth
Definition: lithium.h:134
static Kind decode(uint32_t value)
Definition: utils.h:273
static LChunk * NewChunk(HGraph *graph)
Definition: lithium.cc:393
Zone * zone() const
Definition: lithium.h:683
LEnvironment * env()
Definition: lithium.h:593
static const int kVirtualRegisterShift
Definition: lithium.h:140
LArgument(int index)
Definition: lithium.h:290
bool IsIgnored() const
Definition: lithium.h:246
#define BASE_EMBEDDED
Definition: allocation.h:68
Zone * zone() const
Definition: lithium.h:542
LPointerMap(int position, Zone *zone)
Definition: lithium.h:422
int ElementsKindToShiftSize(ElementsKind elements_kind)
Definition: lithium.cc:230
int deoptimization_index() const
Definition: lithium.h:487
static LStackSlot * Create(int index, Zone *zone)
Definition: lithium.h:301
LOperand ** spilled_double_registers() const
Definition: lithium.h:493
static const int kMaxFixedIndex
Definition: lithium.h:159
bool IsGapAt(int index) const
Definition: lithium.cc:365
static LDoubleStackSlot * cast(LOperand *op)
Definition: lithium.h:332
int parameter_count() const
Definition: lithium.h:490
void AddInstruction(LInstruction *instruction, HBasicBlock *block)
Definition: lithium.cc:317
HGraph * graph() const
Definition: lithium.h:663
ShallowIterator(LEnvironment *env)
Definition: lithium.h:573
const ZoneList< Handle< JSFunction > > * inlined_closures() const
Definition: lithium.h:675
static const int kLifetimeShift
Definition: lithium.h:139
bool HasTaggedValueAt(int index) const
Definition: lithium.h:514
void PrintDataTo(StringStream *stream) const
Definition: lithium.cc:154
LOperand ** spilled_registers() const
Definition: lithium.h:492
CompilationInfo * info() const
Definition: lithium.h:662
LEnvironment(Handle< JSFunction > closure, FrameType frame_type, BailoutId ast_id, int parameter_count, int argument_count, int value_count, LEnvironment *outer, HEnterInlined *entry, Zone *zone)
Definition: lithium.h:458
int fixed_index() const
Definition: lithium.h:180
int pc_offset() const
Definition: lithium.h:491
void AddGapMove(int index, LOperand *from, LOperand *to)
Definition: lithium.cc:376
const ZoneList< LPointerMap * > * pointer_maps() const
Definition: lithium.h:670
bool HasUint32ValueAt(int index) const
Definition: lithium.h:518
LConstantOperand * DefineConstantOperand(HConstant *constant)
Definition: lithium.cc:336
void set_policy(Policy policy)
Definition: lithium.h:177
bool HasFixedPolicy() const
Definition: lithium.h:165
LOperand * source() const
Definition: lithium.h:223
static LRegister * Create(int index, Zone *zone)
Definition: lithium.h:351
bool IsEliminated() const
Definition: lithium.h:252
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:38
void MarkEmptyBlocks()
Definition: lithium.cc:281
void Register(int deoptimization_index, int translation_index, int pc_offset)
Definition: lithium.h:522
bool HasAnyPolicy() const
Definition: lithium.h:162
Representation LookupLiteralRepresentation(LConstantOperand *operand) const
Definition: lithium.cc:387
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
Definition: flags.cc:301
Label * GetAssemblyLabel(int block_id) const
Definition: lithium.cc:275
int NearestGapPos(int index) const
Definition: lithium.cc:370
FrameType frame_type() const
Definition: lithium.h:485
static LStackSlot * cast(LOperand *op)
Definition: lithium.h:307
int LookupDestination(int block_id) const
Definition: lithium.cc:267
static const int kFixedIndexWidth
Definition: lithium.h:143
static const int kMinFixedIndex
Definition: lithium.h:160
LUnallocated(Policy policy, int fixed_index)
Definition: lithium.h:124
LUnallocated(Policy policy, Lifetime lifetime)
Definition: lithium.h:128
static void SetUpCache()
#define LITHIUM_OPERAND_LIST(V)
Definition: lithium.h:38
void set_lithium_position(int pos)
Definition: lithium.h:438
void set_destination(LOperand *operand)
Definition: lithium.h:227
static LRegister * cast(LOperand *op)
Definition: lithium.h:357
HConstant * LookupConstant(LConstantOperand *operand) const
Definition: lithium.cc:382
static void TearDownCache()
void PrintTo(StringStream *stream)
Definition: lithium.cc:52
STATIC_ASSERT(kFixedIndexWidth > 5)
int arguments_stack_height() const
Definition: lithium.h:486
const ZoneList< LInstruction * > * instructions() const
Definition: lithium.h:664
static const int kKindFieldWidth
Definition: lithium.h:84
void AddInlinedClosure(Handle< JSFunction > closure)
Definition: lithium.h:679