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