~james-page/ubuntu/precise/nodejs/0.6.x-merge

« back to all changes in this revision

Viewing changes to deps/v8/src/code-stubs.h

  • Committer: James Page
  • Date: 2012-03-30 12:09:16 UTC
  • mfrom: (7.1.23 sid)
  • Revision ID: james.page@canonical.com-20120330120916-40hfu9o00qr5t87b
* Merge from Debian unstable:
  - New upstream release (LP: #892034).
  - This package is x86/arm only. Update control to match
  - d/patches/2009_increase_test_timeout.patch: Increased default test
    timeout from 60 to 120 seconds to support reliable execution of all
    tests on armhf/armel architectures.
  - d/patches/2005_expected_failing_tests.patch: 
    - Allow racey tests to fail: test-cluster-kill-workers,
      test-child-process-fork2 
    - Allow test-fs-watch to fail as LP buildd's don't support
      inotify.
    - Revert all other Ubuntu changes as no longer required.
* Update Standards-Version to 3.9.3.
* Patch wscript to enable build on mipsel arch, libv8 being available.
  Upstream does not support that arch, failure expected.
* test-cluster-kill-workers is expected to fail on armhf,
  Bug#660802 will be closed when test pass.
* test-buffer is expected to fail on armel,
  Bug#660800 will be closed when test pass.
* Add epoch to dependency on libev >= 1:4.11. Closes: bug#658441.
* Remove tools/doc because node-doc-generator has no license for now.
* Add copyright for doc/sh* files (shjs).
* source.lintian-overrides : source-contains-waf-binary tools/node-waf
  it is simply not the case here.
* test-stream-pipe-multi expected to timeout sometimes on busy builds. 
* New upstream release.
* Remove upstream patches.
* test-dgram-pingpong expected to timeout, the test itself is buggy.
* test-buffer expected to fail on armel, allow building package to make
  it easier to find the cause of the failure.
  Closes: bug#639636.
* Expect tests dgram-multicast and broadcast to fail.
  debian/patches/2005_expected_failing_tests.patch
* Drop dpkg-source local-options: Defaults since dpkg-source 1.16.1.
* New upstream release.
* Depend on libev-dev 4.11, see bug#657080.
* Bump dependency on openssl to 1.0.0g.
* Remove useless uv_loop_refcount from libuv,
  refreshed 2009_fix_shared_ev.patch.
* Apply to upstream patches landed after 0.6.10 release,
  to fix debugger repl and http client.
* New upstream release. Closes:bug#650661
* Repackage to remove non-dfsg font files ./deps/npm/html/*/*.ttf
* Remove unneeded bundled dependencies: lighter tarball,
  debian/copyright is easier to maintain.
* Drop unneeded build-dependency on scons.
* Depend on zlib1g, libc-ares, libev.
  Patches done to support building with those shared libs.
* Fix DEB_UPSTREAM_URL in debian/rules, and debian/watch.
* nodejs.pc file for pkgconfig is no more available.
* Build-depend on procps package, a test is using /bin/ps.
* Refreshed debian/patches/2005_expected_failing_tests.patch,
  only for tests that need networking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#ifndef V8_CODE_STUBS_H_
29
29
#define V8_CODE_STUBS_H_
30
30
 
 
31
#include "allocation.h"
31
32
#include "globals.h"
32
33
 
33
34
namespace v8 {
34
35
namespace internal {
35
36
 
36
 
// List of code stubs used on all platforms. The order in this list is important
37
 
// as only the stubs up to and including Instanceof allows nested stub calls.
 
37
// List of code stubs used on all platforms.
38
38
#define CODE_STUB_LIST_ALL_PLATFORMS(V)  \
39
39
  V(CallFunction)                        \
40
 
  V(GenericBinaryOp)                     \
41
 
  V(TypeRecordingBinaryOp)               \
 
40
  V(UnaryOp)                             \
 
41
  V(BinaryOp)                            \
42
42
  V(StringAdd)                           \
43
 
  V(StringCharAt)                        \
44
43
  V(SubString)                           \
45
44
  V(StringCompare)                       \
46
 
  V(SmiOp)                               \
47
45
  V(Compare)                             \
48
46
  V(CompareIC)                           \
49
47
  V(MathPow)                             \
50
48
  V(TranscendentalCache)                 \
51
49
  V(Instanceof)                          \
 
50
  /* All stubs above this line only exist in a few versions, which are  */  \
 
51
  /* generated ahead of time.  Therefore compiling a call to one of     */  \
 
52
  /* them can't cause a new stub to be compiled, so compiling a call to */  \
 
53
  /* them is GC safe.  The ones below this line exist in many variants  */  \
 
54
  /* so code compiling a call to one can cause a GC.  This means they   */  \
 
55
  /* can't be called from other stubs, since stub generation code is    */  \
 
56
  /* not GC safe.                                                       */  \
52
57
  V(ConvertToDouble)                     \
53
58
  V(WriteInt32ToHeapNumber)              \
54
 
  V(IntegerMod)                          \
55
59
  V(StackCheck)                          \
56
60
  V(FastNewClosure)                      \
57
61
  V(FastNewContext)                      \
58
62
  V(FastCloneShallowArray)               \
59
 
  V(GenericUnaryOp)                      \
60
63
  V(RevertToNumber)                      \
61
64
  V(ToBoolean)                           \
62
65
  V(ToNumber)                            \
67
70
  V(NumberToString)                      \
68
71
  V(CEntry)                              \
69
72
  V(JSEntry)                             \
70
 
  V(DebuggerStatement)
 
73
  V(KeyedLoadElement)                    \
 
74
  V(KeyedStoreElement)                   \
 
75
  V(DebuggerStatement)                   \
 
76
  V(StringDictionaryNegativeLookup)
71
77
 
72
78
// List of code stubs only used on ARM platforms.
73
79
#ifdef V8_TARGET_ARCH_ARM
81
87
#define CODE_STUB_LIST_ARM(V)
82
88
#endif
83
89
 
 
90
// List of code stubs only used on MIPS platforms.
 
91
#ifdef V8_TARGET_ARCH_MIPS
 
92
#define CODE_STUB_LIST_MIPS(V)  \
 
93
  V(RegExpCEntry)               \
 
94
  V(DirectCEntry)
 
95
#else
 
96
#define CODE_STUB_LIST_MIPS(V)
 
97
#endif
 
98
 
84
99
// Combined list of code stubs.
85
100
#define CODE_STUB_LIST(V)            \
86
101
  CODE_STUB_LIST_ALL_PLATFORMS(V)    \
87
 
  CODE_STUB_LIST_ARM(V)
 
102
  CODE_STUB_LIST_ARM(V)              \
 
103
  CODE_STUB_LIST_MIPS(V)
88
104
 
89
105
// Mode to overwrite BinaryExpression values.
90
106
enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
152
168
  virtual Major MajorKey() = 0;
153
169
  virtual int MinorKey() = 0;
154
170
 
155
 
  // The CallFunctionStub needs to override this so it can encode whether a
156
 
  // lazily generated function should be fully optimized or not.
157
 
  virtual InLoopFlag InLoop() { return NOT_IN_LOOP; }
158
 
 
159
 
  // GenericBinaryOpStub needs to override this.
 
171
  // BinaryOpStub needs to override this.
160
172
  virtual int GetCodeKind();
161
173
 
162
 
  // GenericBinaryOpStub needs to override this.
 
174
  // BinaryOpStub needs to override this.
163
175
  virtual InlineCacheState GetICState() {
164
176
    return UNINITIALIZED;
165
177
  }
166
178
 
167
179
  // Returns a name for logging/debugging purposes.
168
 
  virtual const char* GetName() { return MajorName(MajorKey(), false); }
 
180
  SmartArrayPointer<const char> GetName();
 
181
  virtual void PrintName(StringStream* stream) {
 
182
    stream->Add("%s", MajorName(MajorKey(), false));
 
183
  }
169
184
 
170
 
#ifdef DEBUG
171
 
  virtual void Print() { PrintF("%s\n", GetName()); }
172
 
#endif
 
185
  // Returns whether the code generated for this stub needs to be allocated as
 
186
  // a fixed (non-moveable) code object.
 
187
  virtual bool NeedsImmovableCode() { return false; }
173
188
 
174
189
  // Computes the key based on major and minor.
175
190
  uint32_t GetKey() {
178
193
           MajorKeyBits::encode(MajorKey());
179
194
  }
180
195
 
 
196
  // See comment above, where Instanceof is defined.
181
197
  bool AllowsStubCalls() { return MajorKey() <= Instanceof; }
182
198
 
183
199
  class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {};
251
267
  void Generate(MacroAssembler* masm);
252
268
 
253
269
 private:
254
 
 
255
 
  const char* GetName() { return "StackCheckStub"; }
256
 
 
257
270
  Major MajorKey() { return StackCheck; }
258
271
  int MinorKey() { return 0; }
259
272
};
268
281
 private:
269
282
  Major MajorKey() { return ToNumber; }
270
283
  int MinorKey() { return 0; }
271
 
  const char* GetName() { return "ToNumberStub"; }
272
284
};
273
285
 
274
286
 
275
287
class FastNewClosureStub : public CodeStub {
276
288
 public:
 
289
  explicit FastNewClosureStub(StrictModeFlag strict_mode)
 
290
    : strict_mode_(strict_mode) { }
 
291
 
277
292
  void Generate(MacroAssembler* masm);
278
293
 
279
294
 private:
280
 
  const char* GetName() { return "FastNewClosureStub"; }
281
295
  Major MajorKey() { return FastNewClosure; }
282
 
  int MinorKey() { return 0; }
 
296
  int MinorKey() { return strict_mode_; }
 
297
 
 
298
  StrictModeFlag strict_mode_;
283
299
};
284
300
 
285
301
 
296
312
 private:
297
313
  int slots_;
298
314
 
299
 
  const char* GetName() { return "FastNewContextStub"; }
300
315
  Major MajorKey() { return FastNewContext; }
301
316
  int MinorKey() { return slots_; }
302
317
};
325
340
  Mode mode_;
326
341
  int length_;
327
342
 
328
 
  const char* GetName() { return "FastCloneShallowArrayStub"; }
329
343
  Major MajorKey() { return FastCloneShallowArray; }
330
344
  int MinorKey() {
331
345
    ASSERT(mode_ == 0 || mode_ == 1);
343
357
    kReturnTrueFalseObject = 1 << 2
344
358
  };
345
359
 
346
 
  explicit InstanceofStub(Flags flags) : flags_(flags), name_(NULL) { }
 
360
  explicit InstanceofStub(Flags flags) : flags_(flags) { }
347
361
 
348
362
  static Register left();
349
363
  static Register right();
366
380
    return (flags_ & kReturnTrueFalseObject) != 0;
367
381
  }
368
382
 
369
 
  const char* GetName();
 
383
  virtual void PrintName(StringStream* stream);
370
384
 
371
385
  Flags flags_;
372
 
  char* name_;
373
 
};
374
 
 
375
 
 
376
 
enum NegativeZeroHandling {
377
 
  kStrictNegativeZero,
378
 
  kIgnoreNegativeZero
379
 
};
380
 
 
381
 
 
382
 
enum UnaryOpFlags {
383
 
  NO_UNARY_FLAGS = 0,
384
 
  NO_UNARY_SMI_CODE_IN_STUB = 1 << 0
385
 
};
386
 
 
387
 
 
388
 
class GenericUnaryOpStub : public CodeStub {
389
 
 public:
390
 
  GenericUnaryOpStub(Token::Value op,
391
 
                     UnaryOverwriteMode overwrite,
392
 
                     UnaryOpFlags flags,
393
 
                     NegativeZeroHandling negative_zero = kStrictNegativeZero)
394
 
      : op_(op),
395
 
        overwrite_(overwrite),
396
 
        include_smi_code_((flags & NO_UNARY_SMI_CODE_IN_STUB) == 0),
397
 
        negative_zero_(negative_zero) { }
398
 
 
399
 
 private:
400
 
  Token::Value op_;
401
 
  UnaryOverwriteMode overwrite_;
402
 
  bool include_smi_code_;
403
 
  NegativeZeroHandling negative_zero_;
404
 
 
405
 
  class OverwriteField: public BitField<UnaryOverwriteMode, 0, 1> {};
406
 
  class IncludeSmiCodeField: public BitField<bool, 1, 1> {};
407
 
  class NegativeZeroField: public BitField<NegativeZeroHandling, 2, 1> {};
408
 
  class OpField: public BitField<Token::Value, 3, kMinorBits - 3> {};
409
 
 
410
 
  Major MajorKey() { return GenericUnaryOp; }
411
 
  int MinorKey() {
412
 
    return OpField::encode(op_) |
413
 
        OverwriteField::encode(overwrite_) |
414
 
        IncludeSmiCodeField::encode(include_smi_code_) |
415
 
        NegativeZeroField::encode(negative_zero_);
416
 
  }
417
 
 
418
 
  void Generate(MacroAssembler* masm);
419
 
 
420
 
  const char* GetName();
421
386
};
422
387
 
423
388
 
429
394
 private:
430
395
  virtual CodeStub::Major MajorKey() { return MathPow; }
431
396
  virtual int MinorKey() { return 0; }
432
 
 
433
 
  const char* GetName() { return "MathPowStub"; }
434
 
};
435
 
 
436
 
 
437
 
class StringCharAtStub: public CodeStub {
438
 
 public:
439
 
  StringCharAtStub() {}
440
 
 
441
 
 private:
442
 
  Major MajorKey() { return StringCharAt; }
443
 
  int MinorKey() { return 0; }
444
 
 
445
 
  void Generate(MacroAssembler* masm);
446
397
};
447
398
 
448
399
 
468
419
 
469
420
  void GenerateSmis(MacroAssembler* masm);
470
421
  void GenerateHeapNumbers(MacroAssembler* masm);
 
422
  void GenerateSymbols(MacroAssembler* masm);
 
423
  void GenerateStrings(MacroAssembler* masm);
471
424
  void GenerateObjects(MacroAssembler* masm);
472
425
  void GenerateMiss(MacroAssembler* masm);
473
426
 
507
460
      include_number_compare_((flags & NO_NUMBER_COMPARE_IN_STUB) == 0),
508
461
      include_smi_compare_((flags & NO_SMI_COMPARE_IN_STUB) == 0),
509
462
      lhs_(lhs),
510
 
      rhs_(rhs),
511
 
      name_(NULL) { }
 
463
      rhs_(rhs) { }
512
464
 
513
465
  CompareStub(Condition cc,
514
466
              bool strict,
519
471
      include_number_compare_((flags & NO_NUMBER_COMPARE_IN_STUB) == 0),
520
472
      include_smi_compare_((flags & NO_SMI_COMPARE_IN_STUB) == 0),
521
473
      lhs_(no_reg),
522
 
      rhs_(no_reg),
523
 
      name_(NULL) { }
 
474
      rhs_(no_reg) { }
524
475
 
525
476
  void Generate(MacroAssembler* masm);
526
477
 
574
525
 
575
526
  // Unfortunately you have to run without snapshots to see most of these
576
527
  // names in the profile since most compare stubs end up in the snapshot.
577
 
  char* name_;
578
 
  const char* GetName();
579
 
#ifdef DEBUG
580
 
  void Print() {
581
 
    PrintF("CompareStub (minor %d) (cc %d), (strict %s), "
582
 
           "(never_nan_nan %s), (smi_compare %s) (number_compare %s) ",
583
 
           MinorKey(),
584
 
           static_cast<int>(cc_),
585
 
           strict_ ? "true" : "false",
586
 
           never_nan_nan_ ? "true" : "false",
587
 
           include_smi_compare_ ? "inluded" : "not included",
588
 
           include_number_compare_ ? "included" : "not included");
589
 
 
590
 
    if (!lhs_.is(no_reg) && !rhs_.is(no_reg)) {
591
 
      PrintF("(lhs r%d), (rhs r%d)\n", lhs_.code(), rhs_.code());
592
 
    } else {
593
 
      PrintF("\n");
594
 
    }
595
 
  }
596
 
#endif
 
528
  virtual void PrintName(StringStream* stream);
597
529
};
598
530
 
599
531
 
623
555
  Major MajorKey() { return CEntry; }
624
556
  int MinorKey();
625
557
 
626
 
  const char* GetName() { return "CEntryStub"; }
 
558
  bool NeedsImmovableCode();
627
559
};
628
560
 
629
561
 
639
571
 private:
640
572
  Major MajorKey() { return JSEntry; }
641
573
  int MinorKey() { return 0; }
642
 
 
643
 
  const char* GetName() { return "JSEntryStub"; }
644
574
};
645
575
 
646
576
 
653
583
 private:
654
584
  int MinorKey() { return 1; }
655
585
 
656
 
  const char* GetName() { return "JSConstructEntryStub"; }
 
586
  virtual void PrintName(StringStream* stream) {
 
587
    stream->Add("JSConstructEntryStub");
 
588
  }
657
589
};
658
590
 
659
591
 
661
593
 public:
662
594
  enum Type {
663
595
    READ_ELEMENT,
664
 
    NEW_OBJECT
 
596
    NEW_NON_STRICT_FAST,
 
597
    NEW_NON_STRICT_SLOW,
 
598
    NEW_STRICT
665
599
  };
666
600
 
667
601
  explicit ArgumentsAccessStub(Type type) : type_(type) { }
674
608
 
675
609
  void Generate(MacroAssembler* masm);
676
610
  void GenerateReadElement(MacroAssembler* masm);
677
 
  void GenerateNewObject(MacroAssembler* masm);
678
 
 
679
 
  const char* GetName() { return "ArgumentsAccessStub"; }
680
 
 
681
 
#ifdef DEBUG
682
 
  void Print() {
683
 
    PrintF("ArgumentsAccessStub (type %d)\n", type_);
684
 
  }
685
 
#endif
 
611
  void GenerateNewStrict(MacroAssembler* masm);
 
612
  void GenerateNewNonStrictFast(MacroAssembler* masm);
 
613
  void GenerateNewNonStrictSlow(MacroAssembler* masm);
 
614
 
 
615
  virtual void PrintName(StringStream* stream);
686
616
};
687
617
 
688
618
 
695
625
  int MinorKey() { return 0; }
696
626
 
697
627
  void Generate(MacroAssembler* masm);
698
 
 
699
 
  const char* GetName() { return "RegExpExecStub"; }
700
 
 
701
 
#ifdef DEBUG
702
 
  void Print() {
703
 
    PrintF("RegExpExecStub\n");
704
 
  }
705
 
#endif
706
628
};
707
629
 
708
630
 
715
637
  int MinorKey() { return 0; }
716
638
 
717
639
  void Generate(MacroAssembler* masm);
718
 
 
719
 
  const char* GetName() { return "RegExpConstructResultStub"; }
720
 
 
721
 
#ifdef DEBUG
722
 
  void Print() {
723
 
    PrintF("RegExpConstructResultStub\n");
724
 
  }
725
 
#endif
726
640
};
727
641
 
728
642
 
729
643
class CallFunctionStub: public CodeStub {
730
644
 public:
731
 
  CallFunctionStub(int argc, InLoopFlag in_loop, CallFunctionFlags flags)
732
 
      : argc_(argc), in_loop_(in_loop), flags_(flags) { }
 
645
  CallFunctionStub(int argc, CallFunctionFlags flags)
 
646
      : argc_(argc), flags_(flags) { }
733
647
 
734
648
  void Generate(MacroAssembler* masm);
735
649
 
739
653
 
740
654
 private:
741
655
  int argc_;
742
 
  InLoopFlag in_loop_;
743
656
  CallFunctionFlags flags_;
744
657
 
745
 
#ifdef DEBUG
746
 
  void Print() {
747
 
    PrintF("CallFunctionStub (args %d, in_loop %d, flags %d)\n",
748
 
           argc_,
749
 
           static_cast<int>(in_loop_),
750
 
           static_cast<int>(flags_));
751
 
  }
752
 
#endif
 
658
  virtual void PrintName(StringStream* stream);
753
659
 
754
660
  // Minor key encoding in 32 bits with Bitfield <Type, shift, size>.
755
 
  class InLoopBits: public BitField<InLoopFlag, 0, 1> {};
756
 
  class FlagBits: public BitField<CallFunctionFlags, 1, 1> {};
757
 
  class ArgcBits: public BitField<int, 2, 32 - 2> {};
 
661
  class FlagBits: public BitField<CallFunctionFlags, 0, 1> {};
 
662
  class ArgcBits: public BitField<unsigned, 1, 32 - 1> {};
758
663
 
759
664
  Major MajorKey() { return CallFunction; }
760
665
  int MinorKey() {
761
666
    // Encode the parameters in a unique 32 bit value.
762
 
    return InLoopBits::encode(in_loop_)
763
 
           | FlagBits::encode(flags_)
764
 
           | ArgcBits::encode(argc_);
 
667
    return FlagBits::encode(flags_) | ArgcBits::encode(argc_);
765
668
  }
766
669
 
767
 
  InLoopFlag InLoop() { return in_loop_; }
768
 
  bool ReceiverMightBeValue() {
769
 
    return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0;
 
670
  bool ReceiverMightBeImplicit() {
 
671
    return (flags_ & RECEIVER_MIGHT_BE_IMPLICIT) != 0;
770
672
  }
771
673
};
772
674
 
945
847
  DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope);
946
848
};
947
849
 
 
850
 
 
851
class KeyedLoadElementStub : public CodeStub {
 
852
 public:
 
853
  explicit KeyedLoadElementStub(ElementsKind elements_kind)
 
854
      : elements_kind_(elements_kind)
 
855
  { }
 
856
 
 
857
  Major MajorKey() { return KeyedLoadElement; }
 
858
  int MinorKey() { return elements_kind_; }
 
859
 
 
860
  void Generate(MacroAssembler* masm);
 
861
 
 
862
 private:
 
863
  ElementsKind elements_kind_;
 
864
 
 
865
  DISALLOW_COPY_AND_ASSIGN(KeyedLoadElementStub);
 
866
};
 
867
 
 
868
 
 
869
class KeyedStoreElementStub : public CodeStub {
 
870
 public:
 
871
  KeyedStoreElementStub(bool is_js_array,
 
872
                        ElementsKind elements_kind)
 
873
    : is_js_array_(is_js_array),
 
874
    elements_kind_(elements_kind) { }
 
875
 
 
876
  Major MajorKey() { return KeyedStoreElement; }
 
877
  int MinorKey() {
 
878
    return (is_js_array_ ? 0 : kElementsKindCount) + elements_kind_;
 
879
  }
 
880
 
 
881
  void Generate(MacroAssembler* masm);
 
882
 
 
883
 private:
 
884
  bool is_js_array_;
 
885
  ElementsKind elements_kind_;
 
886
 
 
887
  DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub);
 
888
};
 
889
 
 
890
 
 
891
class ToBooleanStub: public CodeStub {
 
892
 public:
 
893
  enum Type {
 
894
    UNDEFINED,
 
895
    BOOLEAN,
 
896
    NULL_TYPE,
 
897
    SMI,
 
898
    SPEC_OBJECT,
 
899
    STRING,
 
900
    HEAP_NUMBER,
 
901
    NUMBER_OF_TYPES
 
902
  };
 
903
 
 
904
  // At most 8 different types can be distinguished, because the Code object
 
905
  // only has room for a single byte to hold a set of these types. :-P
 
906
  STATIC_ASSERT(NUMBER_OF_TYPES <= 8);
 
907
 
 
908
  class Types {
 
909
   public:
 
910
    Types() {}
 
911
    explicit Types(byte bits) : set_(bits) {}
 
912
 
 
913
    bool IsEmpty() const { return set_.IsEmpty(); }
 
914
    bool Contains(Type type) const { return set_.Contains(type); }
 
915
    void Add(Type type) { set_.Add(type); }
 
916
    byte ToByte() const { return set_.ToIntegral(); }
 
917
    void Print(StringStream* stream) const;
 
918
    void TraceTransition(Types to) const;
 
919
    bool Record(Handle<Object> object);
 
920
    bool NeedsMap() const;
 
921
    bool CanBeUndetectable() const;
 
922
 
 
923
   private:
 
924
    EnumSet<Type, byte> set_;
 
925
  };
 
926
 
 
927
  static Types no_types() { return Types(); }
 
928
  static Types all_types() { return Types((1 << NUMBER_OF_TYPES) - 1); }
 
929
 
 
930
  explicit ToBooleanStub(Register tos, Types types = Types())
 
931
      : tos_(tos), types_(types) { }
 
932
 
 
933
  void Generate(MacroAssembler* masm);
 
934
  virtual int GetCodeKind() { return Code::TO_BOOLEAN_IC; }
 
935
  virtual void PrintName(StringStream* stream);
 
936
 
 
937
 private:
 
938
  Major MajorKey() { return ToBoolean; }
 
939
  int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | types_.ToByte(); }
 
940
 
 
941
  virtual void FinishCode(Code* code) {
 
942
    code->set_to_boolean_state(types_.ToByte());
 
943
  }
 
944
 
 
945
  void CheckOddball(MacroAssembler* masm,
 
946
                    Type type,
 
947
                    Heap::RootListIndex value,
 
948
                    bool result);
 
949
  void GenerateTypeTransition(MacroAssembler* masm);
 
950
 
 
951
  Register tos_;
 
952
  Types types_;
 
953
};
 
954
 
948
955
} }  // namespace v8::internal
949
956
 
950
957
#endif  // V8_CODE_STUBS_H_