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

Side by Side Diff: src/hydrogen-instructions.h

Issue 82763005: Reland "Implement Math.random() purely in JavaScript" plus fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added assertion Created 7 years 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 | « src/hydrogen.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 V(MapEnumLength) \ 148 V(MapEnumLength) \
149 V(MathFloorOfDiv) \ 149 V(MathFloorOfDiv) \
150 V(MathMinMax) \ 150 V(MathMinMax) \
151 V(Mod) \ 151 V(Mod) \
152 V(Mul) \ 152 V(Mul) \
153 V(OsrEntry) \ 153 V(OsrEntry) \
154 V(OuterContext) \ 154 V(OuterContext) \
155 V(Parameter) \ 155 V(Parameter) \
156 V(Power) \ 156 V(Power) \
157 V(PushArgument) \ 157 V(PushArgument) \
158 V(Random) \
159 V(RegExpLiteral) \ 158 V(RegExpLiteral) \
160 V(Return) \ 159 V(Return) \
161 V(Ror) \ 160 V(Ror) \
162 V(Sar) \ 161 V(Sar) \
163 V(SeqStringGetChar) \ 162 V(SeqStringGetChar) \
164 V(SeqStringSetChar) \ 163 V(SeqStringSetChar) \
165 V(Shl) \ 164 V(Shl) \
166 V(Shr) \ 165 V(Shr) \
167 V(Simulate) \ 166 V(Simulate) \
168 V(StackCheck) \ 167 V(StackCheck) \
(...skipping 4548 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 SetFlag(kUseGVN); 4716 SetFlag(kUseGVN);
4718 SetGVNFlag(kChangesNewSpacePromotion); 4717 SetGVNFlag(kChangesNewSpacePromotion);
4719 } 4718 }
4720 4719
4721 virtual bool IsDeletable() const V8_OVERRIDE { 4720 virtual bool IsDeletable() const V8_OVERRIDE {
4722 return !right()->representation().IsTagged(); 4721 return !right()->representation().IsTagged();
4723 } 4722 }
4724 }; 4723 };
4725 4724
4726 4725
4727 class HRandom V8_FINAL : public HTemplateInstruction<1> {
4728 public:
4729 DECLARE_INSTRUCTION_FACTORY_P1(HRandom, HValue*);
4730
4731 HValue* global_object() { return OperandAt(0); }
4732
4733 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4734 return Representation::Tagged();
4735 }
4736
4737 DECLARE_CONCRETE_INSTRUCTION(Random)
4738
4739 private:
4740 explicit HRandom(HValue* global_object) {
4741 SetOperandAt(0, global_object);
4742 set_representation(Representation::Double());
4743 }
4744
4745 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
4746 };
4747
4748
4749 class HAdd V8_FINAL : public HArithmeticBinaryOperation { 4726 class HAdd V8_FINAL : public HArithmeticBinaryOperation {
4750 public: 4727 public:
4751 static HInstruction* New(Zone* zone, 4728 static HInstruction* New(Zone* zone,
4752 HValue* context, 4729 HValue* context,
4753 HValue* left, 4730 HValue* left,
4754 HValue* right); 4731 HValue* right);
4755 4732
4756 // Add is only commutative if two integer values are added and not if two 4733 // Add is only commutative if two integer values are added and not if two
4757 // tagged values are added (because it might be a String concatenation). 4734 // tagged values are added (because it might be a String concatenation).
4758 virtual bool IsCommutative() const V8_OVERRIDE { 4735 virtual bool IsCommutative() const V8_OVERRIDE {
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
7450 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7427 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7451 }; 7428 };
7452 7429
7453 7430
7454 #undef DECLARE_INSTRUCTION 7431 #undef DECLARE_INSTRUCTION
7455 #undef DECLARE_CONCRETE_INSTRUCTION 7432 #undef DECLARE_CONCRETE_INSTRUCTION
7456 7433
7457 } } // namespace v8::internal 7434 } } // namespace v8::internal
7458 7435
7459 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7436 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698