OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 4221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4232 // Convert the TOS value into flow to the control destination. | 4232 // Convert the TOS value into flow to the control destination. |
4233 // TODO(X64): Make control flow to control destinations work. | 4233 // TODO(X64): Make control flow to control destinations work. |
4234 ToBoolean(dest); | 4234 ToBoolean(dest); |
4235 } | 4235 } |
4236 | 4236 |
4237 ASSERT(!(force_control && !dest->is_used())); | 4237 ASSERT(!(force_control && !dest->is_used())); |
4238 ASSERT(dest->is_used() || frame_->height() == original_height + 1); | 4238 ASSERT(dest->is_used() || frame_->height() == original_height + 1); |
4239 } | 4239 } |
4240 | 4240 |
4241 | 4241 |
4242 class ToBooleanStub: public CodeStub { | |
4243 public: | |
4244 ToBooleanStub() { } | |
4245 | |
4246 void Generate(MacroAssembler* masm); | |
4247 | |
4248 private: | |
4249 Major MajorKey() { return ToBoolean; } | |
4250 int MinorKey() { return 0; } | |
4251 }; | |
4252 | |
4253 | |
4254 // ECMA-262, section 9.2, page 30: ToBoolean(). Pop the top of stack and | 4242 // ECMA-262, section 9.2, page 30: ToBoolean(). Pop the top of stack and |
4255 // convert it to a boolean in the condition code register or jump to | 4243 // convert it to a boolean in the condition code register or jump to |
4256 // 'false_target'/'true_target' as appropriate. | 4244 // 'false_target'/'true_target' as appropriate. |
4257 void CodeGenerator::ToBoolean(ControlDestination* dest) { | 4245 void CodeGenerator::ToBoolean(ControlDestination* dest) { |
4258 Comment cmnt(masm_, "[ ToBoolean"); | 4246 Comment cmnt(masm_, "[ ToBoolean"); |
4259 | 4247 |
4260 // The value to convert should be popped from the frame. | 4248 // The value to convert should be popped from the frame. |
4261 Result value = frame_->Pop(); | 4249 Result value = frame_->Pop(); |
4262 value.ToRegister(); | 4250 value.ToRegister(); |
4263 // Fast case checks. | 4251 // Fast case checks. |
(...skipping 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7640 int CompareStub::MinorKey() { | 7628 int CompareStub::MinorKey() { |
7641 // Encode the two parameters in a unique 16 bit value. | 7629 // Encode the two parameters in a unique 16 bit value. |
7642 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7630 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
7643 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7631 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
7644 } | 7632 } |
7645 | 7633 |
7646 | 7634 |
7647 #undef __ | 7635 #undef __ |
7648 | 7636 |
7649 } } // namespace v8::internal | 7637 } } // namespace v8::internal |
OLD | NEW |