Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 V(CallConstantFunction) \ | 80 V(CallConstantFunction) \ |
| 81 V(CallFunction) \ | 81 V(CallFunction) \ |
| 82 V(CallGlobal) \ | 82 V(CallGlobal) \ |
| 83 V(CallKeyed) \ | 83 V(CallKeyed) \ |
| 84 V(CallKnownGlobal) \ | 84 V(CallKnownGlobal) \ |
| 85 V(CallNamed) \ | 85 V(CallNamed) \ |
| 86 V(CallNew) \ | 86 V(CallNew) \ |
| 87 V(CallNewArray) \ | 87 V(CallNewArray) \ |
| 88 V(CallRuntime) \ | 88 V(CallRuntime) \ |
| 89 V(CallStub) \ | 89 V(CallStub) \ |
| 90 V(CapturedObject) \ | |
| 90 V(Change) \ | 91 V(Change) \ |
| 91 V(CheckFunction) \ | 92 V(CheckFunction) \ |
| 92 V(CheckHeapObject) \ | 93 V(CheckHeapObject) \ |
| 93 V(CheckInstanceType) \ | 94 V(CheckInstanceType) \ |
| 94 V(CheckMaps) \ | 95 V(CheckMaps) \ |
| 95 V(CheckMapValue) \ | 96 V(CheckMapValue) \ |
| 96 V(CheckPrototypeMaps) \ | 97 V(CheckPrototypeMaps) \ |
| 97 V(CheckSmi) \ | 98 V(CheckSmi) \ |
| 98 V(ClampToUint8) \ | 99 V(ClampToUint8) \ |
| 99 V(ClassOfTestAndBranch) \ | 100 V(ClassOfTestAndBranch) \ |
| (...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3422 | 3423 |
| 3423 // We need to store the phi both here and in the instruction operand because | 3424 // We need to store the phi both here and in the instruction operand because |
| 3424 // the operand can change if a new idef of the phi is added between the phi | 3425 // the operand can change if a new idef of the phi is added between the phi |
| 3425 // and this instruction (inserting an idef updates every use). | 3426 // and this instruction (inserting an idef updates every use). |
| 3426 HPhi* phi_; | 3427 HPhi* phi_; |
| 3427 NumericRelation relation_; | 3428 NumericRelation relation_; |
| 3428 int operand_index_; | 3429 int operand_index_; |
| 3429 }; | 3430 }; |
| 3430 | 3431 |
| 3431 | 3432 |
| 3432 class HArgumentsObject: public HTemplateInstruction<0> { | 3433 // Common base class for HArgumentsObject and HCapturedObject. |
| 3434 class HDematerializedObject: public HTemplateInstruction<0> { | |
| 3433 public: | 3435 public: |
| 3434 HArgumentsObject(int count, Zone* zone) : values_(count, zone) { | 3436 HDematerializedObject(int count, Zone* zone) : values_(count, zone) {} |
| 3435 set_representation(Representation::Tagged()); | |
| 3436 SetFlag(kIsArguments); | |
| 3437 } | |
| 3438 | |
| 3439 const ZoneList<HValue*>* arguments_values() const { return &values_; } | |
| 3440 int arguments_count() const { return values_.length(); } | |
| 3441 | |
| 3442 void AddArgument(HValue* argument, Zone* zone) { | |
| 3443 values_.Add(NULL, zone); // Resize list. | |
| 3444 SetOperandAt(values_.length() - 1, argument); | |
| 3445 } | |
| 3446 | 3437 |
| 3447 virtual int OperandCount() { return values_.length(); } | 3438 virtual int OperandCount() { return values_.length(); } |
| 3448 virtual HValue* OperandAt(int index) const { return values_[index]; } | 3439 virtual HValue* OperandAt(int index) const { return values_[index]; } |
| 3449 | 3440 |
| 3450 virtual bool HasEscapingOperandAt(int index) { return false; } | 3441 virtual bool HasEscapingOperandAt(int index) { return false; } |
| 3451 virtual Representation RequiredInputRepresentation(int index) { | 3442 virtual Representation RequiredInputRepresentation(int index) { |
| 3452 return Representation::None(); | 3443 return Representation::None(); |
| 3453 } | 3444 } |
| 3454 | 3445 |
| 3455 DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) | |
| 3456 | |
| 3457 protected: | 3446 protected: |
| 3458 virtual void InternalSetOperandAt(int index, HValue* value) { | 3447 virtual void InternalSetOperandAt(int index, HValue* value) { |
| 3459 values_[index] = value; | 3448 values_[index] = value; |
| 3460 } | 3449 } |
| 3461 | 3450 |
| 3451 ZoneList<HValue*> values_; | |
|
titzer
2013/08/01 17:11:50
How is this values_ array indexed? Does it store o
Michael Starzinger
2013/08/05 15:13:00
Correct. I added a comment to both HArgumentsObjec
| |
| 3452 | |
| 3462 private: | 3453 private: |
| 3463 virtual bool IsDeletable() const { return true; } | 3454 virtual bool IsDeletable() const { return true; } |
| 3464 | |
| 3465 ZoneList<HValue*> values_; | |
| 3466 }; | 3455 }; |
| 3467 | 3456 |
| 3468 | 3457 |
| 3458 class HArgumentsObject: public HDematerializedObject { | |
| 3459 public: | |
| 3460 HArgumentsObject(int count, Zone* zone) | |
| 3461 : HDematerializedObject(count, zone) { | |
| 3462 set_representation(Representation::Tagged()); | |
| 3463 SetFlag(kIsArguments); | |
| 3464 } | |
| 3465 | |
| 3466 const ZoneList<HValue*>* arguments_values() const { return &values_; } | |
| 3467 int arguments_count() const { return values_.length(); } | |
| 3468 | |
| 3469 void AddArgument(HValue* argument, Zone* zone) { | |
| 3470 values_.Add(NULL, zone); // Resize list. | |
| 3471 SetOperandAt(values_.length() - 1, argument); | |
| 3472 } | |
| 3473 | |
| 3474 DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) | |
| 3475 }; | |
| 3476 | |
| 3477 | |
| 3478 class HCapturedObject: public HDematerializedObject { | |
| 3479 public: | |
| 3480 HCapturedObject(int length, Zone* zone) | |
| 3481 : HDematerializedObject(length, zone) { | |
| 3482 set_representation(Representation::Tagged()); | |
| 3483 values_.AddBlock(NULL, length, zone); // Resize list. | |
| 3484 } | |
| 3485 | |
| 3486 const ZoneList<HValue*>* values() const { return &values_; } | |
| 3487 int length() const { return values_.length(); } | |
| 3488 | |
| 3489 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) | |
| 3490 }; | |
| 3491 | |
| 3492 | |
| 3469 class HConstant: public HTemplateInstruction<0> { | 3493 class HConstant: public HTemplateInstruction<0> { |
| 3470 public: | 3494 public: |
| 3471 HConstant(Handle<Object> handle, Representation r = Representation::None()); | 3495 HConstant(Handle<Object> handle, Representation r = Representation::None()); |
| 3472 HConstant(int32_t value, | 3496 HConstant(int32_t value, |
| 3473 Representation r = Representation::None(), | 3497 Representation r = Representation::None(), |
| 3474 bool is_not_in_new_space = true, | 3498 bool is_not_in_new_space = true, |
| 3475 Handle<Object> optional_handle = Handle<Object>::null()); | 3499 Handle<Object> optional_handle = Handle<Object>::null()); |
| 3476 HConstant(double value, | 3500 HConstant(double value, |
| 3477 Representation r = Representation::None(), | 3501 Representation r = Representation::None(), |
| 3478 bool is_not_in_new_space = true, | 3502 bool is_not_in_new_space = true, |
| (...skipping 2800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6279 SetGVNFlag(kChangesArrayElements); | 6303 SetGVNFlag(kChangesArrayElements); |
| 6280 } | 6304 } |
| 6281 | 6305 |
| 6282 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. | 6306 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. |
| 6283 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && | 6307 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && |
| 6284 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { | 6308 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { |
| 6285 SetFlag(kTruncatingToInt32); | 6309 SetFlag(kTruncatingToInt32); |
| 6286 } | 6310 } |
| 6287 } | 6311 } |
| 6288 | 6312 |
| 6289 virtual bool HasEscapingOperandAt(int index) { return index != 0; } | |
| 6290 virtual Representation RequiredInputRepresentation(int index) { | 6313 virtual Representation RequiredInputRepresentation(int index) { |
| 6291 // kind_fast: tagged[int32] = tagged | 6314 // kind_fast: tagged[int32] = tagged |
| 6292 // kind_double: tagged[int32] = double | 6315 // kind_double: tagged[int32] = double |
| 6293 // kind_smi : tagged[int32] = smi | 6316 // kind_smi : tagged[int32] = smi |
| 6294 // kind_external: external[int32] = (double | int32) | 6317 // kind_external: external[int32] = (double | int32) |
| 6295 if (index == 0) { | 6318 if (index == 0) { |
| 6296 return is_external() ? Representation::External() | 6319 return is_external() ? Representation::External() |
| 6297 : Representation::Tagged(); | 6320 : Representation::Tagged(); |
| 6298 } else if (index == 1) { | 6321 } else if (index == 1) { |
| 6299 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 6322 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6993 virtual bool IsDeletable() const { return true; } | 7016 virtual bool IsDeletable() const { return true; } |
| 6994 }; | 7017 }; |
| 6995 | 7018 |
| 6996 | 7019 |
| 6997 #undef DECLARE_INSTRUCTION | 7020 #undef DECLARE_INSTRUCTION |
| 6998 #undef DECLARE_CONCRETE_INSTRUCTION | 7021 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6999 | 7022 |
| 7000 } } // namespace v8::internal | 7023 } } // namespace v8::internal |
| 7001 | 7024 |
| 7002 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7025 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |