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

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

Issue 23654041: Ensure constant truncation is only done when it is safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
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 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 // Replay effects of this instruction on the given environment. 3266 // Replay effects of this instruction on the given environment.
3267 void ReplayEnvironment(HEnvironment* env); 3267 void ReplayEnvironment(HEnvironment* env);
3268 3268
3269 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) 3269 DECLARE_CONCRETE_INSTRUCTION(CapturedObject)
3270 3270
3271 private: 3271 private:
3272 int capture_id_; 3272 int capture_id_;
3273 }; 3273 };
3274 3274
3275 3275
3276 class HGraphBuilder;
3276 class HConstant V8_FINAL : public HTemplateInstruction<0> { 3277 class HConstant V8_FINAL : public HTemplateInstruction<0> {
3277 public: 3278 public:
3278 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t); 3279 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t);
3279 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); 3280 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation);
3280 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); 3281 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double);
3281 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); 3282 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>);
3282 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, Handle<Map>, UniqueValueId); 3283 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, Handle<Map>, UniqueValueId);
3283 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); 3284 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference);
3284 3285
3285 static HConstant* CreateAndInsertAfter(Zone* zone, 3286 static HConstant* CreateAndInsertAfter(Zone* zone,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 if (HasInteger32Value()) return Representation::Integer32(); 3373 if (HasInteger32Value()) return Representation::Integer32();
3373 if (HasNumberValue()) return Representation::Double(); 3374 if (HasNumberValue()) return Representation::Double();
3374 if (HasExternalReferenceValue()) return Representation::External(); 3375 if (HasExternalReferenceValue()) return Representation::External();
3375 return Representation::Tagged(); 3376 return Representation::Tagged();
3376 } 3377 }
3377 3378
3378 virtual bool EmitAtUses() V8_OVERRIDE; 3379 virtual bool EmitAtUses() V8_OVERRIDE;
3379 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 3380 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
3380 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; 3381 HConstant* CopyToRepresentation(Representation r, Zone* zone) const;
3381 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); 3382 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone);
3382 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); 3383 Maybe<HConstant*> CopyToTruncatedNumberAndAdd(Zone* zone,
3384 HGraphBuilder* builder);
3383 bool HasInteger32Value() const { return has_int32_value_; } 3385 bool HasInteger32Value() const { return has_int32_value_; }
3384 int32_t Integer32Value() const { 3386 int32_t Integer32Value() const {
3385 ASSERT(HasInteger32Value()); 3387 ASSERT(HasInteger32Value());
3386 return int32_value_; 3388 return int32_value_;
3387 } 3389 }
3388 bool HasSmiValue() const { return has_smi_value_; } 3390 bool HasSmiValue() const { return has_smi_value_; }
3389 bool HasDoubleValue() const { return has_double_value_; } 3391 bool HasDoubleValue() const { return has_double_value_; }
3390 double DoubleValue() const { 3392 double DoubleValue() const {
3391 ASSERT(HasDoubleValue()); 3393 ASSERT(HasDoubleValue());
3392 return double_value_; 3394 return double_value_;
(...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after
6975 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6977 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6976 }; 6978 };
6977 6979
6978 6980
6979 #undef DECLARE_INSTRUCTION 6981 #undef DECLARE_INSTRUCTION
6980 #undef DECLARE_CONCRETE_INSTRUCTION 6982 #undef DECLARE_CONCRETE_INSTRUCTION
6981 6983
6982 } } // namespace v8::internal 6984 } } // namespace v8::internal
6983 6985
6984 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6986 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698