| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 #define DECLARE_CONCRETE_INSTRUCTION(type) \ | 218 #define DECLARE_CONCRETE_INSTRUCTION(type) \ |
| 219 virtual LInstruction* CompileToLithium(LChunkBuilder* builder); \ | 219 virtual LInstruction* CompileToLithium(LChunkBuilder* builder); \ |
| 220 static H##type* cast(HValue* value) { \ | 220 static H##type* cast(HValue* value) { \ |
| 221 ASSERT(value->Is##type()); \ | 221 ASSERT(value->Is##type()); \ |
| 222 return reinterpret_cast<H##type*>(value); \ | 222 return reinterpret_cast<H##type*>(value); \ |
| 223 } \ | 223 } \ |
| 224 virtual Opcode opcode() const { return HValue::k##type; } | 224 virtual Opcode opcode() const { return HValue::k##type; } |
| 225 | 225 |
| 226 | 226 |
| 227 #ifdef DEBUG |
| 228 #define ASSERT_ALLOCATION_DISABLED do { \ |
| 229 OptimizingCompilerThread* thread = \ |
| 230 ISOLATE->optimizing_compiler_thread(); \ |
| 231 ASSERT(thread->IsOptimizerThread() || !HEAP->IsAllocationAllowed()); \ |
| 232 } while (0) |
| 233 #else |
| 234 #define ASSERT_ALLOCATION_DISABLED do {} while (0) |
| 235 #endif |
| 236 |
| 227 class Range: public ZoneObject { | 237 class Range: public ZoneObject { |
| 228 public: | 238 public: |
| 229 Range() | 239 Range() |
| 230 : lower_(kMinInt), | 240 : lower_(kMinInt), |
| 231 upper_(kMaxInt), | 241 upper_(kMaxInt), |
| 232 next_(NULL), | 242 next_(NULL), |
| 233 can_be_minus_zero_(false) { } | 243 can_be_minus_zero_(false) { } |
| 234 | 244 |
| 235 Range(int32_t lower, int32_t upper) | 245 Range(int32_t lower, int32_t upper) |
| 236 : lower_(lower), | 246 : lower_(lower), |
| (...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2282 | 2292 |
| 2283 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps) | 2293 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps) |
| 2284 | 2294 |
| 2285 virtual Representation RequiredInputRepresentation(int index) { | 2295 virtual Representation RequiredInputRepresentation(int index) { |
| 2286 return Representation::None(); | 2296 return Representation::None(); |
| 2287 } | 2297 } |
| 2288 | 2298 |
| 2289 virtual void PrintDataTo(StringStream* stream); | 2299 virtual void PrintDataTo(StringStream* stream); |
| 2290 | 2300 |
| 2291 virtual intptr_t Hashcode() { | 2301 virtual intptr_t Hashcode() { |
| 2292 ASSERT(!HEAP->IsAllocationAllowed()); | 2302 ASSERT_ALLOCATION_DISABLED; |
| 2293 intptr_t hash = reinterpret_cast<intptr_t>(*prototype()); | 2303 intptr_t hash = reinterpret_cast<intptr_t>(*prototype()); |
| 2294 hash = 17 * hash + reinterpret_cast<intptr_t>(*holder()); | 2304 hash = 17 * hash + reinterpret_cast<intptr_t>(*holder()); |
| 2295 return hash; | 2305 return hash; |
| 2296 } | 2306 } |
| 2297 | 2307 |
| 2298 protected: | 2308 protected: |
| 2299 virtual bool DataEquals(HValue* other) { | 2309 virtual bool DataEquals(HValue* other) { |
| 2300 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); | 2310 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); |
| 2301 return prototype_.is_identical_to(b->prototype()) && | 2311 return prototype_.is_identical_to(b->prototype()) && |
| 2302 holder_.is_identical_to(b->holder()); | 2312 holder_.is_identical_to(b->holder()); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2528 ASSERT(HasNumberValue()); | 2538 ASSERT(HasNumberValue()); |
| 2529 // Irrespective of whether a numeric HConstant can be safely | 2539 // Irrespective of whether a numeric HConstant can be safely |
| 2530 // represented as an int32, we store the (in some cases lossy) | 2540 // represented as an int32, we store the (in some cases lossy) |
| 2531 // representation of the number in int32_value_. | 2541 // representation of the number in int32_value_. |
| 2532 return int32_value_; | 2542 return int32_value_; |
| 2533 } | 2543 } |
| 2534 | 2544 |
| 2535 bool ToBoolean(); | 2545 bool ToBoolean(); |
| 2536 | 2546 |
| 2537 virtual intptr_t Hashcode() { | 2547 virtual intptr_t Hashcode() { |
| 2538 ASSERT(!HEAP->allow_allocation(false)); | 2548 ASSERT_ALLOCATION_DISABLED; |
| 2539 intptr_t hash; | 2549 intptr_t hash; |
| 2540 | 2550 |
| 2541 if (has_int32_value_) { | 2551 if (has_int32_value_) { |
| 2542 hash = static_cast<intptr_t>(int32_value_); | 2552 hash = static_cast<intptr_t>(int32_value_); |
| 2543 } else if (has_double_value_) { | 2553 } else if (has_double_value_) { |
| 2544 hash = static_cast<intptr_t>(BitCast<int64_t>(double_value_)); | 2554 hash = static_cast<intptr_t>(BitCast<int64_t>(double_value_)); |
| 2545 } else { | 2555 } else { |
| 2546 ASSERT(!handle_.is_null()); | 2556 ASSERT(!handle_.is_null()); |
| 2547 hash = reinterpret_cast<intptr_t>(*handle_); | 2557 hash = reinterpret_cast<intptr_t>(*handle_); |
| 2548 } | 2558 } |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3633 SetFlag(kUseGVN); | 3643 SetFlag(kUseGVN); |
| 3634 SetGVNFlag(kDependsOnGlobalVars); | 3644 SetGVNFlag(kDependsOnGlobalVars); |
| 3635 } | 3645 } |
| 3636 | 3646 |
| 3637 Handle<JSGlobalPropertyCell> cell() const { return cell_; } | 3647 Handle<JSGlobalPropertyCell> cell() const { return cell_; } |
| 3638 bool RequiresHoleCheck(); | 3648 bool RequiresHoleCheck(); |
| 3639 | 3649 |
| 3640 virtual void PrintDataTo(StringStream* stream); | 3650 virtual void PrintDataTo(StringStream* stream); |
| 3641 | 3651 |
| 3642 virtual intptr_t Hashcode() { | 3652 virtual intptr_t Hashcode() { |
| 3643 ASSERT(!HEAP->allow_allocation(false)); | 3653 ASSERT_ALLOCATION_DISABLED; |
| 3644 return reinterpret_cast<intptr_t>(*cell_); | 3654 return reinterpret_cast<intptr_t>(*cell_); |
| 3645 } | 3655 } |
| 3646 | 3656 |
| 3647 virtual Representation RequiredInputRepresentation(int index) { | 3657 virtual Representation RequiredInputRepresentation(int index) { |
| 3648 return Representation::None(); | 3658 return Representation::None(); |
| 3649 } | 3659 } |
| 3650 | 3660 |
| 3651 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) | 3661 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) |
| 3652 | 3662 |
| 3653 protected: | 3663 protected: |
| (...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5150 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 5160 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
| 5151 }; | 5161 }; |
| 5152 | 5162 |
| 5153 | 5163 |
| 5154 #undef DECLARE_INSTRUCTION | 5164 #undef DECLARE_INSTRUCTION |
| 5155 #undef DECLARE_CONCRETE_INSTRUCTION | 5165 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5156 | 5166 |
| 5157 } } // namespace v8::internal | 5167 } } // namespace v8::internal |
| 5158 | 5168 |
| 5159 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5169 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |