OLD | NEW |
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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 return (flags_ & kReturnTrueFalseObject) != 0; | 382 return (flags_ & kReturnTrueFalseObject) != 0; |
383 } | 383 } |
384 | 384 |
385 const char* GetName(); | 385 const char* GetName(); |
386 | 386 |
387 Flags flags_; | 387 Flags flags_; |
388 char* name_; | 388 char* name_; |
389 }; | 389 }; |
390 | 390 |
391 | 391 |
392 enum NegativeZeroHandling { | |
393 kStrictNegativeZero, | |
394 kIgnoreNegativeZero | |
395 }; | |
396 | |
397 | |
398 enum UnaryOpFlags { | |
399 NO_UNARY_FLAGS = 0, | |
400 NO_UNARY_SMI_CODE_IN_STUB = 1 << 0 | |
401 }; | |
402 | |
403 | |
404 class GenericUnaryOpStub : public CodeStub { | |
405 public: | |
406 GenericUnaryOpStub(Token::Value op, | |
407 UnaryOverwriteMode overwrite, | |
408 UnaryOpFlags flags, | |
409 NegativeZeroHandling negative_zero = kStrictNegativeZero) | |
410 : op_(op), | |
411 overwrite_(overwrite), | |
412 include_smi_code_((flags & NO_UNARY_SMI_CODE_IN_STUB) == 0), | |
413 negative_zero_(negative_zero) { } | |
414 | |
415 private: | |
416 Token::Value op_; | |
417 UnaryOverwriteMode overwrite_; | |
418 bool include_smi_code_; | |
419 NegativeZeroHandling negative_zero_; | |
420 | |
421 class OverwriteField: public BitField<UnaryOverwriteMode, 0, 1> {}; | |
422 class IncludeSmiCodeField: public BitField<bool, 1, 1> {}; | |
423 class NegativeZeroField: public BitField<NegativeZeroHandling, 2, 1> {}; | |
424 class OpField: public BitField<Token::Value, 3, kMinorBits - 3> {}; | |
425 | |
426 Major MajorKey() { return GenericUnaryOp; } | |
427 int MinorKey() { | |
428 return OpField::encode(op_) | | |
429 OverwriteField::encode(overwrite_) | | |
430 IncludeSmiCodeField::encode(include_smi_code_) | | |
431 NegativeZeroField::encode(negative_zero_); | |
432 } | |
433 | |
434 void Generate(MacroAssembler* masm); | |
435 | |
436 const char* GetName(); | |
437 }; | |
438 | |
439 | |
440 class MathPowStub: public CodeStub { | 392 class MathPowStub: public CodeStub { |
441 public: | 393 public: |
442 MathPowStub() {} | 394 MathPowStub() {} |
443 virtual void Generate(MacroAssembler* masm); | 395 virtual void Generate(MacroAssembler* masm); |
444 | 396 |
445 private: | 397 private: |
446 virtual CodeStub::Major MajorKey() { return MathPow; } | 398 virtual CodeStub::Major MajorKey() { return MathPow; } |
447 virtual int MinorKey() { return 0; } | 399 virtual int MinorKey() { return 0; } |
448 | 400 |
449 const char* GetName() { return "MathPowStub"; } | 401 const char* GetName() { return "MathPowStub"; } |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 private: | 913 private: |
962 MacroAssembler* masm_; | 914 MacroAssembler* masm_; |
963 bool previous_allow_; | 915 bool previous_allow_; |
964 | 916 |
965 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 917 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
966 }; | 918 }; |
967 | 919 |
968 } } // namespace v8::internal | 920 } } // namespace v8::internal |
969 | 921 |
970 #endif // V8_CODE_STUBS_H_ | 922 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |