| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // AnalyzeCondition | 68 // AnalyzeCondition |
| 69 // CodeForFunctionPosition | 69 // CodeForFunctionPosition |
| 70 // CodeForReturnPosition | 70 // CodeForReturnPosition |
| 71 // CodeForStatementPosition | 71 // CodeForStatementPosition |
| 72 // CodeForDoWhileConditionPosition | 72 // CodeForDoWhileConditionPosition |
| 73 // CodeForSourcePosition | 73 // CodeForSourcePosition |
| 74 | 74 |
| 75 | 75 |
| 76 // Mode to overwrite BinaryExpression values. | 76 // Mode to overwrite BinaryExpression values. |
| 77 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; | 77 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; |
| 78 enum UnaryOverwriteMode { UNARY_OVERWRITE, UNARY_NO_OVERWRITE }; |
| 78 | 79 |
| 79 // Types of uncatchable exceptions. | 80 // Types of uncatchable exceptions. |
| 80 enum UncatchableExceptionType { OUT_OF_MEMORY, TERMINATION }; | 81 enum UncatchableExceptionType { OUT_OF_MEMORY, TERMINATION }; |
| 81 | 82 |
| 82 | 83 |
| 83 #if V8_TARGET_ARCH_IA32 | 84 #if V8_TARGET_ARCH_IA32 |
| 84 #include "ia32/codegen-ia32.h" | 85 #include "ia32/codegen-ia32.h" |
| 85 #elif V8_TARGET_ARCH_X64 | 86 #elif V8_TARGET_ARCH_X64 |
| 86 #include "x64/codegen-x64.h" | 87 #include "x64/codegen-x64.h" |
| 87 #elif V8_TARGET_ARCH_ARM | 88 #elif V8_TARGET_ARCH_ARM |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 InstanceofStub() { } | 408 InstanceofStub() { } |
| 408 | 409 |
| 409 void Generate(MacroAssembler* masm); | 410 void Generate(MacroAssembler* masm); |
| 410 | 411 |
| 411 private: | 412 private: |
| 412 Major MajorKey() { return Instanceof; } | 413 Major MajorKey() { return Instanceof; } |
| 413 int MinorKey() { return 0; } | 414 int MinorKey() { return 0; } |
| 414 }; | 415 }; |
| 415 | 416 |
| 416 | 417 |
| 418 enum NegativeZeroHandling { |
| 419 kStrictNegativeZero, |
| 420 kIgnoreNegativeZero |
| 421 }; |
| 422 |
| 423 |
| 417 class GenericUnaryOpStub : public CodeStub { | 424 class GenericUnaryOpStub : public CodeStub { |
| 418 public: | 425 public: |
| 419 GenericUnaryOpStub(Token::Value op, bool overwrite) | 426 GenericUnaryOpStub(Token::Value op, |
| 420 : op_(op), overwrite_(overwrite) { } | 427 UnaryOverwriteMode overwrite, |
| 428 NegativeZeroHandling negative_zero = kStrictNegativeZero) |
| 429 : op_(op), overwrite_(overwrite), negative_zero_(negative_zero) { } |
| 421 | 430 |
| 422 private: | 431 private: |
| 423 Token::Value op_; | 432 Token::Value op_; |
| 424 bool overwrite_; | 433 UnaryOverwriteMode overwrite_; |
| 434 NegativeZeroHandling negative_zero_; |
| 425 | 435 |
| 426 class OverwriteField: public BitField<int, 0, 1> {}; | 436 class OverwriteField: public BitField<UnaryOverwriteMode, 0, 1> {}; |
| 427 class OpField: public BitField<Token::Value, 1, kMinorBits - 1> {}; | 437 class NegativeZeroField: public BitField<NegativeZeroHandling, 1, 1> {}; |
| 438 class OpField: public BitField<Token::Value, 2, kMinorBits - 2> {}; |
| 428 | 439 |
| 429 Major MajorKey() { return GenericUnaryOp; } | 440 Major MajorKey() { return GenericUnaryOp; } |
| 430 int MinorKey() { | 441 int MinorKey() { |
| 431 return OpField::encode(op_) | OverwriteField::encode(overwrite_); | 442 return OpField::encode(op_) | |
| 443 OverwriteField::encode(overwrite_) | |
| 444 NegativeZeroField::encode(negative_zero_); |
| 432 } | 445 } |
| 433 | 446 |
| 434 void Generate(MacroAssembler* masm); | 447 void Generate(MacroAssembler* masm); |
| 435 | 448 |
| 436 const char* GetName(); | 449 const char* GetName(); |
| 437 }; | 450 }; |
| 438 | 451 |
| 439 | 452 |
| 440 enum NaNInformation { | 453 enum NaNInformation { |
| 441 kBothCouldBeNaN, | 454 kBothCouldBeNaN, |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 StringCharFromCodeGenerator char_from_code_generator_; | 871 StringCharFromCodeGenerator char_from_code_generator_; |
| 859 | 872 |
| 860 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 873 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
| 861 }; | 874 }; |
| 862 | 875 |
| 863 | 876 |
| 864 } // namespace internal | 877 } // namespace internal |
| 865 } // namespace v8 | 878 } // namespace v8 |
| 866 | 879 |
| 867 #endif // V8_CODEGEN_H_ | 880 #endif // V8_CODEGEN_H_ |
| OLD | NEW |