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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 bool IsMarkedAsCall() const { return IsCall(); } | 259 bool IsMarkedAsCall() const { return IsCall(); } |
260 | 260 |
261 virtual bool HasResult() const = 0; | 261 virtual bool HasResult() const = 0; |
262 virtual LOperand* result() const = 0; | 262 virtual LOperand* result() const = 0; |
263 | 263 |
264 LOperand* FirstInput() { return InputAt(0); } | 264 LOperand* FirstInput() { return InputAt(0); } |
265 LOperand* Output() { return HasResult() ? result() : NULL; } | 265 LOperand* Output() { return HasResult() ? result() : NULL; } |
266 | 266 |
267 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 267 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
268 | 268 |
269 virtual bool MustSignExtendResult(LPlatformChunk* chunk) const { | |
270 return false; | |
271 } | |
272 | |
269 #ifdef DEBUG | 273 #ifdef DEBUG |
270 void VerifyCall(); | 274 void VerifyCall(); |
271 #endif | 275 #endif |
272 | 276 |
273 private: | 277 private: |
274 // Iterator support. | 278 // Iterator support. |
275 friend class InputIterator; | 279 friend class InputIterator; |
276 virtual int InputCount() = 0; | 280 virtual int InputCount() = 0; |
277 virtual LOperand* InputAt(int i) = 0; | 281 virtual LOperand* InputAt(int i) = 0; |
278 | 282 |
(...skipping 15 matching lines...) Expand all Loading... | |
294 class LTemplateResultInstruction : public LInstruction { | 298 class LTemplateResultInstruction : public LInstruction { |
295 public: | 299 public: |
296 // Allow 0 or 1 output operands. | 300 // Allow 0 or 1 output operands. |
297 STATIC_ASSERT(R == 0 || R == 1); | 301 STATIC_ASSERT(R == 0 || R == 1); |
298 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { | 302 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { |
299 return R != 0 && result() != NULL; | 303 return R != 0 && result() != NULL; |
300 } | 304 } |
301 void set_result(LOperand* operand) { results_[0] = operand; } | 305 void set_result(LOperand* operand) { results_[0] = operand; } |
302 LOperand* result() const { return results_[0]; } | 306 LOperand* result() const { return results_[0]; } |
303 | 307 |
308 virtual bool MustSignExtendResult( | |
309 LPlatformChunk* chunk) const V8_FINAL V8_OVERRIDE; | |
310 | |
304 protected: | 311 protected: |
305 EmbeddedContainer<LOperand*, R> results_; | 312 EmbeddedContainer<LOperand*, R> results_; |
306 }; | 313 }; |
307 | 314 |
308 | 315 |
309 // R = number of result operands (0 or 1). | 316 // R = number of result operands (0 or 1). |
310 // I = number of input operands. | 317 // I = number of input operands. |
311 // T = number of temporary operands. | 318 // T = number of temporary operands. |
312 template<int R, int I, int T> | 319 template<int R, int I, int T> |
313 class LTemplateInstruction : public LTemplateResultInstruction<R> { | 320 class LTemplateInstruction : public LTemplateResultInstruction<R> { |
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2496 LOperand* index() { return inputs_[1]; } | 2503 LOperand* index() { return inputs_[1]; } |
2497 | 2504 |
2498 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2505 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2499 }; | 2506 }; |
2500 | 2507 |
2501 | 2508 |
2502 class LChunkBuilder; | 2509 class LChunkBuilder; |
2503 class LPlatformChunk V8_FINAL : public LChunk { | 2510 class LPlatformChunk V8_FINAL : public LChunk { |
2504 public: | 2511 public: |
2505 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2512 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2506 : LChunk(info, graph) { } | 2513 : LChunk(info, graph), |
2514 key_values_(graph->GetMaximumValueID(), graph->zone()) { } | |
2507 | 2515 |
2508 int GetNextSpillIndex(RegisterKind kind); | 2516 int GetNextSpillIndex(RegisterKind kind); |
2509 LOperand* GetNextSpillSlot(RegisterKind kind); | 2517 LOperand* GetNextSpillSlot(RegisterKind kind); |
2518 BitVector* GetKeyValues() { return &key_values_; } | |
2519 | |
2520 private: | |
2521 BitVector key_values_; | |
danno
2014/03/18 08:20:20
This variable, the accesses for it and naming base
Weiliang
2014/03/19 08:55:31
Done.
| |
2510 }; | 2522 }; |
2511 | 2523 |
2512 | 2524 |
2513 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { | 2525 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
2514 public: | 2526 public: |
2515 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2527 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2516 : LChunkBuilderBase(graph->zone()), | 2528 : LChunkBuilderBase(graph->zone()), |
2517 chunk_(NULL), | 2529 chunk_(NULL), |
2518 info_(info), | 2530 info_(info), |
2519 graph_(graph), | 2531 graph_(graph), |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2665 | 2677 |
2666 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2678 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2667 }; | 2679 }; |
2668 | 2680 |
2669 #undef DECLARE_HYDROGEN_ACCESSOR | 2681 #undef DECLARE_HYDROGEN_ACCESSOR |
2670 #undef DECLARE_CONCRETE_INSTRUCTION | 2682 #undef DECLARE_CONCRETE_INSTRUCTION |
2671 | 2683 |
2672 } } // namespace v8::int | 2684 } } // namespace v8::int |
2673 | 2685 |
2674 #endif // V8_X64_LITHIUM_X64_H_ | 2686 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |