| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 22 matching lines...) Expand all Loading... |
| 33 #include "ic-inl.h" | 33 #include "ic-inl.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 | 38 |
| 39 // Compute a transcendental math function natively, or call the | 39 // Compute a transcendental math function natively, or call the |
| 40 // TranscendentalCache runtime function. | 40 // TranscendentalCache runtime function. |
| 41 class TranscendentalCacheStub: public CodeStub { | 41 class TranscendentalCacheStub: public CodeStub { |
| 42 public: | 42 public: |
| 43 explicit TranscendentalCacheStub(TranscendentalCache::Type type) | 43 enum ArgumentType { |
| 44 : type_(type) {} | 44 TAGGED = 0, |
| 45 UNTAGGED = 1 << TranscendentalCache::kTranscendentalTypeBits |
| 46 }; |
| 47 |
| 48 explicit TranscendentalCacheStub(TranscendentalCache::Type type, |
| 49 ArgumentType argument_type) |
| 50 : type_(type), argument_type_(argument_type) {} |
| 45 void Generate(MacroAssembler* masm); | 51 void Generate(MacroAssembler* masm); |
| 46 private: | 52 private: |
| 47 TranscendentalCache::Type type_; | 53 TranscendentalCache::Type type_; |
| 54 ArgumentType argument_type_; |
| 55 |
| 48 Major MajorKey() { return TranscendentalCache; } | 56 Major MajorKey() { return TranscendentalCache; } |
| 49 int MinorKey() { return type_; } | 57 int MinorKey() { return type_ | argument_type_; } |
| 50 Runtime::FunctionId RuntimeFunction(); | 58 Runtime::FunctionId RuntimeFunction(); |
| 51 void GenerateOperation(MacroAssembler* masm); | 59 void GenerateOperation(MacroAssembler* masm); |
| 52 }; | 60 }; |
| 53 | 61 |
| 54 | 62 |
| 55 class ToBooleanStub: public CodeStub { | 63 class ToBooleanStub: public CodeStub { |
| 56 public: | 64 public: |
| 57 ToBooleanStub() { } | 65 ToBooleanStub() { } |
| 58 | 66 |
| 59 void Generate(MacroAssembler* masm); | 67 void Generate(MacroAssembler* masm); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode) | 232 TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode) |
| 225 : op_(op), | 233 : op_(op), |
| 226 mode_(mode), | 234 mode_(mode), |
| 227 operands_type_(TRBinaryOpIC::UNINITIALIZED), | 235 operands_type_(TRBinaryOpIC::UNINITIALIZED), |
| 228 result_type_(TRBinaryOpIC::UNINITIALIZED), | 236 result_type_(TRBinaryOpIC::UNINITIALIZED), |
| 229 name_(NULL) { | 237 name_(NULL) { |
| 230 use_sse3_ = CpuFeatures::IsSupported(SSE3); | 238 use_sse3_ = CpuFeatures::IsSupported(SSE3); |
| 231 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 239 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 232 } | 240 } |
| 233 | 241 |
| 234 TypeRecordingBinaryOpStub(int key, | 242 TypeRecordingBinaryOpStub( |
| 243 int key, |
| 235 TRBinaryOpIC::TypeInfo operands_type, | 244 TRBinaryOpIC::TypeInfo operands_type, |
| 236 TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED) | 245 TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED) |
| 237 : op_(OpBits::decode(key)), | 246 : op_(OpBits::decode(key)), |
| 238 mode_(ModeBits::decode(key)), | 247 mode_(ModeBits::decode(key)), |
| 239 use_sse3_(SSE3Bits::decode(key)), | 248 use_sse3_(SSE3Bits::decode(key)), |
| 240 operands_type_(operands_type), | 249 operands_type_(operands_type), |
| 241 result_type_(result_type), | 250 result_type_(result_type), |
| 242 name_(NULL) { | 251 name_(NULL) { } |
| 243 } | |
| 244 | 252 |
| 245 // Generate code to call the stub with the supplied arguments. This will add | 253 // Generate code to call the stub with the supplied arguments. This will add |
| 246 // code at the call site to prepare arguments either in registers or on the | 254 // code at the call site to prepare arguments either in registers or on the |
| 247 // stack together with the actual call. | 255 // stack together with the actual call. |
| 248 void GenerateCall(MacroAssembler* masm, Register left, Register right); | 256 void GenerateCall(MacroAssembler* masm, Register left, Register right); |
| 249 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); | 257 void GenerateCall(MacroAssembler* masm, Register left, Smi* right); |
| 250 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); | 258 void GenerateCall(MacroAssembler* masm, Smi* left, Register right); |
| 251 | 259 |
| 252 private: | 260 private: |
| 253 enum SmiCodeGenerateHeapNumberResults { | 261 enum SmiCodeGenerateHeapNumberResults { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 void Print() { | 496 void Print() { |
| 489 PrintF("NumberToStringStub\n"); | 497 PrintF("NumberToStringStub\n"); |
| 490 } | 498 } |
| 491 #endif | 499 #endif |
| 492 }; | 500 }; |
| 493 | 501 |
| 494 | 502 |
| 495 } } // namespace v8::internal | 503 } } // namespace v8::internal |
| 496 | 504 |
| 497 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 505 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
| OLD | NEW |