| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 InstanceofStub() { } | 287 InstanceofStub() { } |
| 288 | 288 |
| 289 void Generate(MacroAssembler* masm); | 289 void Generate(MacroAssembler* masm); |
| 290 | 290 |
| 291 private: | 291 private: |
| 292 Major MajorKey() { return Instanceof; } | 292 Major MajorKey() { return Instanceof; } |
| 293 int MinorKey() { return 0; } | 293 int MinorKey() { return 0; } |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 | 296 |
| 297 class UnarySubStub : public CodeStub { | 297 class GenericUnaryOpStub : public CodeStub { |
| 298 public: | 298 public: |
| 299 explicit UnarySubStub(bool overwrite) | 299 GenericUnaryOpStub(Token::Value op, bool overwrite) |
| 300 : overwrite_(overwrite) { } | 300 : op_(op), overwrite_(overwrite) { } |
| 301 | 301 |
| 302 private: | 302 private: |
| 303 Token::Value op_; |
| 303 bool overwrite_; | 304 bool overwrite_; |
| 304 Major MajorKey() { return UnarySub; } | 305 |
| 305 int MinorKey() { return overwrite_ ? 1 : 0; } | 306 class OverwriteField: public BitField<int, 0, 1> {}; |
| 307 class OpField: public BitField<Token::Value, 1, kMinorBits - 1> {}; |
| 308 |
| 309 Major MajorKey() { return GenericUnaryOp; } |
| 310 int MinorKey() { |
| 311 return OpField::encode(op_) | OverwriteField::encode(overwrite_); |
| 312 } |
| 313 |
| 306 void Generate(MacroAssembler* masm); | 314 void Generate(MacroAssembler* masm); |
| 307 | 315 |
| 308 const char* GetName() { | 316 const char* GetName(); |
| 309 return overwrite_ ? "UnarySubStub_Overwrite" : "UnarySubStub_Alloc"; | |
| 310 } | |
| 311 }; | 317 }; |
| 312 | 318 |
| 313 | 319 |
| 314 class CompareStub: public CodeStub { | 320 class CompareStub: public CodeStub { |
| 315 public: | 321 public: |
| 316 CompareStub(Condition cc, bool strict) : cc_(cc), strict_(strict) { } | 322 CompareStub(Condition cc, bool strict) : cc_(cc), strict_(strict) { } |
| 317 | 323 |
| 318 void Generate(MacroAssembler* masm); | 324 void Generate(MacroAssembler* masm); |
| 319 | 325 |
| 320 private: | 326 private: |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 475 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
| 470 } | 476 } |
| 471 #endif | 477 #endif |
| 472 }; | 478 }; |
| 473 | 479 |
| 474 | 480 |
| 475 } // namespace internal | 481 } // namespace internal |
| 476 } // namespace v8 | 482 } // namespace v8 |
| 477 | 483 |
| 478 #endif // V8_CODEGEN_H_ | 484 #endif // V8_CODEGEN_H_ |
| OLD | NEW |