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

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

Issue 8054008: Improve our simple elimination of hole checks. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3183 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 virtual Representation RequiredInputRepresentation(int index) const { 3194 virtual Representation RequiredInputRepresentation(int index) const {
3195 return Representation::None(); 3195 return Representation::None();
3196 } 3196 }
3197 3197
3198 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue) 3198 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue)
3199 }; 3199 };
3200 3200
3201 3201
3202 class HLoadGlobalCell: public HTemplateInstruction<0> { 3202 class HLoadGlobalCell: public HTemplateInstruction<0> {
3203 public: 3203 public:
3204 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) 3204 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool deleteable_or_const)
Kevin Millikin (Chromium) 2011/09/27 12:01:04 I'm not thrilled with the bool. The terminology i
3205 : cell_(cell), check_hole_value_(check_hole_value) { 3205 : cell_(cell), deleteable_or_const_(deleteable_or_const) {
3206 set_representation(Representation::Tagged()); 3206 set_representation(Representation::Tagged());
3207 SetFlag(kUseGVN); 3207 SetFlag(kUseGVN);
3208 SetFlag(kDependsOnGlobalVars); 3208 SetFlag(kDependsOnGlobalVars);
3209 } 3209 }
3210 3210
3211 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 3211 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
3212 bool check_hole_value() const { return check_hole_value_; } 3212 bool deleteable_or_const() const { return deleteable_or_const_; }
3213 bool RequiresHoleCheck() const;
3213 3214
3214 virtual void PrintDataTo(StringStream* stream); 3215 virtual void PrintDataTo(StringStream* stream);
3215 3216
3216 virtual intptr_t Hashcode() { 3217 virtual intptr_t Hashcode() {
3217 ASSERT(!HEAP->allow_allocation(false)); 3218 ASSERT(!HEAP->allow_allocation(false));
3218 return reinterpret_cast<intptr_t>(*cell_); 3219 return reinterpret_cast<intptr_t>(*cell_);
3219 } 3220 }
3220 3221
3221 virtual Representation RequiredInputRepresentation(int index) const { 3222 virtual Representation RequiredInputRepresentation(int index) const {
3222 return Representation::None(); 3223 return Representation::None();
3223 } 3224 }
3224 3225
3225 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) 3226 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell)
3226 3227
3227 protected: 3228 protected:
3228 virtual bool DataEquals(HValue* other) { 3229 virtual bool DataEquals(HValue* other) {
3229 HLoadGlobalCell* b = HLoadGlobalCell::cast(other); 3230 HLoadGlobalCell* b = HLoadGlobalCell::cast(other);
3230 return cell_.is_identical_to(b->cell()); 3231 return cell_.is_identical_to(b->cell());
3231 } 3232 }
3232 3233
3233 private: 3234 private:
3234 Handle<JSGlobalPropertyCell> cell_; 3235 Handle<JSGlobalPropertyCell> cell_;
3235 bool check_hole_value_; 3236 bool deleteable_or_const_;
3236 }; 3237 };
3237 3238
3238 3239
3239 class HLoadGlobalGeneric: public HTemplateInstruction<2> { 3240 class HLoadGlobalGeneric: public HTemplateInstruction<2> {
3240 public: 3241 public:
3241 HLoadGlobalGeneric(HValue* context, 3242 HLoadGlobalGeneric(HValue* context,
3242 HValue* global_object, 3243 HValue* global_object,
3243 Handle<Object> name, 3244 Handle<Object> name,
3244 bool for_typeof) 3245 bool for_typeof)
3245 : name_(name), 3246 : name_(name),
(...skipping 20 matching lines...) Expand all
3266 private: 3267 private:
3267 Handle<Object> name_; 3268 Handle<Object> name_;
3268 bool for_typeof_; 3269 bool for_typeof_;
3269 }; 3270 };
3270 3271
3271 3272
3272 class HStoreGlobalCell: public HUnaryOperation { 3273 class HStoreGlobalCell: public HUnaryOperation {
3273 public: 3274 public:
3274 HStoreGlobalCell(HValue* value, 3275 HStoreGlobalCell(HValue* value,
3275 Handle<JSGlobalPropertyCell> cell, 3276 Handle<JSGlobalPropertyCell> cell,
3276 bool check_hole_value) 3277 bool deleteable_or_const)
3277 : HUnaryOperation(value), 3278 : HUnaryOperation(value),
3278 cell_(cell), 3279 cell_(cell),
3279 check_hole_value_(check_hole_value) { 3280 deleteable_or_const_(deleteable_or_const) {
3280 SetFlag(kChangesGlobalVars); 3281 SetFlag(kChangesGlobalVars);
3281 } 3282 }
3282 3283
3283 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 3284 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
3284 bool check_hole_value() const { return check_hole_value_; } 3285 bool deleteable_or_const() const { return deleteable_or_const_; }
3286 bool RequiresHoleCheck() const { return deleteable_or_const(); }
3285 3287
3286 virtual Representation RequiredInputRepresentation(int index) const { 3288 virtual Representation RequiredInputRepresentation(int index) const {
3287 return Representation::Tagged(); 3289 return Representation::Tagged();
3288 } 3290 }
3289 virtual void PrintDataTo(StringStream* stream); 3291 virtual void PrintDataTo(StringStream* stream);
3290 3292
3291 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) 3293 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell)
3292 3294
3293 private: 3295 private:
3294 Handle<JSGlobalPropertyCell> cell_; 3296 Handle<JSGlobalPropertyCell> cell_;
3295 bool check_hole_value_; 3297 bool deleteable_or_const_;
3296 }; 3298 };
3297 3299
3298 3300
3299 class HStoreGlobalGeneric: public HTemplateInstruction<3> { 3301 class HStoreGlobalGeneric: public HTemplateInstruction<3> {
3300 public: 3302 public:
3301 HStoreGlobalGeneric(HValue* context, 3303 HStoreGlobalGeneric(HValue* context,
3302 HValue* global_object, 3304 HValue* global_object,
3303 Handle<Object> name, 3305 Handle<Object> name,
3304 HValue* value, 3306 HValue* value,
3305 bool strict_mode) 3307 bool strict_mode)
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
3567 3569
3568 virtual Representation RequiredInputRepresentation(int index) const { 3570 virtual Representation RequiredInputRepresentation(int index) const {
3569 // The key is supposed to be Integer32. 3571 // The key is supposed to be Integer32.
3570 return index == 0 3572 return index == 0
3571 ? Representation::Tagged() 3573 ? Representation::Tagged()
3572 : Representation::Integer32(); 3574 : Representation::Integer32();
3573 } 3575 }
3574 3576
3575 virtual void PrintDataTo(StringStream* stream); 3577 virtual void PrintDataTo(StringStream* stream);
3576 3578
3577 bool RequiresHoleCheck() const;
3578
3579 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement) 3579 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement)
3580 3580
3581 protected: 3581 protected:
3582 virtual bool DataEquals(HValue* other) { return true; } 3582 virtual bool DataEquals(HValue* other) { return true; }
3583 }; 3583 };
3584 3584
3585 3585
3586 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> { 3586 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> {
3587 public: 3587 public:
3588 HLoadKeyedSpecializedArrayElement(HValue* external_elements, 3588 HLoadKeyedSpecializedArrayElement(HValue* external_elements,
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
4242 4242
4243 DECLARE_CONCRETE_INSTRUCTION(In) 4243 DECLARE_CONCRETE_INSTRUCTION(In)
4244 }; 4244 };
4245 4245
4246 #undef DECLARE_INSTRUCTION 4246 #undef DECLARE_INSTRUCTION
4247 #undef DECLARE_CONCRETE_INSTRUCTION 4247 #undef DECLARE_CONCRETE_INSTRUCTION
4248 4248
4249 } } // namespace v8::internal 4249 } } // namespace v8::internal
4250 4250
4251 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4251 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698