| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // |
| 3 // Copyright IBM Corp. 2012, 2013. All rights reserved. |
| 4 // |
| 2 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 6 // found in the LICENSE file. |
| 4 | 7 |
| 5 #ifndef V8_ARM_LITHIUM_ARM_H_ | 8 #ifndef V8_PPC_LITHIUM_PPC_H_ |
| 6 #define V8_ARM_LITHIUM_ARM_H_ | 9 #define V8_PPC_LITHIUM_PPC_H_ |
| 7 | 10 |
| 8 #include "src/hydrogen.h" | 11 #include "src/hydrogen.h" |
| 9 #include "src/lithium.h" | 12 #include "src/lithium.h" |
| 10 #include "src/lithium-allocator.h" | 13 #include "src/lithium-allocator.h" |
| 11 #include "src/safepoint-table.h" | 14 #include "src/safepoint-table.h" |
| 12 #include "src/utils.h" | 15 #include "src/utils.h" |
| 13 | 16 |
| 14 namespace v8 { | 17 namespace v8 { |
| 15 namespace internal { | 18 namespace internal { |
| 16 | 19 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 V(ToFastProperties) \ | 162 V(ToFastProperties) \ |
| 160 V(TransitionElementsKind) \ | 163 V(TransitionElementsKind) \ |
| 161 V(TrapAllocationMemento) \ | 164 V(TrapAllocationMemento) \ |
| 162 V(Typeof) \ | 165 V(Typeof) \ |
| 163 V(TypeofIsAndBranch) \ | 166 V(TypeofIsAndBranch) \ |
| 164 V(Uint32ToDouble) \ | 167 V(Uint32ToDouble) \ |
| 165 V(UnknownOSRValue) \ | 168 V(UnknownOSRValue) \ |
| 166 V(WrapReceiver) | 169 V(WrapReceiver) |
| 167 | 170 |
| 168 | 171 |
| 169 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 172 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 170 virtual Opcode opcode() const FINAL OVERRIDE { \ | 173 virtual Opcode opcode() const FINAL OVERRIDE { \ |
| 171 return LInstruction::k##type; \ | 174 return LInstruction::k##type; \ |
| 172 } \ | 175 } \ |
| 173 virtual void CompileToNative(LCodeGen* generator) FINAL OVERRIDE; \ | 176 virtual void CompileToNative(LCodeGen* generator) FINAL OVERRIDE; \ |
| 174 virtual const char* Mnemonic() const FINAL OVERRIDE { \ | 177 virtual const char* Mnemonic() const FINAL OVERRIDE { return mnemonic; } \ |
| 175 return mnemonic; \ | 178 static L##type* cast(LInstruction* instr) { \ |
| 176 } \ | 179 DCHECK(instr->Is##type()); \ |
| 177 static L##type* cast(LInstruction* instr) { \ | 180 return reinterpret_cast<L##type*>(instr); \ |
| 178 DCHECK(instr->Is##type()); \ | |
| 179 return reinterpret_cast<L##type*>(instr); \ | |
| 180 } | 181 } |
| 181 | 182 |
| 182 | 183 |
| 183 #define DECLARE_HYDROGEN_ACCESSOR(type) \ | 184 #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
| 184 H##type* hydrogen() const { \ | 185 H##type* hydrogen() const { return H##type::cast(hydrogen_value()); } |
| 185 return H##type::cast(hydrogen_value()); \ | |
| 186 } | |
| 187 | 186 |
| 188 | 187 |
| 189 class LInstruction : public ZoneObject { | 188 class LInstruction : public ZoneObject { |
| 190 public: | 189 public: |
| 191 LInstruction() | 190 LInstruction() |
| 192 : environment_(NULL), | 191 : environment_(NULL), |
| 193 hydrogen_value_(NULL), | 192 hydrogen_value_(NULL), |
| 194 bit_field_(IsCallBits::encode(false)) { | 193 bit_field_(IsCallBits::encode(false)) {} |
| 195 } | |
| 196 | 194 |
| 197 virtual ~LInstruction() {} | 195 virtual ~LInstruction() {} |
| 198 | 196 |
| 199 virtual void CompileToNative(LCodeGen* generator) = 0; | 197 virtual void CompileToNative(LCodeGen* generator) = 0; |
| 200 virtual const char* Mnemonic() const = 0; | 198 virtual const char* Mnemonic() const = 0; |
| 201 virtual void PrintTo(StringStream* stream); | 199 virtual void PrintTo(StringStream* stream); |
| 202 virtual void PrintDataTo(StringStream* stream); | 200 virtual void PrintDataTo(StringStream* stream); |
| 203 virtual void PrintOutputOperandTo(StringStream* stream); | 201 virtual void PrintOutputOperandTo(StringStream* stream); |
| 204 | 202 |
| 205 enum Opcode { | 203 enum Opcode { |
| 206 // Declare a unique enum value for each instruction. | 204 // Declare a unique enum value for each instruction. |
| 207 #define DECLARE_OPCODE(type) k##type, | 205 #define DECLARE_OPCODE(type) k##type, |
| 208 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) | 206 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) kNumberOfInstructions |
| 209 kNumberOfInstructions | |
| 210 #undef DECLARE_OPCODE | 207 #undef DECLARE_OPCODE |
| 211 }; | 208 }; |
| 212 | 209 |
| 213 virtual Opcode opcode() const = 0; | 210 virtual Opcode opcode() const = 0; |
| 214 | 211 |
| 215 // Declare non-virtual type testers for all leaf IR classes. | 212 // Declare non-virtual type testers for all leaf IR classes. |
| 216 #define DECLARE_PREDICATE(type) \ | 213 #define DECLARE_PREDICATE(type) \ |
| 217 bool Is##type() const { return opcode() == k##type; } | 214 bool Is##type() const { return opcode() == k##type; } |
| 218 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) | 215 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) |
| 219 #undef DECLARE_PREDICATE | 216 #undef DECLARE_PREDICATE |
| 220 | 217 |
| 221 // Declare virtual predicates for instructions that don't have | 218 // Declare virtual predicates for instructions that don't have |
| 222 // an opcode. | 219 // an opcode. |
| 223 virtual bool IsGap() const { return false; } | 220 virtual bool IsGap() const { return false; } |
| 224 | 221 |
| 225 virtual bool IsControl() const { return false; } | 222 virtual bool IsControl() const { return false; } |
| 226 | 223 |
| 227 // Try deleting this instruction if possible. | 224 // Try deleting this instruction if possible. |
| 228 virtual bool TryDelete() { return false; } | 225 virtual bool TryDelete() { return false; } |
| 229 | 226 |
| 230 void set_environment(LEnvironment* env) { environment_ = env; } | 227 void set_environment(LEnvironment* env) { environment_ = env; } |
| 231 LEnvironment* environment() const { return environment_; } | 228 LEnvironment* environment() const { return environment_; } |
| 232 bool HasEnvironment() const { return environment_ != NULL; } | 229 bool HasEnvironment() const { return environment_ != NULL; } |
| 233 | 230 |
| 234 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 231 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 235 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 232 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 236 bool HasPointerMap() const { return pointer_map_.is_set(); } | 233 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 237 | 234 |
| 238 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 235 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 239 HValue* hydrogen_value() const { return hydrogen_value_; } | 236 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 240 | 237 |
| 241 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 238 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {} |
| 242 | 239 |
| 243 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 240 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 244 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 241 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 245 | 242 |
| 246 // Interface to the register allocator and iterators. | 243 // Interface to the register allocator and iterators. |
| 247 bool ClobbersTemps() const { return IsCall(); } | 244 bool ClobbersTemps() const { return IsCall(); } |
| 248 bool ClobbersRegisters() const { return IsCall(); } | 245 bool ClobbersRegisters() const { return IsCall(); } |
| 249 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { | 246 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { |
| 250 return IsCall(); | 247 return IsCall(); |
| 251 } | 248 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 269 virtual LOperand* InputAt(int i) = 0; | 266 virtual LOperand* InputAt(int i) = 0; |
| 270 | 267 |
| 271 private: | 268 private: |
| 272 // Iterator support. | 269 // Iterator support. |
| 273 friend class InputIterator; | 270 friend class InputIterator; |
| 274 | 271 |
| 275 friend class TempIterator; | 272 friend class TempIterator; |
| 276 virtual int TempCount() = 0; | 273 virtual int TempCount() = 0; |
| 277 virtual LOperand* TempAt(int i) = 0; | 274 virtual LOperand* TempAt(int i) = 0; |
| 278 | 275 |
| 279 class IsCallBits: public BitField<bool, 0, 1> {}; | 276 class IsCallBits : public BitField<bool, 0, 1> {}; |
| 280 | 277 |
| 281 LEnvironment* environment_; | 278 LEnvironment* environment_; |
| 282 SetOncePointer<LPointerMap> pointer_map_; | 279 SetOncePointer<LPointerMap> pointer_map_; |
| 283 HValue* hydrogen_value_; | 280 HValue* hydrogen_value_; |
| 284 int bit_field_; | 281 int bit_field_; |
| 285 }; | 282 }; |
| 286 | 283 |
| 287 | 284 |
| 288 // R = number of result operands (0 or 1). | 285 // R = number of result operands (0 or 1). |
| 289 template<int R> | 286 template <int R> |
| 290 class LTemplateResultInstruction : public LInstruction { | 287 class LTemplateResultInstruction : public LInstruction { |
| 291 public: | 288 public: |
| 292 // Allow 0 or 1 output operands. | 289 // Allow 0 or 1 output operands. |
| 293 STATIC_ASSERT(R == 0 || R == 1); | 290 STATIC_ASSERT(R == 0 || R == 1); |
| 294 virtual bool HasResult() const FINAL OVERRIDE { | 291 virtual bool HasResult() const FINAL OVERRIDE { |
| 295 return R != 0 && result() != NULL; | 292 return R != 0 && result() != NULL; |
| 296 } | 293 } |
| 297 void set_result(LOperand* operand) { results_[0] = operand; } | 294 void set_result(LOperand* operand) { results_[0] = operand; } |
| 298 LOperand* result() const { return results_[0]; } | 295 LOperand* result() const { return results_[0]; } |
| 299 | 296 |
| 300 protected: | 297 protected: |
| 301 EmbeddedContainer<LOperand*, R> results_; | 298 EmbeddedContainer<LOperand*, R> results_; |
| 302 }; | 299 }; |
| 303 | 300 |
| 304 | 301 |
| 305 // R = number of result operands (0 or 1). | 302 // R = number of result operands (0 or 1). |
| 306 // I = number of input operands. | 303 // I = number of input operands. |
| 307 // T = number of temporary operands. | 304 // T = number of temporary operands. |
| 308 template<int R, int I, int T> | 305 template <int R, int I, int T> |
| 309 class LTemplateInstruction : public LTemplateResultInstruction<R> { | 306 class LTemplateInstruction : public LTemplateResultInstruction<R> { |
| 310 protected: | 307 protected: |
| 311 EmbeddedContainer<LOperand*, I> inputs_; | 308 EmbeddedContainer<LOperand*, I> inputs_; |
| 312 EmbeddedContainer<LOperand*, T> temps_; | 309 EmbeddedContainer<LOperand*, T> temps_; |
| 313 | 310 |
| 314 private: | 311 private: |
| 315 // Iterator support. | 312 // Iterator support. |
| 316 virtual int InputCount() FINAL OVERRIDE { return I; } | 313 virtual int InputCount() FINAL OVERRIDE { return I; } |
| 317 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } | 314 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } |
| 318 | 315 |
| 319 virtual int TempCount() FINAL OVERRIDE { return T; } | 316 virtual int TempCount() FINAL OVERRIDE { return T; } |
| 320 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return temps_[i]; } | 317 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return temps_[i]; } |
| 321 }; | 318 }; |
| 322 | 319 |
| 323 | 320 |
| 324 class LGap : public LTemplateInstruction<0, 0, 0> { | 321 class LGap : public LTemplateInstruction<0, 0, 0> { |
| 325 public: | 322 public: |
| 326 explicit LGap(HBasicBlock* block) | 323 explicit LGap(HBasicBlock* block) : block_(block) { |
| 327 : block_(block) { | |
| 328 parallel_moves_[BEFORE] = NULL; | 324 parallel_moves_[BEFORE] = NULL; |
| 329 parallel_moves_[START] = NULL; | 325 parallel_moves_[START] = NULL; |
| 330 parallel_moves_[END] = NULL; | 326 parallel_moves_[END] = NULL; |
| 331 parallel_moves_[AFTER] = NULL; | 327 parallel_moves_[AFTER] = NULL; |
| 332 } | 328 } |
| 333 | 329 |
| 334 // Can't use the DECLARE-macro here because of sub-classes. | 330 // Can't use the DECLARE-macro here because of sub-classes. |
| 335 virtual bool IsGap() const OVERRIDE { return true; } | 331 virtual bool IsGap() const OVERRIDE { return true; } |
| 336 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 332 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 337 static LGap* cast(LInstruction* instr) { | 333 static LGap* cast(LInstruction* instr) { |
| 338 DCHECK(instr->IsGap()); | 334 DCHECK(instr->IsGap()); |
| 339 return reinterpret_cast<LGap*>(instr); | 335 return reinterpret_cast<LGap*>(instr); |
| 340 } | 336 } |
| 341 | 337 |
| 342 bool IsRedundant() const; | 338 bool IsRedundant() const; |
| 343 | 339 |
| 344 HBasicBlock* block() const { return block_; } | 340 HBasicBlock* block() const { return block_; } |
| 345 | 341 |
| 346 enum InnerPosition { | 342 enum InnerPosition { |
| 347 BEFORE, | 343 BEFORE, |
| 348 START, | 344 START, |
| 349 END, | 345 END, |
| 350 AFTER, | 346 AFTER, |
| 351 FIRST_INNER_POSITION = BEFORE, | 347 FIRST_INNER_POSITION = BEFORE, |
| 352 LAST_INNER_POSITION = AFTER | 348 LAST_INNER_POSITION = AFTER |
| 353 }; | 349 }; |
| 354 | 350 |
| 355 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { | 351 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { |
| 356 if (parallel_moves_[pos] == NULL) { | 352 if (parallel_moves_[pos] == NULL) { |
| 357 parallel_moves_[pos] = new(zone) LParallelMove(zone); | 353 parallel_moves_[pos] = new (zone) LParallelMove(zone); |
| 358 } | 354 } |
| 359 return parallel_moves_[pos]; | 355 return parallel_moves_[pos]; |
| 360 } | 356 } |
| 361 | 357 |
| 362 LParallelMove* GetParallelMove(InnerPosition pos) { | 358 LParallelMove* GetParallelMove(InnerPosition pos) { |
| 363 return parallel_moves_[pos]; | 359 return parallel_moves_[pos]; |
| 364 } | 360 } |
| 365 | 361 |
| 366 private: | 362 private: |
| 367 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 363 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 368 HBasicBlock* block_; | 364 HBasicBlock* block_; |
| 369 }; | 365 }; |
| 370 | 366 |
| 371 | 367 |
| 372 class LInstructionGap FINAL : public LGap { | 368 class LInstructionGap FINAL : public LGap { |
| 373 public: | 369 public: |
| 374 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 370 explicit LInstructionGap(HBasicBlock* block) : LGap(block) {} |
| 375 | 371 |
| 376 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { | 372 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 377 return !IsRedundant(); | 373 return !IsRedundant(); |
| 378 } | 374 } |
| 379 | 375 |
| 380 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 376 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 381 }; | 377 }; |
| 382 | 378 |
| 383 | 379 |
| 384 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> { | 380 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> { |
| 385 public: | 381 public: |
| 386 explicit LGoto(HBasicBlock* block) : block_(block) { } | 382 explicit LGoto(HBasicBlock* block) : block_(block) {} |
| 387 | 383 |
| 388 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE; | 384 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE; |
| 389 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 385 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 390 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 386 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 391 virtual bool IsControl() const OVERRIDE { return true; } | 387 virtual bool IsControl() const OVERRIDE { return true; } |
| 392 | 388 |
| 393 int block_id() const { return block_->block_id(); } | 389 int block_id() const { return block_->block_id(); } |
| 394 | 390 |
| 395 private: | 391 private: |
| 396 HBasicBlock* block_; | 392 HBasicBlock* block_; |
| 397 }; | 393 }; |
| 398 | 394 |
| 399 | 395 |
| 400 class LLazyBailout FINAL : public LTemplateInstruction<0, 0, 0> { | 396 class LLazyBailout FINAL : public LTemplateInstruction<0, 0, 0> { |
| 401 public: | 397 public: |
| 402 LLazyBailout() : gap_instructions_size_(0) { } | 398 LLazyBailout() : gap_instructions_size_(0) {} |
| 403 | 399 |
| 404 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 400 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 405 | 401 |
| 406 void set_gap_instructions_size(int gap_instructions_size) { | 402 void set_gap_instructions_size(int gap_instructions_size) { |
| 407 gap_instructions_size_ = gap_instructions_size; | 403 gap_instructions_size_ = gap_instructions_size; |
| 408 } | 404 } |
| 409 int gap_instructions_size() { return gap_instructions_size_; } | 405 int gap_instructions_size() { return gap_instructions_size_; } |
| 410 | 406 |
| 411 private: | 407 private: |
| 412 int gap_instructions_size_; | 408 int gap_instructions_size_; |
| 413 }; | 409 }; |
| 414 | 410 |
| 415 | 411 |
| 416 class LDummy FINAL : public LTemplateInstruction<1, 0, 0> { | 412 class LDummy FINAL : public LTemplateInstruction<1, 0, 0> { |
| 417 public: | 413 public: |
| 418 LDummy() {} | 414 LDummy() {} |
| 419 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") | 415 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") |
| 420 }; | 416 }; |
| 421 | 417 |
| 422 | 418 |
| 423 class LDummyUse FINAL : public LTemplateInstruction<1, 1, 0> { | 419 class LDummyUse FINAL : public LTemplateInstruction<1, 1, 0> { |
| 424 public: | 420 public: |
| 425 explicit LDummyUse(LOperand* value) { | 421 explicit LDummyUse(LOperand* value) { inputs_[0] = value; } |
| 426 inputs_[0] = value; | |
| 427 } | |
| 428 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") | 422 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") |
| 429 }; | 423 }; |
| 430 | 424 |
| 431 | 425 |
| 432 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> { | 426 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> { |
| 433 public: | 427 public: |
| 434 virtual bool IsControl() const OVERRIDE { return true; } | 428 virtual bool IsControl() const OVERRIDE { return true; } |
| 435 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 429 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 436 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) | 430 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) |
| 437 }; | 431 }; |
| 438 | 432 |
| 439 | 433 |
| 440 class LLabel FINAL : public LGap { | 434 class LLabel FINAL : public LGap { |
| 441 public: | 435 public: |
| 442 explicit LLabel(HBasicBlock* block) | 436 explicit LLabel(HBasicBlock* block) : LGap(block), replacement_(NULL) {} |
| 443 : LGap(block), replacement_(NULL) { } | |
| 444 | 437 |
| 445 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { | 438 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 446 return false; | 439 return false; |
| 447 } | 440 } |
| 448 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 441 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 449 | 442 |
| 450 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 443 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 451 | 444 |
| 452 int block_id() const { return block()->block_id(); } | 445 int block_id() const { return block()->block_id(); } |
| 453 bool is_loop_header() const { return block()->IsLoopHeader(); } | 446 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 465 | 458 |
| 466 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> { | 459 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> { |
| 467 public: | 460 public: |
| 468 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } | 461 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 469 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 462 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 470 }; | 463 }; |
| 471 | 464 |
| 472 | 465 |
| 473 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { | 466 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { |
| 474 public: | 467 public: |
| 475 explicit LCallStub(LOperand* context) { | 468 explicit LCallStub(LOperand* context) { inputs_[0] = context; } |
| 476 inputs_[0] = context; | |
| 477 } | |
| 478 | 469 |
| 479 LOperand* context() { return inputs_[0]; } | 470 LOperand* context() { return inputs_[0]; } |
| 480 | 471 |
| 481 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 472 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 482 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 473 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 483 }; | 474 }; |
| 484 | 475 |
| 485 | 476 |
| 486 class LTailCallThroughMegamorphicCache FINAL | 477 class LTailCallThroughMegamorphicCache FINAL |
| 487 : public LTemplateInstruction<0, 3, 0> { | 478 : public LTemplateInstruction<0, 3, 0> { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 505 | 496 |
| 506 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { | 497 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { |
| 507 public: | 498 public: |
| 508 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { | 499 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 509 return false; | 500 return false; |
| 510 } | 501 } |
| 511 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 502 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 512 }; | 503 }; |
| 513 | 504 |
| 514 | 505 |
| 515 template<int I, int T> | 506 template <int I, int T> |
| 516 class LControlInstruction : public LTemplateInstruction<0, I, T> { | 507 class LControlInstruction : public LTemplateInstruction<0, I, T> { |
| 517 public: | 508 public: |
| 518 LControlInstruction() : false_label_(NULL), true_label_(NULL) { } | 509 LControlInstruction() : false_label_(NULL), true_label_(NULL) {} |
| 519 | 510 |
| 520 virtual bool IsControl() const FINAL OVERRIDE { return true; } | 511 virtual bool IsControl() const FINAL OVERRIDE { return true; } |
| 521 | 512 |
| 522 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 513 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| 523 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } | 514 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } |
| 524 | 515 |
| 525 int TrueDestination(LChunk* chunk) { | 516 int TrueDestination(LChunk* chunk) { |
| 526 return chunk->LookupDestination(true_block_id()); | 517 return chunk->LookupDestination(true_block_id()); |
| 527 } | 518 } |
| 528 int FalseDestination(LChunk* chunk) { | 519 int FalseDestination(LChunk* chunk) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") | 557 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") |
| 567 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) | 558 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) |
| 568 | 559 |
| 569 LOperand* receiver() { return inputs_[0]; } | 560 LOperand* receiver() { return inputs_[0]; } |
| 570 LOperand* function() { return inputs_[1]; } | 561 LOperand* function() { return inputs_[1]; } |
| 571 }; | 562 }; |
| 572 | 563 |
| 573 | 564 |
| 574 class LApplyArguments FINAL : public LTemplateInstruction<1, 4, 0> { | 565 class LApplyArguments FINAL : public LTemplateInstruction<1, 4, 0> { |
| 575 public: | 566 public: |
| 576 LApplyArguments(LOperand* function, | 567 LApplyArguments(LOperand* function, LOperand* receiver, LOperand* length, |
| 577 LOperand* receiver, | |
| 578 LOperand* length, | |
| 579 LOperand* elements) { | 568 LOperand* elements) { |
| 580 inputs_[0] = function; | 569 inputs_[0] = function; |
| 581 inputs_[1] = receiver; | 570 inputs_[1] = receiver; |
| 582 inputs_[2] = length; | 571 inputs_[2] = length; |
| 583 inputs_[3] = elements; | 572 inputs_[3] = elements; |
| 584 } | 573 } |
| 585 | 574 |
| 586 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") | 575 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") |
| 587 | 576 |
| 588 LOperand* function() { return inputs_[0]; } | 577 LOperand* function() { return inputs_[0]; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 605 LOperand* arguments() { return inputs_[0]; } | 594 LOperand* arguments() { return inputs_[0]; } |
| 606 LOperand* length() { return inputs_[1]; } | 595 LOperand* length() { return inputs_[1]; } |
| 607 LOperand* index() { return inputs_[2]; } | 596 LOperand* index() { return inputs_[2]; } |
| 608 | 597 |
| 609 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 598 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 610 }; | 599 }; |
| 611 | 600 |
| 612 | 601 |
| 613 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> { | 602 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> { |
| 614 public: | 603 public: |
| 615 explicit LArgumentsLength(LOperand* elements) { | 604 explicit LArgumentsLength(LOperand* elements) { inputs_[0] = elements; } |
| 616 inputs_[0] = elements; | |
| 617 } | |
| 618 | 605 |
| 619 LOperand* elements() { return inputs_[0]; } | 606 LOperand* elements() { return inputs_[0]; } |
| 620 | 607 |
| 621 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") | 608 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
| 622 }; | 609 }; |
| 623 | 610 |
| 624 | 611 |
| 625 class LArgumentsElements FINAL : public LTemplateInstruction<1, 0, 0> { | 612 class LArgumentsElements FINAL : public LTemplateInstruction<1, 0, 0> { |
| 626 public: | 613 public: |
| 627 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") | 614 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") |
| (...skipping 30 matching lines...) Expand all Loading... |
| 658 int32_t divisor() const { return divisor_; } | 645 int32_t divisor() const { return divisor_; } |
| 659 | 646 |
| 660 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") | 647 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") |
| 661 DECLARE_HYDROGEN_ACCESSOR(Mod) | 648 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 662 | 649 |
| 663 private: | 650 private: |
| 664 int32_t divisor_; | 651 int32_t divisor_; |
| 665 }; | 652 }; |
| 666 | 653 |
| 667 | 654 |
| 668 class LModI FINAL : public LTemplateInstruction<1, 2, 2> { | 655 class LModI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 669 public: | 656 public: |
| 670 LModI(LOperand* left, LOperand* right, LOperand* temp, LOperand* temp2) { | 657 LModI(LOperand* left, LOperand* right) { |
| 671 inputs_[0] = left; | 658 inputs_[0] = left; |
| 672 inputs_[1] = right; | 659 inputs_[1] = right; |
| 673 temps_[0] = temp; | |
| 674 temps_[1] = temp2; | |
| 675 } | 660 } |
| 676 | 661 |
| 677 LOperand* left() { return inputs_[0]; } | 662 LOperand* left() { return inputs_[0]; } |
| 678 LOperand* right() { return inputs_[1]; } | 663 LOperand* right() { return inputs_[1]; } |
| 679 LOperand* temp() { return temps_[0]; } | |
| 680 LOperand* temp2() { return temps_[1]; } | |
| 681 | 664 |
| 682 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") | 665 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") |
| 683 DECLARE_HYDROGEN_ACCESSOR(Mod) | 666 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 684 }; | 667 }; |
| 685 | 668 |
| 686 | 669 |
| 687 class LDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { | 670 class LDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { |
| 688 public: | 671 public: |
| 689 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 672 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 690 inputs_[0] = dividend; | 673 inputs_[0] = dividend; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 713 int32_t divisor() const { return divisor_; } | 696 int32_t divisor() const { return divisor_; } |
| 714 | 697 |
| 715 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") | 698 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") |
| 716 DECLARE_HYDROGEN_ACCESSOR(Div) | 699 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 717 | 700 |
| 718 private: | 701 private: |
| 719 int32_t divisor_; | 702 int32_t divisor_; |
| 720 }; | 703 }; |
| 721 | 704 |
| 722 | 705 |
| 723 class LDivI FINAL : public LTemplateInstruction<1, 2, 1> { | 706 class LDivI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 724 public: | 707 public: |
| 725 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 708 LDivI(LOperand* dividend, LOperand* divisor) { |
| 726 inputs_[0] = dividend; | 709 inputs_[0] = dividend; |
| 727 inputs_[1] = divisor; | 710 inputs_[1] = divisor; |
| 728 temps_[0] = temp; | |
| 729 } | 711 } |
| 730 | 712 |
| 731 LOperand* dividend() { return inputs_[0]; } | 713 LOperand* dividend() { return inputs_[0]; } |
| 732 LOperand* divisor() { return inputs_[1]; } | 714 LOperand* divisor() { return inputs_[1]; } |
| 733 LOperand* temp() { return temps_[0]; } | |
| 734 | 715 |
| 735 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 716 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
| 736 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) | 717 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) |
| 737 }; | 718 }; |
| 738 | 719 |
| 739 | 720 |
| 740 class LFlooringDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { | 721 class LFlooringDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { |
| 741 public: | 722 public: |
| 742 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 723 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 743 inputs_[0] = dividend; | 724 inputs_[0] = dividend; |
| 744 divisor_ = divisor; | 725 divisor_ = divisor; |
| 745 } | 726 } |
| 746 | 727 |
| 747 LOperand* dividend() { return inputs_[0]; } | 728 LOperand* dividend() { return inputs_[0]; } |
| 748 int32_t divisor() { return divisor_; } | 729 int32_t divisor() { return divisor_; } |
| 749 | 730 |
| 750 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, | 731 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
| 751 "flooring-div-by-power-of-2-i") | 732 "flooring-div-by-power-of-2-i") |
| 752 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 733 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 753 | 734 |
| 754 private: | 735 private: |
| 755 int32_t divisor_; | 736 int32_t divisor_; |
| 756 }; | 737 }; |
| 757 | 738 |
| 758 | 739 |
| 759 class LFlooringDivByConstI FINAL : public LTemplateInstruction<1, 1, 2> { | 740 class LFlooringDivByConstI FINAL : public LTemplateInstruction<1, 1, 1> { |
| 760 public: | 741 public: |
| 761 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | 742 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 762 inputs_[0] = dividend; | 743 inputs_[0] = dividend; |
| 763 divisor_ = divisor; | 744 divisor_ = divisor; |
| 764 temps_[0] = temp; | 745 temps_[0] = temp; |
| 765 } | 746 } |
| 766 | 747 |
| 767 LOperand* dividend() { return inputs_[0]; } | 748 LOperand* dividend() { return inputs_[0]; } |
| 768 int32_t divisor() const { return divisor_; } | 749 int32_t divisor() const { return divisor_; } |
| 769 LOperand* temp() { return temps_[0]; } | 750 LOperand* temp() { return temps_[0]; } |
| 770 | 751 |
| 771 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") | 752 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") |
| 772 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 753 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 773 | 754 |
| 774 private: | 755 private: |
| 775 int32_t divisor_; | 756 int32_t divisor_; |
| 776 }; | 757 }; |
| 777 | 758 |
| 778 | 759 |
| 779 class LFlooringDivI FINAL : public LTemplateInstruction<1, 2, 1> { | 760 class LFlooringDivI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 780 public: | 761 public: |
| 781 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 762 LFlooringDivI(LOperand* dividend, LOperand* divisor) { |
| 782 inputs_[0] = dividend; | 763 inputs_[0] = dividend; |
| 783 inputs_[1] = divisor; | 764 inputs_[1] = divisor; |
| 784 temps_[0] = temp; | |
| 785 } | 765 } |
| 786 | 766 |
| 787 LOperand* dividend() { return inputs_[0]; } | 767 LOperand* dividend() { return inputs_[0]; } |
| 788 LOperand* divisor() { return inputs_[1]; } | 768 LOperand* divisor() { return inputs_[1]; } |
| 789 LOperand* temp() { return temps_[0]; } | |
| 790 | 769 |
| 791 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") | 770 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") |
| 792 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 771 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 793 }; | 772 }; |
| 794 | 773 |
| 795 | 774 |
| 796 class LMulI FINAL : public LTemplateInstruction<1, 2, 0> { | 775 class LMulI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 797 public: | 776 public: |
| 798 LMulI(LOperand* left, LOperand* right) { | 777 LMulI(LOperand* left, LOperand* right) { |
| 799 inputs_[0] = left; | 778 inputs_[0] = left; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 } | 837 } |
| 859 | 838 |
| 860 LOperand* left() { return inputs_[0]; } | 839 LOperand* left() { return inputs_[0]; } |
| 861 LOperand* right() { return inputs_[1]; } | 840 LOperand* right() { return inputs_[1]; } |
| 862 | 841 |
| 863 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, | 842 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, |
| 864 "compare-numeric-and-branch") | 843 "compare-numeric-and-branch") |
| 865 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) | 844 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) |
| 866 | 845 |
| 867 Token::Value op() const { return hydrogen()->token(); } | 846 Token::Value op() const { return hydrogen()->token(); } |
| 868 bool is_double() const { | 847 bool is_double() const { return hydrogen()->representation().IsDouble(); } |
| 869 return hydrogen()->representation().IsDouble(); | |
| 870 } | |
| 871 | 848 |
| 872 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 849 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 873 }; | 850 }; |
| 874 | 851 |
| 875 | 852 |
| 876 class LMathFloor FINAL : public LTemplateInstruction<1, 1, 0> { | 853 class LMathFloor FINAL : public LTemplateInstruction<1, 1, 0> { |
| 877 public: | 854 public: |
| 878 explicit LMathFloor(LOperand* value) { | 855 explicit LMathFloor(LOperand* value) { inputs_[0] = value; } |
| 879 inputs_[0] = value; | |
| 880 } | |
| 881 | 856 |
| 882 LOperand* value() { return inputs_[0]; } | 857 LOperand* value() { return inputs_[0]; } |
| 883 | 858 |
| 884 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 859 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
| 885 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 860 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 886 }; | 861 }; |
| 887 | 862 |
| 888 | 863 |
| 889 class LMathRound FINAL : public LTemplateInstruction<1, 1, 1> { | 864 class LMathRound FINAL : public LTemplateInstruction<1, 1, 1> { |
| 890 public: | 865 public: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 921 LOperand* context() { return inputs_[1]; } | 896 LOperand* context() { return inputs_[1]; } |
| 922 LOperand* value() { return inputs_[0]; } | 897 LOperand* value() { return inputs_[0]; } |
| 923 | 898 |
| 924 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") | 899 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") |
| 925 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 900 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 926 }; | 901 }; |
| 927 | 902 |
| 928 | 903 |
| 929 class LMathLog FINAL : public LTemplateInstruction<1, 1, 0> { | 904 class LMathLog FINAL : public LTemplateInstruction<1, 1, 0> { |
| 930 public: | 905 public: |
| 931 explicit LMathLog(LOperand* value) { | 906 explicit LMathLog(LOperand* value) { inputs_[0] = value; } |
| 932 inputs_[0] = value; | |
| 933 } | |
| 934 | 907 |
| 935 LOperand* value() { return inputs_[0]; } | 908 LOperand* value() { return inputs_[0]; } |
| 936 | 909 |
| 937 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") | 910 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
| 938 }; | 911 }; |
| 939 | 912 |
| 940 | 913 |
| 941 class LMathClz32 FINAL : public LTemplateInstruction<1, 1, 0> { | 914 class LMathClz32 FINAL : public LTemplateInstruction<1, 1, 0> { |
| 942 public: | 915 public: |
| 943 explicit LMathClz32(LOperand* value) { | 916 explicit LMathClz32(LOperand* value) { inputs_[0] = value; } |
| 944 inputs_[0] = value; | |
| 945 } | |
| 946 | 917 |
| 947 LOperand* value() { return inputs_[0]; } | 918 LOperand* value() { return inputs_[0]; } |
| 948 | 919 |
| 949 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") | 920 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") |
| 950 }; | 921 }; |
| 951 | 922 |
| 952 | 923 |
| 953 class LMathExp FINAL : public LTemplateInstruction<1, 1, 3> { | 924 class LMathExp FINAL : public LTemplateInstruction<1, 1, 3> { |
| 954 public: | 925 public: |
| 955 LMathExp(LOperand* value, | 926 LMathExp(LOperand* value, LOperand* double_temp, LOperand* temp1, |
| 956 LOperand* double_temp, | |
| 957 LOperand* temp1, | |
| 958 LOperand* temp2) { | 927 LOperand* temp2) { |
| 959 inputs_[0] = value; | 928 inputs_[0] = value; |
| 960 temps_[0] = temp1; | 929 temps_[0] = temp1; |
| 961 temps_[1] = temp2; | 930 temps_[1] = temp2; |
| 962 temps_[2] = double_temp; | 931 temps_[2] = double_temp; |
| 963 ExternalReference::InitializeMathExpData(); | 932 ExternalReference::InitializeMathExpData(); |
| 964 } | 933 } |
| 965 | 934 |
| 966 LOperand* value() { return inputs_[0]; } | 935 LOperand* value() { return inputs_[0]; } |
| 967 LOperand* temp1() { return temps_[0]; } | 936 LOperand* temp1() { return temps_[0]; } |
| 968 LOperand* temp2() { return temps_[1]; } | 937 LOperand* temp2() { return temps_[1]; } |
| 969 LOperand* double_temp() { return temps_[2]; } | 938 LOperand* double_temp() { return temps_[2]; } |
| 970 | 939 |
| 971 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") | 940 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
| 972 }; | 941 }; |
| 973 | 942 |
| 974 | 943 |
| 975 class LMathSqrt FINAL : public LTemplateInstruction<1, 1, 0> { | 944 class LMathSqrt FINAL : public LTemplateInstruction<1, 1, 0> { |
| 976 public: | 945 public: |
| 977 explicit LMathSqrt(LOperand* value) { | 946 explicit LMathSqrt(LOperand* value) { inputs_[0] = value; } |
| 978 inputs_[0] = value; | |
| 979 } | |
| 980 | 947 |
| 981 LOperand* value() { return inputs_[0]; } | 948 LOperand* value() { return inputs_[0]; } |
| 982 | 949 |
| 983 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") | 950 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
| 984 }; | 951 }; |
| 985 | 952 |
| 986 | 953 |
| 987 class LMathPowHalf FINAL : public LTemplateInstruction<1, 1, 0> { | 954 class LMathPowHalf FINAL : public LTemplateInstruction<1, 1, 0> { |
| 988 public: | 955 public: |
| 989 explicit LMathPowHalf(LOperand* value) { | 956 explicit LMathPowHalf(LOperand* value) { inputs_[0] = value; } |
| 990 inputs_[0] = value; | |
| 991 } | |
| 992 | 957 |
| 993 LOperand* value() { return inputs_[0]; } | 958 LOperand* value() { return inputs_[0]; } |
| 994 | 959 |
| 995 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") | 960 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
| 996 }; | 961 }; |
| 997 | 962 |
| 998 | 963 |
| 999 class LCmpObjectEqAndBranch FINAL : public LControlInstruction<2, 0> { | 964 class LCmpObjectEqAndBranch FINAL : public LControlInstruction<2, 0> { |
| 1000 public: | 965 public: |
| 1001 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 966 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
| 1002 inputs_[0] = left; | 967 inputs_[0] = left; |
| 1003 inputs_[1] = right; | 968 inputs_[1] = right; |
| 1004 } | 969 } |
| 1005 | 970 |
| 1006 LOperand* left() { return inputs_[0]; } | 971 LOperand* left() { return inputs_[0]; } |
| 1007 LOperand* right() { return inputs_[1]; } | 972 LOperand* right() { return inputs_[1]; } |
| 1008 | 973 |
| 1009 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") | 974 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") |
| 1010 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) | 975 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) |
| 1011 }; | 976 }; |
| 1012 | 977 |
| 1013 | 978 |
| 1014 class LCmpHoleAndBranch FINAL : public LControlInstruction<1, 0> { | 979 class LCmpHoleAndBranch FINAL : public LControlInstruction<1, 0> { |
| 1015 public: | 980 public: |
| 1016 explicit LCmpHoleAndBranch(LOperand* object) { | 981 explicit LCmpHoleAndBranch(LOperand* object) { inputs_[0] = object; } |
| 1017 inputs_[0] = object; | |
| 1018 } | |
| 1019 | 982 |
| 1020 LOperand* object() { return inputs_[0]; } | 983 LOperand* object() { return inputs_[0]; } |
| 1021 | 984 |
| 1022 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") | 985 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") |
| 1023 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) | 986 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) |
| 1024 }; | 987 }; |
| 1025 | 988 |
| 1026 | 989 |
| 1027 class LCompareMinusZeroAndBranch FINAL : public LControlInstruction<1, 1> { | 990 class LCompareMinusZeroAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1028 public: | 991 public: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 | 1032 |
| 1070 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") | 1033 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") |
| 1071 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) | 1034 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) |
| 1072 | 1035 |
| 1073 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1036 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1074 }; | 1037 }; |
| 1075 | 1038 |
| 1076 | 1039 |
| 1077 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> { | 1040 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> { |
| 1078 public: | 1041 public: |
| 1079 explicit LIsSmiAndBranch(LOperand* value) { | 1042 explicit LIsSmiAndBranch(LOperand* value) { inputs_[0] = value; } |
| 1080 inputs_[0] = value; | |
| 1081 } | |
| 1082 | 1043 |
| 1083 LOperand* value() { return inputs_[0]; } | 1044 LOperand* value() { return inputs_[0]; } |
| 1084 | 1045 |
| 1085 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 1046 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
| 1086 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) | 1047 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
| 1087 | 1048 |
| 1088 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1049 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1089 }; | 1050 }; |
| 1090 | 1051 |
| 1091 | 1052 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) | 1085 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) |
| 1125 | 1086 |
| 1126 Token::Value op() const { return hydrogen()->token(); } | 1087 Token::Value op() const { return hydrogen()->token(); } |
| 1127 | 1088 |
| 1128 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1089 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1129 }; | 1090 }; |
| 1130 | 1091 |
| 1131 | 1092 |
| 1132 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 0> { | 1093 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 0> { |
| 1133 public: | 1094 public: |
| 1134 explicit LHasInstanceTypeAndBranch(LOperand* value) { | 1095 explicit LHasInstanceTypeAndBranch(LOperand* value) { inputs_[0] = value; } |
| 1135 inputs_[0] = value; | |
| 1136 } | |
| 1137 | 1096 |
| 1138 LOperand* value() { return inputs_[0]; } | 1097 LOperand* value() { return inputs_[0]; } |
| 1139 | 1098 |
| 1140 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 1099 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
| 1141 "has-instance-type-and-branch") | 1100 "has-instance-type-and-branch") |
| 1142 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) | 1101 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) |
| 1143 | 1102 |
| 1144 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1103 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1145 }; | 1104 }; |
| 1146 | 1105 |
| 1147 | 1106 |
| 1148 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> { | 1107 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1149 public: | 1108 public: |
| 1150 explicit LGetCachedArrayIndex(LOperand* value) { | 1109 explicit LGetCachedArrayIndex(LOperand* value) { inputs_[0] = value; } |
| 1151 inputs_[0] = value; | |
| 1152 } | |
| 1153 | 1110 |
| 1154 LOperand* value() { return inputs_[0]; } | 1111 LOperand* value() { return inputs_[0]; } |
| 1155 | 1112 |
| 1156 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") | 1113 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
| 1157 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) | 1114 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
| 1158 }; | 1115 }; |
| 1159 | 1116 |
| 1160 | 1117 |
| 1161 class LHasCachedArrayIndexAndBranch FINAL | 1118 class LHasCachedArrayIndexAndBranch FINAL : public LControlInstruction<1, 0> { |
| 1162 : public LControlInstruction<1, 0> { | |
| 1163 public: | 1119 public: |
| 1164 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { | 1120 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
| 1165 inputs_[0] = value; | 1121 inputs_[0] = value; |
| 1166 } | 1122 } |
| 1167 | 1123 |
| 1168 LOperand* value() { return inputs_[0]; } | 1124 LOperand* value() { return inputs_[0]; } |
| 1169 | 1125 |
| 1170 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 1126 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
| 1171 "has-cached-array-index-and-branch") | 1127 "has-cached-array-index-and-branch") |
| 1172 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) | 1128 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) |
| 1173 | 1129 |
| 1174 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1130 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1175 }; | 1131 }; |
| 1176 | 1132 |
| 1177 | 1133 |
| 1178 class LClassOfTestAndBranch FINAL : public LControlInstruction<1, 1> { | 1134 class LClassOfTestAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1179 public: | 1135 public: |
| 1180 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { | 1136 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { |
| 1181 inputs_[0] = value; | 1137 inputs_[0] = value; |
| 1182 temps_[0] = temp; | 1138 temps_[0] = temp; |
| 1183 } | 1139 } |
| 1184 | 1140 |
| 1185 LOperand* value() { return inputs_[0]; } | 1141 LOperand* value() { return inputs_[0]; } |
| 1186 LOperand* temp() { return temps_[0]; } | 1142 LOperand* temp() { return temps_[0]; } |
| 1187 | 1143 |
| 1188 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 1144 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, "class-of-test-and-branch") |
| 1189 "class-of-test-and-branch") | |
| 1190 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) | 1145 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
| 1191 | 1146 |
| 1192 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1147 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1193 }; | 1148 }; |
| 1194 | 1149 |
| 1195 | 1150 |
| 1196 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> { | 1151 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1197 public: | 1152 public: |
| 1198 LCmpT(LOperand* context, LOperand* left, LOperand* right) { | 1153 LCmpT(LOperand* context, LOperand* left, LOperand* right) { |
| 1199 inputs_[0] = context; | 1154 inputs_[0] = context; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1340 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1386 | 1341 |
| 1387 Handle<Object> value(Isolate* isolate) const { | 1342 Handle<Object> value(Isolate* isolate) const { |
| 1388 return hydrogen()->handle(isolate); | 1343 return hydrogen()->handle(isolate); |
| 1389 } | 1344 } |
| 1390 }; | 1345 }; |
| 1391 | 1346 |
| 1392 | 1347 |
| 1393 class LBranch FINAL : public LControlInstruction<1, 0> { | 1348 class LBranch FINAL : public LControlInstruction<1, 0> { |
| 1394 public: | 1349 public: |
| 1395 explicit LBranch(LOperand* value) { | 1350 explicit LBranch(LOperand* value) { inputs_[0] = value; } |
| 1396 inputs_[0] = value; | |
| 1397 } | |
| 1398 | 1351 |
| 1399 LOperand* value() { return inputs_[0]; } | 1352 LOperand* value() { return inputs_[0]; } |
| 1400 | 1353 |
| 1401 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 1354 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
| 1402 DECLARE_HYDROGEN_ACCESSOR(Branch) | 1355 DECLARE_HYDROGEN_ACCESSOR(Branch) |
| 1403 | 1356 |
| 1404 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1357 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1405 }; | 1358 }; |
| 1406 | 1359 |
| 1407 | 1360 |
| 1408 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 1> { | 1361 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1409 public: | 1362 public: |
| 1410 LCmpMapAndBranch(LOperand* value, LOperand* temp) { | 1363 LCmpMapAndBranch(LOperand* value, LOperand* temp) { |
| 1411 inputs_[0] = value; | 1364 inputs_[0] = value; |
| 1412 temps_[0] = temp; | 1365 temps_[0] = temp; |
| 1413 } | 1366 } |
| 1414 | 1367 |
| 1415 LOperand* value() { return inputs_[0]; } | 1368 LOperand* value() { return inputs_[0]; } |
| 1416 LOperand* temp() { return temps_[0]; } | 1369 LOperand* temp() { return temps_[0]; } |
| 1417 | 1370 |
| 1418 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1371 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
| 1419 DECLARE_HYDROGEN_ACCESSOR(CompareMap) | 1372 DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
| 1420 | 1373 |
| 1421 Handle<Map> map() const { return hydrogen()->map().handle(); } | 1374 Handle<Map> map() const { return hydrogen()->map().handle(); } |
| 1422 }; | 1375 }; |
| 1423 | 1376 |
| 1424 | 1377 |
| 1425 class LMapEnumLength FINAL : public LTemplateInstruction<1, 1, 0> { | 1378 class LMapEnumLength FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1426 public: | 1379 public: |
| 1427 explicit LMapEnumLength(LOperand* value) { | 1380 explicit LMapEnumLength(LOperand* value) { inputs_[0] = value; } |
| 1428 inputs_[0] = value; | |
| 1429 } | |
| 1430 | 1381 |
| 1431 LOperand* value() { return inputs_[0]; } | 1382 LOperand* value() { return inputs_[0]; } |
| 1432 | 1383 |
| 1433 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") | 1384 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") |
| 1434 }; | 1385 }; |
| 1435 | 1386 |
| 1436 | 1387 |
| 1437 class LDateField FINAL : public LTemplateInstruction<1, 1, 1> { | 1388 class LDateField FINAL : public LTemplateInstruction<1, 1, 1> { |
| 1438 public: | 1389 public: |
| 1439 LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { | 1390 LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1463 LOperand* string() const { return inputs_[0]; } | 1414 LOperand* string() const { return inputs_[0]; } |
| 1464 LOperand* index() const { return inputs_[1]; } | 1415 LOperand* index() const { return inputs_[1]; } |
| 1465 | 1416 |
| 1466 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") | 1417 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") |
| 1467 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) | 1418 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) |
| 1468 }; | 1419 }; |
| 1469 | 1420 |
| 1470 | 1421 |
| 1471 class LSeqStringSetChar FINAL : public LTemplateInstruction<1, 4, 0> { | 1422 class LSeqStringSetChar FINAL : public LTemplateInstruction<1, 4, 0> { |
| 1472 public: | 1423 public: |
| 1473 LSeqStringSetChar(LOperand* context, | 1424 LSeqStringSetChar(LOperand* context, LOperand* string, LOperand* index, |
| 1474 LOperand* string, | |
| 1475 LOperand* index, | |
| 1476 LOperand* value) { | 1425 LOperand* value) { |
| 1477 inputs_[0] = context; | 1426 inputs_[0] = context; |
| 1478 inputs_[1] = string; | 1427 inputs_[1] = string; |
| 1479 inputs_[2] = index; | 1428 inputs_[2] = index; |
| 1480 inputs_[3] = value; | 1429 inputs_[3] = value; |
| 1481 } | 1430 } |
| 1482 | 1431 |
| 1483 LOperand* string() { return inputs_[1]; } | 1432 LOperand* string() { return inputs_[1]; } |
| 1484 LOperand* index() { return inputs_[2]; } | 1433 LOperand* index() { return inputs_[2]; } |
| 1485 LOperand* value() { return inputs_[3]; } | 1434 LOperand* value() { return inputs_[3]; } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 LOperand* left() { return inputs_[0]; } | 1478 LOperand* left() { return inputs_[0]; } |
| 1530 LOperand* right() { return inputs_[1]; } | 1479 LOperand* right() { return inputs_[1]; } |
| 1531 | 1480 |
| 1532 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | 1481 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
| 1533 DECLARE_HYDROGEN_ACCESSOR(Power) | 1482 DECLARE_HYDROGEN_ACCESSOR(Power) |
| 1534 }; | 1483 }; |
| 1535 | 1484 |
| 1536 | 1485 |
| 1537 class LArithmeticD FINAL : public LTemplateInstruction<1, 2, 0> { | 1486 class LArithmeticD FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1538 public: | 1487 public: |
| 1539 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) | 1488 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) : op_(op) { |
| 1540 : op_(op) { | |
| 1541 inputs_[0] = left; | 1489 inputs_[0] = left; |
| 1542 inputs_[1] = right; | 1490 inputs_[1] = right; |
| 1543 } | 1491 } |
| 1544 | 1492 |
| 1545 Token::Value op() const { return op_; } | 1493 Token::Value op() const { return op_; } |
| 1546 LOperand* left() { return inputs_[0]; } | 1494 LOperand* left() { return inputs_[0]; } |
| 1547 LOperand* right() { return inputs_[1]; } | 1495 LOperand* right() { return inputs_[1]; } |
| 1548 | 1496 |
| 1549 virtual Opcode opcode() const OVERRIDE { | 1497 virtual Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticD; } |
| 1550 return LInstruction::kArithmeticD; | |
| 1551 } | |
| 1552 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; | 1498 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; |
| 1553 virtual const char* Mnemonic() const OVERRIDE; | 1499 virtual const char* Mnemonic() const OVERRIDE; |
| 1554 | 1500 |
| 1555 private: | 1501 private: |
| 1556 Token::Value op_; | 1502 Token::Value op_; |
| 1557 }; | 1503 }; |
| 1558 | 1504 |
| 1559 | 1505 |
| 1560 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> { | 1506 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1561 public: | 1507 public: |
| 1562 LArithmeticT(Token::Value op, | 1508 LArithmeticT(Token::Value op, LOperand* context, LOperand* left, |
| 1563 LOperand* context, | |
| 1564 LOperand* left, | |
| 1565 LOperand* right) | 1509 LOperand* right) |
| 1566 : op_(op) { | 1510 : op_(op) { |
| 1567 inputs_[0] = context; | 1511 inputs_[0] = context; |
| 1568 inputs_[1] = left; | 1512 inputs_[1] = left; |
| 1569 inputs_[2] = right; | 1513 inputs_[2] = right; |
| 1570 } | 1514 } |
| 1571 | 1515 |
| 1572 LOperand* context() { return inputs_[0]; } | 1516 LOperand* context() { return inputs_[0]; } |
| 1573 LOperand* left() { return inputs_[1]; } | 1517 LOperand* left() { return inputs_[1]; } |
| 1574 LOperand* right() { return inputs_[2]; } | 1518 LOperand* right() { return inputs_[2]; } |
| 1575 Token::Value op() const { return op_; } | 1519 Token::Value op() const { return op_; } |
| 1576 | 1520 |
| 1577 virtual Opcode opcode() const OVERRIDE { | 1521 virtual Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticT; } |
| 1578 return LInstruction::kArithmeticT; | |
| 1579 } | |
| 1580 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; | 1522 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; |
| 1581 virtual const char* Mnemonic() const OVERRIDE; | 1523 virtual const char* Mnemonic() const OVERRIDE; |
| 1582 | 1524 |
| 1583 private: | 1525 private: |
| 1584 Token::Value op_; | 1526 Token::Value op_; |
| 1585 }; | 1527 }; |
| 1586 | 1528 |
| 1587 | 1529 |
| 1588 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> { | 1530 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> { |
| 1589 public: | 1531 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1603 return LConstantOperand::cast(parameter_count()); | 1545 return LConstantOperand::cast(parameter_count()); |
| 1604 } | 1546 } |
| 1605 LOperand* parameter_count() { return inputs_[2]; } | 1547 LOperand* parameter_count() { return inputs_[2]; } |
| 1606 | 1548 |
| 1607 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1549 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
| 1608 }; | 1550 }; |
| 1609 | 1551 |
| 1610 | 1552 |
| 1611 class LLoadNamedField FINAL : public LTemplateInstruction<1, 1, 0> { | 1553 class LLoadNamedField FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1612 public: | 1554 public: |
| 1613 explicit LLoadNamedField(LOperand* object) { | 1555 explicit LLoadNamedField(LOperand* object) { inputs_[0] = object; } |
| 1614 inputs_[0] = object; | |
| 1615 } | |
| 1616 | 1556 |
| 1617 LOperand* object() { return inputs_[0]; } | 1557 LOperand* object() { return inputs_[0]; } |
| 1618 | 1558 |
| 1619 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1559 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
| 1620 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1560 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
| 1621 }; | 1561 }; |
| 1622 | 1562 |
| 1623 | 1563 |
| 1624 class LLoadNamedGeneric FINAL : public LTemplateInstruction<1, 2, 1> { | 1564 class LLoadNamedGeneric FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1625 public: | 1565 public: |
| 1626 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { | 1566 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { |
| 1627 inputs_[0] = context; | 1567 inputs_[0] = context; |
| 1628 inputs_[1] = object; | 1568 inputs_[1] = object; |
| 1629 temps_[0] = vector; | 1569 temps_[0] = vector; |
| 1630 } | 1570 } |
| 1631 | 1571 |
| 1632 LOperand* context() { return inputs_[0]; } | 1572 LOperand* context() { return inputs_[0]; } |
| 1633 LOperand* object() { return inputs_[1]; } | 1573 LOperand* object() { return inputs_[1]; } |
| 1634 LOperand* temp_vector() { return temps_[0]; } | 1574 LOperand* temp_vector() { return temps_[0]; } |
| 1635 | 1575 |
| 1636 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1576 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
| 1637 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1577 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
| 1638 | 1578 |
| 1639 Handle<Object> name() const { return hydrogen()->name(); } | 1579 Handle<Object> name() const { return hydrogen()->name(); } |
| 1640 }; | 1580 }; |
| 1641 | 1581 |
| 1642 | 1582 |
| 1643 class LLoadFunctionPrototype FINAL : public LTemplateInstruction<1, 1, 0> { | 1583 class LLoadFunctionPrototype FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1644 public: | 1584 public: |
| 1645 explicit LLoadFunctionPrototype(LOperand* function) { | 1585 explicit LLoadFunctionPrototype(LOperand* function) { inputs_[0] = function; } |
| 1646 inputs_[0] = function; | |
| 1647 } | |
| 1648 | 1586 |
| 1649 LOperand* function() { return inputs_[0]; } | 1587 LOperand* function() { return inputs_[0]; } |
| 1650 | 1588 |
| 1651 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1589 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
| 1652 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1590 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
| 1653 }; | 1591 }; |
| 1654 | 1592 |
| 1655 | 1593 |
| 1656 class LLoadRoot FINAL : public LTemplateInstruction<1, 0, 0> { | 1594 class LLoadRoot FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1657 public: | 1595 public: |
| 1658 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") | 1596 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") |
| 1659 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) | 1597 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) |
| 1660 | 1598 |
| 1661 Heap::RootListIndex index() const { return hydrogen()->index(); } | 1599 Heap::RootListIndex index() const { return hydrogen()->index(); } |
| 1662 }; | 1600 }; |
| 1663 | 1601 |
| 1664 | 1602 |
| 1665 class LLoadKeyed FINAL : public LTemplateInstruction<1, 2, 0> { | 1603 class LLoadKeyed FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1666 public: | 1604 public: |
| 1667 LLoadKeyed(LOperand* elements, LOperand* key) { | 1605 LLoadKeyed(LOperand* elements, LOperand* key) { |
| 1668 inputs_[0] = elements; | 1606 inputs_[0] = elements; |
| 1669 inputs_[1] = key; | 1607 inputs_[1] = key; |
| 1670 } | 1608 } |
| 1671 | 1609 |
| 1672 LOperand* elements() { return inputs_[0]; } | 1610 LOperand* elements() { return inputs_[0]; } |
| 1673 LOperand* key() { return inputs_[1]; } | 1611 LOperand* key() { return inputs_[1]; } |
| 1674 ElementsKind elements_kind() const { | 1612 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
| 1675 return hydrogen()->elements_kind(); | 1613 bool is_external() const { return hydrogen()->is_external(); } |
| 1676 } | |
| 1677 bool is_external() const { | |
| 1678 return hydrogen()->is_external(); | |
| 1679 } | |
| 1680 bool is_fixed_typed_array() const { | 1614 bool is_fixed_typed_array() const { |
| 1681 return hydrogen()->is_fixed_typed_array(); | 1615 return hydrogen()->is_fixed_typed_array(); |
| 1682 } | 1616 } |
| 1683 bool is_typed_elements() const { | 1617 bool is_typed_elements() const { |
| 1684 return is_external() || is_fixed_typed_array(); | 1618 return is_external() || is_fixed_typed_array(); |
| 1685 } | 1619 } |
| 1686 | 1620 |
| 1687 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1621 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
| 1688 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1622 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
| 1689 | 1623 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 LOperand* value() { return inputs_[0]; } | 1684 LOperand* value() { return inputs_[0]; } |
| 1751 LOperand* temp() { return temps_[0]; } | 1685 LOperand* temp() { return temps_[0]; } |
| 1752 | 1686 |
| 1753 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 1687 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
| 1754 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 1688 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
| 1755 }; | 1689 }; |
| 1756 | 1690 |
| 1757 | 1691 |
| 1758 class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> { | 1692 class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1759 public: | 1693 public: |
| 1760 explicit LLoadContextSlot(LOperand* context) { | 1694 explicit LLoadContextSlot(LOperand* context) { inputs_[0] = context; } |
| 1761 inputs_[0] = context; | |
| 1762 } | |
| 1763 | 1695 |
| 1764 LOperand* context() { return inputs_[0]; } | 1696 LOperand* context() { return inputs_[0]; } |
| 1765 | 1697 |
| 1766 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1698 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1767 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1699 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| 1768 | 1700 |
| 1769 int slot_index() { return hydrogen()->slot_index(); } | 1701 int slot_index() { return hydrogen()->slot_index(); } |
| 1770 | 1702 |
| 1771 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1703 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1772 }; | 1704 }; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1786 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) | 1718 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) |
| 1787 | 1719 |
| 1788 int slot_index() { return hydrogen()->slot_index(); } | 1720 int slot_index() { return hydrogen()->slot_index(); } |
| 1789 | 1721 |
| 1790 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1722 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1791 }; | 1723 }; |
| 1792 | 1724 |
| 1793 | 1725 |
| 1794 class LPushArgument FINAL : public LTemplateInstruction<0, 1, 0> { | 1726 class LPushArgument FINAL : public LTemplateInstruction<0, 1, 0> { |
| 1795 public: | 1727 public: |
| 1796 explicit LPushArgument(LOperand* value) { | 1728 explicit LPushArgument(LOperand* value) { inputs_[0] = value; } |
| 1797 inputs_[0] = value; | |
| 1798 } | |
| 1799 | 1729 |
| 1800 LOperand* value() { return inputs_[0]; } | 1730 LOperand* value() { return inputs_[0]; } |
| 1801 | 1731 |
| 1802 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1732 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
| 1803 }; | 1733 }; |
| 1804 | 1734 |
| 1805 | 1735 |
| 1806 class LDrop FINAL : public LTemplateInstruction<0, 0, 0> { | 1736 class LDrop FINAL : public LTemplateInstruction<0, 0, 0> { |
| 1807 public: | 1737 public: |
| 1808 explicit LDrop(int count) : count_(count) { } | 1738 explicit LDrop(int count) : count_(count) {} |
| 1809 | 1739 |
| 1810 int count() const { return count_; } | 1740 int count() const { return count_; } |
| 1811 | 1741 |
| 1812 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") | 1742 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") |
| 1813 | 1743 |
| 1814 private: | 1744 private: |
| 1815 int count_; | 1745 int count_; |
| 1816 }; | 1746 }; |
| 1817 | 1747 |
| 1818 | 1748 |
| 1819 class LStoreCodeEntry FINAL: public LTemplateInstruction<0, 2, 0> { | 1749 class LStoreCodeEntry FINAL : public LTemplateInstruction<0, 2, 0> { |
| 1820 public: | 1750 public: |
| 1821 LStoreCodeEntry(LOperand* function, LOperand* code_object) { | 1751 LStoreCodeEntry(LOperand* function, LOperand* code_object) { |
| 1822 inputs_[0] = function; | 1752 inputs_[0] = function; |
| 1823 inputs_[1] = code_object; | 1753 inputs_[1] = code_object; |
| 1824 } | 1754 } |
| 1825 | 1755 |
| 1826 LOperand* function() { return inputs_[0]; } | 1756 LOperand* function() { return inputs_[0]; } |
| 1827 LOperand* code_object() { return inputs_[1]; } | 1757 LOperand* code_object() { return inputs_[1]; } |
| 1828 | 1758 |
| 1829 virtual void PrintDataTo(StringStream* stream); | 1759 virtual void PrintDataTo(StringStream* stream); |
| 1830 | 1760 |
| 1831 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") | 1761 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") |
| 1832 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) | 1762 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) |
| 1833 }; | 1763 }; |
| 1834 | 1764 |
| 1835 | 1765 |
| 1836 class LInnerAllocatedObject FINAL: public LTemplateInstruction<1, 2, 0> { | 1766 class LInnerAllocatedObject FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1837 public: | 1767 public: |
| 1838 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { | 1768 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { |
| 1839 inputs_[0] = base_object; | 1769 inputs_[0] = base_object; |
| 1840 inputs_[1] = offset; | 1770 inputs_[1] = offset; |
| 1841 } | 1771 } |
| 1842 | 1772 |
| 1843 LOperand* base_object() const { return inputs_[0]; } | 1773 LOperand* base_object() const { return inputs_[0]; } |
| 1844 LOperand* offset() const { return inputs_[1]; } | 1774 LOperand* offset() const { return inputs_[1]; } |
| 1845 | 1775 |
| 1846 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1776 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1858 | 1788 |
| 1859 class LContext FINAL : public LTemplateInstruction<1, 0, 0> { | 1789 class LContext FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1860 public: | 1790 public: |
| 1861 DECLARE_CONCRETE_INSTRUCTION(Context, "context") | 1791 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1862 DECLARE_HYDROGEN_ACCESSOR(Context) | 1792 DECLARE_HYDROGEN_ACCESSOR(Context) |
| 1863 }; | 1793 }; |
| 1864 | 1794 |
| 1865 | 1795 |
| 1866 class LDeclareGlobals FINAL : public LTemplateInstruction<0, 1, 0> { | 1796 class LDeclareGlobals FINAL : public LTemplateInstruction<0, 1, 0> { |
| 1867 public: | 1797 public: |
| 1868 explicit LDeclareGlobals(LOperand* context) { | 1798 explicit LDeclareGlobals(LOperand* context) { inputs_[0] = context; } |
| 1869 inputs_[0] = context; | |
| 1870 } | |
| 1871 | 1799 |
| 1872 LOperand* context() { return inputs_[0]; } | 1800 LOperand* context() { return inputs_[0]; } |
| 1873 | 1801 |
| 1874 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") | 1802 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") |
| 1875 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) | 1803 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) |
| 1876 }; | 1804 }; |
| 1877 | 1805 |
| 1878 | 1806 |
| 1879 class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { | 1807 class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1880 public: | 1808 public: |
| 1881 explicit LCallJSFunction(LOperand* function) { | 1809 explicit LCallJSFunction(LOperand* function) { inputs_[0] = function; } |
| 1882 inputs_[0] = function; | |
| 1883 } | |
| 1884 | 1810 |
| 1885 LOperand* function() { return inputs_[0]; } | 1811 LOperand* function() { return inputs_[0]; } |
| 1886 | 1812 |
| 1887 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") | 1813 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") |
| 1888 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) | 1814 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) |
| 1889 | 1815 |
| 1890 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1816 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1891 | 1817 |
| 1892 int arity() const { return hydrogen()->argument_count() - 1; } | 1818 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1893 }; | 1819 }; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1996 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) | 1922 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) |
| 1997 | 1923 |
| 1998 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 1924 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1999 | 1925 |
| 2000 int arity() const { return hydrogen()->argument_count() - 1; } | 1926 int arity() const { return hydrogen()->argument_count() - 1; } |
| 2001 }; | 1927 }; |
| 2002 | 1928 |
| 2003 | 1929 |
| 2004 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> { | 1930 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2005 public: | 1931 public: |
| 2006 explicit LCallRuntime(LOperand* context) { | 1932 explicit LCallRuntime(LOperand* context) { inputs_[0] = context; } |
| 2007 inputs_[0] = context; | |
| 2008 } | |
| 2009 | 1933 |
| 2010 LOperand* context() { return inputs_[0]; } | 1934 LOperand* context() { return inputs_[0]; } |
| 2011 | 1935 |
| 2012 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1936 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
| 2013 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1937 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
| 2014 | 1938 |
| 2015 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE { | 1939 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE { |
| 2016 return save_doubles() == kDontSaveFPRegs; | 1940 return save_doubles() == kDontSaveFPRegs; |
| 2017 } | 1941 } |
| 2018 | 1942 |
| 2019 const Runtime::Function* function() const { return hydrogen()->function(); } | 1943 const Runtime::Function* function() const { return hydrogen()->function(); } |
| 2020 int arity() const { return hydrogen()->argument_count(); } | 1944 int arity() const { return hydrogen()->argument_count(); } |
| 2021 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } | 1945 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
| 2022 }; | 1946 }; |
| 2023 | 1947 |
| 2024 | 1948 |
| 2025 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { | 1949 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2026 public: | 1950 public: |
| 2027 explicit LInteger32ToDouble(LOperand* value) { | 1951 explicit LInteger32ToDouble(LOperand* value) { inputs_[0] = value; } |
| 2028 inputs_[0] = value; | |
| 2029 } | |
| 2030 | 1952 |
| 2031 LOperand* value() { return inputs_[0]; } | 1953 LOperand* value() { return inputs_[0]; } |
| 2032 | 1954 |
| 2033 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1955 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
| 2034 }; | 1956 }; |
| 2035 | 1957 |
| 2036 | 1958 |
| 2037 class LUint32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { | 1959 class LUint32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2038 public: | 1960 public: |
| 2039 explicit LUint32ToDouble(LOperand* value) { | 1961 explicit LUint32ToDouble(LOperand* value) { inputs_[0] = value; } |
| 2040 inputs_[0] = value; | |
| 2041 } | |
| 2042 | 1962 |
| 2043 LOperand* value() { return inputs_[0]; } | 1963 LOperand* value() { return inputs_[0]; } |
| 2044 | 1964 |
| 2045 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 1965 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 2046 }; | 1966 }; |
| 2047 | 1967 |
| 2048 | 1968 |
| 2049 class LNumberTagI FINAL : public LTemplateInstruction<1, 1, 2> { | 1969 class LNumberTagI FINAL : public LTemplateInstruction<1, 1, 2> { |
| 2050 public: | 1970 public: |
| 2051 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) { | 1971 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 LOperand* temp() { return temps_[0]; } | 2010 LOperand* temp() { return temps_[0]; } |
| 2091 LOperand* temp2() { return temps_[1]; } | 2011 LOperand* temp2() { return temps_[1]; } |
| 2092 | 2012 |
| 2093 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 2013 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
| 2094 DECLARE_HYDROGEN_ACCESSOR(Change) | 2014 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2095 }; | 2015 }; |
| 2096 | 2016 |
| 2097 | 2017 |
| 2098 class LDoubleToSmi FINAL : public LTemplateInstruction<1, 1, 0> { | 2018 class LDoubleToSmi FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2099 public: | 2019 public: |
| 2100 explicit LDoubleToSmi(LOperand* value) { | 2020 explicit LDoubleToSmi(LOperand* value) { inputs_[0] = value; } |
| 2101 inputs_[0] = value; | |
| 2102 } | |
| 2103 | 2021 |
| 2104 LOperand* value() { return inputs_[0]; } | 2022 LOperand* value() { return inputs_[0]; } |
| 2105 | 2023 |
| 2106 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") | 2024 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") |
| 2107 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2025 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 2108 | 2026 |
| 2109 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2027 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 2110 }; | 2028 }; |
| 2111 | 2029 |
| 2112 | 2030 |
| 2113 // Sometimes truncating conversion from a tagged value to an int32. | 2031 // Sometimes truncating conversion from a tagged value to an int32. |
| 2114 class LDoubleToI FINAL : public LTemplateInstruction<1, 1, 0> { | 2032 class LDoubleToI FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2115 public: | 2033 public: |
| 2116 explicit LDoubleToI(LOperand* value) { | 2034 explicit LDoubleToI(LOperand* value) { inputs_[0] = value; } |
| 2117 inputs_[0] = value; | |
| 2118 } | |
| 2119 | 2035 |
| 2120 LOperand* value() { return inputs_[0]; } | 2036 LOperand* value() { return inputs_[0]; } |
| 2121 | 2037 |
| 2122 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 2038 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
| 2123 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2039 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 2124 | 2040 |
| 2125 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2041 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 2126 }; | 2042 }; |
| 2127 | 2043 |
| 2128 | 2044 |
| 2129 // Truncating conversion from a tagged value to an int32. | 2045 // Truncating conversion from a tagged value to an int32. |
| 2130 class LTaggedToI FINAL : public LTemplateInstruction<1, 1, 2> { | 2046 class LTaggedToI FINAL : public LTemplateInstruction<1, 1, 2> { |
| 2131 public: | 2047 public: |
| 2132 LTaggedToI(LOperand* value, | 2048 LTaggedToI(LOperand* value, LOperand* temp, LOperand* temp2) { |
| 2133 LOperand* temp, | |
| 2134 LOperand* temp2) { | |
| 2135 inputs_[0] = value; | 2049 inputs_[0] = value; |
| 2136 temps_[0] = temp; | 2050 temps_[0] = temp; |
| 2137 temps_[1] = temp2; | 2051 temps_[1] = temp2; |
| 2138 } | 2052 } |
| 2139 | 2053 |
| 2140 LOperand* value() { return inputs_[0]; } | 2054 LOperand* value() { return inputs_[0]; } |
| 2141 LOperand* temp() { return temps_[0]; } | 2055 LOperand* temp() { return temps_[0]; } |
| 2142 LOperand* temp2() { return temps_[1]; } | 2056 LOperand* temp2() { return temps_[1]; } |
| 2143 | 2057 |
| 2144 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 2058 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
| 2145 DECLARE_HYDROGEN_ACCESSOR(Change) | 2059 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2146 | 2060 |
| 2147 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2061 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 2148 }; | 2062 }; |
| 2149 | 2063 |
| 2150 | 2064 |
| 2151 class LSmiTag FINAL : public LTemplateInstruction<1, 1, 0> { | 2065 class LSmiTag FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2152 public: | 2066 public: |
| 2153 explicit LSmiTag(LOperand* value) { | 2067 explicit LSmiTag(LOperand* value) { inputs_[0] = value; } |
| 2154 inputs_[0] = value; | |
| 2155 } | |
| 2156 | 2068 |
| 2157 LOperand* value() { return inputs_[0]; } | 2069 LOperand* value() { return inputs_[0]; } |
| 2158 | 2070 |
| 2159 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 2071 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
| 2160 DECLARE_HYDROGEN_ACCESSOR(Change) | 2072 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2161 }; | 2073 }; |
| 2162 | 2074 |
| 2163 | 2075 |
| 2164 class LNumberUntagD FINAL : public LTemplateInstruction<1, 1, 0> { | 2076 class LNumberUntagD FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2165 public: | 2077 public: |
| 2166 explicit LNumberUntagD(LOperand* value) { | 2078 explicit LNumberUntagD(LOperand* value) { inputs_[0] = value; } |
| 2167 inputs_[0] = value; | |
| 2168 } | |
| 2169 | 2079 |
| 2170 LOperand* value() { return inputs_[0]; } | 2080 LOperand* value() { return inputs_[0]; } |
| 2171 | 2081 |
| 2172 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 2082 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
| 2173 DECLARE_HYDROGEN_ACCESSOR(Change) | 2083 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2174 }; | 2084 }; |
| 2175 | 2085 |
| 2176 | 2086 |
| 2177 class LSmiUntag FINAL : public LTemplateInstruction<1, 1, 0> { | 2087 class LSmiUntag FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2178 public: | 2088 public: |
| 2179 LSmiUntag(LOperand* value, bool needs_check) | 2089 LSmiUntag(LOperand* value, bool needs_check) : needs_check_(needs_check) { |
| 2180 : needs_check_(needs_check) { | |
| 2181 inputs_[0] = value; | 2090 inputs_[0] = value; |
| 2182 } | 2091 } |
| 2183 | 2092 |
| 2184 LOperand* value() { return inputs_[0]; } | 2093 LOperand* value() { return inputs_[0]; } |
| 2185 bool needs_check() const { return needs_check_; } | 2094 bool needs_check() const { return needs_check_; } |
| 2186 | 2095 |
| 2187 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 2096 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
| 2188 | 2097 |
| 2189 private: | 2098 private: |
| 2190 bool needs_check_; | 2099 bool needs_check_; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 bool is_external() const { return hydrogen()->is_external(); } | 2156 bool is_external() const { return hydrogen()->is_external(); } |
| 2248 bool is_fixed_typed_array() const { | 2157 bool is_fixed_typed_array() const { |
| 2249 return hydrogen()->is_fixed_typed_array(); | 2158 return hydrogen()->is_fixed_typed_array(); |
| 2250 } | 2159 } |
| 2251 bool is_typed_elements() const { | 2160 bool is_typed_elements() const { |
| 2252 return is_external() || is_fixed_typed_array(); | 2161 return is_external() || is_fixed_typed_array(); |
| 2253 } | 2162 } |
| 2254 LOperand* elements() { return inputs_[0]; } | 2163 LOperand* elements() { return inputs_[0]; } |
| 2255 LOperand* key() { return inputs_[1]; } | 2164 LOperand* key() { return inputs_[1]; } |
| 2256 LOperand* value() { return inputs_[2]; } | 2165 LOperand* value() { return inputs_[2]; } |
| 2257 ElementsKind elements_kind() const { | 2166 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
| 2258 return hydrogen()->elements_kind(); | |
| 2259 } | |
| 2260 | 2167 |
| 2261 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2168 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
| 2262 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2169 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
| 2263 | 2170 |
| 2264 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 2171 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2265 bool NeedsCanonicalization() { | 2172 bool NeedsCanonicalization() { |
| 2266 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || | 2173 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || |
| 2267 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { | 2174 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { |
| 2268 return false; | 2175 return false; |
| 2269 } | 2176 } |
| 2270 return hydrogen()->NeedsCanonicalization(); | 2177 return hydrogen()->NeedsCanonicalization(); |
| 2271 } | 2178 } |
| 2272 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 2179 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
| 2273 }; | 2180 }; |
| 2274 | 2181 |
| 2275 | 2182 |
| 2276 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> { | 2183 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> { |
| 2277 public: | 2184 public: |
| 2278 LStoreKeyedGeneric(LOperand* context, | 2185 LStoreKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, |
| 2279 LOperand* obj, | |
| 2280 LOperand* key, | |
| 2281 LOperand* value) { | 2186 LOperand* value) { |
| 2282 inputs_[0] = context; | 2187 inputs_[0] = context; |
| 2283 inputs_[1] = obj; | 2188 inputs_[1] = obj; |
| 2284 inputs_[2] = key; | 2189 inputs_[2] = key; |
| 2285 inputs_[3] = value; | 2190 inputs_[3] = value; |
| 2286 } | 2191 } |
| 2287 | 2192 |
| 2288 LOperand* context() { return inputs_[0]; } | 2193 LOperand* context() { return inputs_[0]; } |
| 2289 LOperand* object() { return inputs_[1]; } | 2194 LOperand* object() { return inputs_[1]; } |
| 2290 LOperand* key() { return inputs_[2]; } | 2195 LOperand* key() { return inputs_[2]; } |
| 2291 LOperand* value() { return inputs_[3]; } | 2196 LOperand* value() { return inputs_[3]; } |
| 2292 | 2197 |
| 2293 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2198 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 2294 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2199 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 2295 | 2200 |
| 2296 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 2201 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2297 | 2202 |
| 2298 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2203 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
| 2299 }; | 2204 }; |
| 2300 | 2205 |
| 2301 | 2206 |
| 2302 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 1> { | 2207 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 1> { |
| 2303 public: | 2208 public: |
| 2304 LTransitionElementsKind(LOperand* object, | 2209 LTransitionElementsKind(LOperand* object, LOperand* context, |
| 2305 LOperand* context, | |
| 2306 LOperand* new_map_temp) { | 2210 LOperand* new_map_temp) { |
| 2307 inputs_[0] = object; | 2211 inputs_[0] = object; |
| 2308 inputs_[1] = context; | 2212 inputs_[1] = context; |
| 2309 temps_[0] = new_map_temp; | 2213 temps_[0] = new_map_temp; |
| 2310 } | 2214 } |
| 2311 | 2215 |
| 2312 LOperand* context() { return inputs_[1]; } | 2216 LOperand* context() { return inputs_[1]; } |
| 2313 LOperand* object() { return inputs_[0]; } | 2217 LOperand* object() { return inputs_[0]; } |
| 2314 LOperand* new_map_temp() { return temps_[0]; } | 2218 LOperand* new_map_temp() { return temps_[0]; } |
| 2315 | 2219 |
| 2316 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, | 2220 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
| 2317 "transition-elements-kind") | 2221 "transition-elements-kind") |
| 2318 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) | 2222 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
| 2319 | 2223 |
| 2320 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 2224 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2321 | 2225 |
| 2322 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } | 2226 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } |
| 2323 Handle<Map> transitioned_map() { | 2227 Handle<Map> transitioned_map() { |
| 2324 return hydrogen()->transitioned_map().handle(); | 2228 return hydrogen()->transitioned_map().handle(); |
| 2325 } | 2229 } |
| 2326 ElementsKind from_kind() { return hydrogen()->from_kind(); } | 2230 ElementsKind from_kind() { return hydrogen()->from_kind(); } |
| 2327 ElementsKind to_kind() { return hydrogen()->to_kind(); } | 2231 ElementsKind to_kind() { return hydrogen()->to_kind(); } |
| 2328 }; | 2232 }; |
| 2329 | 2233 |
| 2330 | 2234 |
| 2331 class LTrapAllocationMemento FINAL : public LTemplateInstruction<0, 1, 1> { | 2235 class LTrapAllocationMemento FINAL : public LTemplateInstruction<0, 1, 1> { |
| 2332 public: | 2236 public: |
| 2333 LTrapAllocationMemento(LOperand* object, | 2237 LTrapAllocationMemento(LOperand* object, LOperand* temp) { |
| 2334 LOperand* temp) { | |
| 2335 inputs_[0] = object; | 2238 inputs_[0] = object; |
| 2336 temps_[0] = temp; | 2239 temps_[0] = temp; |
| 2337 } | 2240 } |
| 2338 | 2241 |
| 2339 LOperand* object() { return inputs_[0]; } | 2242 LOperand* object() { return inputs_[0]; } |
| 2340 LOperand* temp() { return temps_[0]; } | 2243 LOperand* temp() { return temps_[0]; } |
| 2341 | 2244 |
| 2342 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, | 2245 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") |
| 2343 "trap-allocation-memento") | |
| 2344 }; | 2246 }; |
| 2345 | 2247 |
| 2346 | 2248 |
| 2347 class LStringAdd FINAL : public LTemplateInstruction<1, 3, 0> { | 2249 class LStringAdd FINAL : public LTemplateInstruction<1, 3, 0> { |
| 2348 public: | 2250 public: |
| 2349 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { | 2251 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
| 2350 inputs_[0] = context; | 2252 inputs_[0] = context; |
| 2351 inputs_[1] = left; | 2253 inputs_[1] = left; |
| 2352 inputs_[2] = right; | 2254 inputs_[2] = right; |
| 2353 } | 2255 } |
| 2354 | 2256 |
| 2355 LOperand* context() { return inputs_[0]; } | 2257 LOperand* context() { return inputs_[0]; } |
| 2356 LOperand* left() { return inputs_[1]; } | 2258 LOperand* left() { return inputs_[1]; } |
| 2357 LOperand* right() { return inputs_[2]; } | 2259 LOperand* right() { return inputs_[2]; } |
| 2358 | 2260 |
| 2359 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") | 2261 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") |
| 2360 DECLARE_HYDROGEN_ACCESSOR(StringAdd) | 2262 DECLARE_HYDROGEN_ACCESSOR(StringAdd) |
| 2361 }; | 2263 }; |
| 2362 | 2264 |
| 2363 | 2265 |
| 2364 | |
| 2365 class LStringCharCodeAt FINAL : public LTemplateInstruction<1, 3, 0> { | 2266 class LStringCharCodeAt FINAL : public LTemplateInstruction<1, 3, 0> { |
| 2366 public: | 2267 public: |
| 2367 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { | 2268 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { |
| 2368 inputs_[0] = context; | 2269 inputs_[0] = context; |
| 2369 inputs_[1] = string; | 2270 inputs_[1] = string; |
| 2370 inputs_[2] = index; | 2271 inputs_[2] = index; |
| 2371 } | 2272 } |
| 2372 | 2273 |
| 2373 LOperand* context() { return inputs_[0]; } | 2274 LOperand* context() { return inputs_[0]; } |
| 2374 LOperand* string() { return inputs_[1]; } | 2275 LOperand* string() { return inputs_[1]; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2389 LOperand* context() { return inputs_[0]; } | 2290 LOperand* context() { return inputs_[0]; } |
| 2390 LOperand* char_code() { return inputs_[1]; } | 2291 LOperand* char_code() { return inputs_[1]; } |
| 2391 | 2292 |
| 2392 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") | 2293 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
| 2393 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) | 2294 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
| 2394 }; | 2295 }; |
| 2395 | 2296 |
| 2396 | 2297 |
| 2397 class LCheckValue FINAL : public LTemplateInstruction<0, 1, 0> { | 2298 class LCheckValue FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2398 public: | 2299 public: |
| 2399 explicit LCheckValue(LOperand* value) { | 2300 explicit LCheckValue(LOperand* value) { inputs_[0] = value; } |
| 2400 inputs_[0] = value; | |
| 2401 } | |
| 2402 | 2301 |
| 2403 LOperand* value() { return inputs_[0]; } | 2302 LOperand* value() { return inputs_[0]; } |
| 2404 | 2303 |
| 2405 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") | 2304 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") |
| 2406 DECLARE_HYDROGEN_ACCESSOR(CheckValue) | 2305 DECLARE_HYDROGEN_ACCESSOR(CheckValue) |
| 2407 }; | 2306 }; |
| 2408 | 2307 |
| 2409 | 2308 |
| 2410 class LCheckInstanceType FINAL : public LTemplateInstruction<0, 1, 0> { | 2309 class LCheckInstanceType FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2411 public: | 2310 public: |
| 2412 explicit LCheckInstanceType(LOperand* value) { | 2311 explicit LCheckInstanceType(LOperand* value) { inputs_[0] = value; } |
| 2413 inputs_[0] = value; | |
| 2414 } | |
| 2415 | 2312 |
| 2416 LOperand* value() { return inputs_[0]; } | 2313 LOperand* value() { return inputs_[0]; } |
| 2417 | 2314 |
| 2418 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 2315 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
| 2419 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 2316 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
| 2420 }; | 2317 }; |
| 2421 | 2318 |
| 2422 | 2319 |
| 2423 class LCheckMaps FINAL : public LTemplateInstruction<0, 1, 0> { | 2320 class LCheckMaps FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2424 public: | 2321 public: |
| 2425 explicit LCheckMaps(LOperand* value = NULL) { | 2322 explicit LCheckMaps(LOperand* value = NULL) { inputs_[0] = value; } |
| 2426 inputs_[0] = value; | |
| 2427 } | |
| 2428 | 2323 |
| 2429 LOperand* value() { return inputs_[0]; } | 2324 LOperand* value() { return inputs_[0]; } |
| 2430 | 2325 |
| 2431 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") | 2326 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") |
| 2432 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) | 2327 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) |
| 2433 }; | 2328 }; |
| 2434 | 2329 |
| 2435 | 2330 |
| 2436 class LCheckSmi FINAL : public LTemplateInstruction<1, 1, 0> { | 2331 class LCheckSmi FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2437 public: | 2332 public: |
| 2438 explicit LCheckSmi(LOperand* value) { | 2333 explicit LCheckSmi(LOperand* value) { inputs_[0] = value; } |
| 2439 inputs_[0] = value; | |
| 2440 } | |
| 2441 | 2334 |
| 2442 LOperand* value() { return inputs_[0]; } | 2335 LOperand* value() { return inputs_[0]; } |
| 2443 | 2336 |
| 2444 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") | 2337 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") |
| 2445 }; | 2338 }; |
| 2446 | 2339 |
| 2447 | 2340 |
| 2448 class LCheckNonSmi FINAL : public LTemplateInstruction<0, 1, 0> { | 2341 class LCheckNonSmi FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2449 public: | 2342 public: |
| 2450 explicit LCheckNonSmi(LOperand* value) { | 2343 explicit LCheckNonSmi(LOperand* value) { inputs_[0] = value; } |
| 2451 inputs_[0] = value; | |
| 2452 } | |
| 2453 | 2344 |
| 2454 LOperand* value() { return inputs_[0]; } | 2345 LOperand* value() { return inputs_[0]; } |
| 2455 | 2346 |
| 2456 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 2347 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
| 2457 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) | 2348 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) |
| 2458 }; | 2349 }; |
| 2459 | 2350 |
| 2460 | 2351 |
| 2461 class LClampDToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { | 2352 class LClampDToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2462 public: | 2353 public: |
| 2463 explicit LClampDToUint8(LOperand* unclamped) { | 2354 explicit LClampDToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } |
| 2464 inputs_[0] = unclamped; | |
| 2465 } | |
| 2466 | 2355 |
| 2467 LOperand* unclamped() { return inputs_[0]; } | 2356 LOperand* unclamped() { return inputs_[0]; } |
| 2468 | 2357 |
| 2469 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") | 2358 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") |
| 2470 }; | 2359 }; |
| 2471 | 2360 |
| 2472 | 2361 |
| 2473 class LClampIToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { | 2362 class LClampIToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2474 public: | 2363 public: |
| 2475 explicit LClampIToUint8(LOperand* unclamped) { | 2364 explicit LClampIToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } |
| 2476 inputs_[0] = unclamped; | |
| 2477 } | |
| 2478 | 2365 |
| 2479 LOperand* unclamped() { return inputs_[0]; } | 2366 LOperand* unclamped() { return inputs_[0]; } |
| 2480 | 2367 |
| 2481 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") | 2368 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") |
| 2482 }; | 2369 }; |
| 2483 | 2370 |
| 2484 | 2371 |
| 2485 class LClampTToUint8 FINAL : public LTemplateInstruction<1, 1, 1> { | 2372 class LClampTToUint8 FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2486 public: | 2373 public: |
| 2487 LClampTToUint8(LOperand* unclamped, LOperand* temp) { | 2374 LClampTToUint8(LOperand* unclamped, LOperand* temp) { |
| 2488 inputs_[0] = unclamped; | 2375 inputs_[0] = unclamped; |
| 2489 temps_[0] = temp; | 2376 temps_[0] = temp; |
| 2490 } | 2377 } |
| 2491 | 2378 |
| 2492 LOperand* unclamped() { return inputs_[0]; } | 2379 LOperand* unclamped() { return inputs_[0]; } |
| 2493 LOperand* temp() { return temps_[0]; } | 2380 LOperand* temp() { return temps_[0]; } |
| 2494 | 2381 |
| 2495 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 2382 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
| 2496 }; | 2383 }; |
| 2497 | 2384 |
| 2498 | 2385 |
| 2499 class LDoubleBits FINAL : public LTemplateInstruction<1, 1, 0> { | 2386 class LDoubleBits FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2500 public: | 2387 public: |
| 2501 explicit LDoubleBits(LOperand* value) { | 2388 explicit LDoubleBits(LOperand* value) { inputs_[0] = value; } |
| 2502 inputs_[0] = value; | |
| 2503 } | |
| 2504 | 2389 |
| 2505 LOperand* value() { return inputs_[0]; } | 2390 LOperand* value() { return inputs_[0]; } |
| 2506 | 2391 |
| 2507 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") | 2392 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") |
| 2508 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) | 2393 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) |
| 2509 }; | 2394 }; |
| 2510 | 2395 |
| 2511 | 2396 |
| 2512 class LConstructDouble FINAL : public LTemplateInstruction<1, 2, 0> { | 2397 class LConstructDouble FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2513 public: | 2398 public: |
| 2514 LConstructDouble(LOperand* hi, LOperand* lo) { | 2399 LConstructDouble(LOperand* hi, LOperand* lo) { |
| 2515 inputs_[0] = hi; | 2400 inputs_[0] = hi; |
| 2516 inputs_[1] = lo; | 2401 inputs_[1] = lo; |
| 2517 } | 2402 } |
| 2518 | 2403 |
| 2519 LOperand* hi() { return inputs_[0]; } | 2404 LOperand* hi() { return inputs_[0]; } |
| 2520 LOperand* lo() { return inputs_[1]; } | 2405 LOperand* lo() { return inputs_[1]; } |
| 2521 | 2406 |
| 2522 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") | 2407 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") |
| 2523 }; | 2408 }; |
| 2524 | 2409 |
| 2525 | 2410 |
| 2526 class LAllocate FINAL : public LTemplateInstruction<1, 2, 2> { | 2411 class LAllocate FINAL : public LTemplateInstruction<1, 2, 2> { |
| 2527 public: | 2412 public: |
| 2528 LAllocate(LOperand* context, | 2413 LAllocate(LOperand* context, LOperand* size, LOperand* temp1, |
| 2529 LOperand* size, | |
| 2530 LOperand* temp1, | |
| 2531 LOperand* temp2) { | 2414 LOperand* temp2) { |
| 2532 inputs_[0] = context; | 2415 inputs_[0] = context; |
| 2533 inputs_[1] = size; | 2416 inputs_[1] = size; |
| 2534 temps_[0] = temp1; | 2417 temps_[0] = temp1; |
| 2535 temps_[1] = temp2; | 2418 temps_[1] = temp2; |
| 2536 } | 2419 } |
| 2537 | 2420 |
| 2538 LOperand* context() { return inputs_[0]; } | 2421 LOperand* context() { return inputs_[0]; } |
| 2539 LOperand* size() { return inputs_[1]; } | 2422 LOperand* size() { return inputs_[1]; } |
| 2540 LOperand* temp1() { return temps_[0]; } | 2423 LOperand* temp1() { return temps_[0]; } |
| 2541 LOperand* temp2() { return temps_[1]; } | 2424 LOperand* temp2() { return temps_[1]; } |
| 2542 | 2425 |
| 2543 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") | 2426 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
| 2544 DECLARE_HYDROGEN_ACCESSOR(Allocate) | 2427 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
| 2545 }; | 2428 }; |
| 2546 | 2429 |
| 2547 | 2430 |
| 2548 class LRegExpLiteral FINAL : public LTemplateInstruction<1, 1, 0> { | 2431 class LRegExpLiteral FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2549 public: | 2432 public: |
| 2550 explicit LRegExpLiteral(LOperand* context) { | 2433 explicit LRegExpLiteral(LOperand* context) { inputs_[0] = context; } |
| 2551 inputs_[0] = context; | |
| 2552 } | |
| 2553 | 2434 |
| 2554 LOperand* context() { return inputs_[0]; } | 2435 LOperand* context() { return inputs_[0]; } |
| 2555 | 2436 |
| 2556 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") | 2437 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
| 2557 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) | 2438 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
| 2558 }; | 2439 }; |
| 2559 | 2440 |
| 2560 | 2441 |
| 2561 class LFunctionLiteral FINAL : public LTemplateInstruction<1, 1, 0> { | 2442 class LFunctionLiteral FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2562 public: | 2443 public: |
| 2563 explicit LFunctionLiteral(LOperand* context) { | 2444 explicit LFunctionLiteral(LOperand* context) { inputs_[0] = context; } |
| 2564 inputs_[0] = context; | |
| 2565 } | |
| 2566 | 2445 |
| 2567 LOperand* context() { return inputs_[0]; } | 2446 LOperand* context() { return inputs_[0]; } |
| 2568 | 2447 |
| 2569 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 2448 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
| 2570 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 2449 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
| 2571 }; | 2450 }; |
| 2572 | 2451 |
| 2573 | 2452 |
| 2574 class LToFastProperties FINAL : public LTemplateInstruction<1, 1, 0> { | 2453 class LToFastProperties FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2575 public: | 2454 public: |
| 2576 explicit LToFastProperties(LOperand* value) { | 2455 explicit LToFastProperties(LOperand* value) { inputs_[0] = value; } |
| 2577 inputs_[0] = value; | |
| 2578 } | |
| 2579 | 2456 |
| 2580 LOperand* value() { return inputs_[0]; } | 2457 LOperand* value() { return inputs_[0]; } |
| 2581 | 2458 |
| 2582 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") | 2459 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") |
| 2583 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) | 2460 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) |
| 2584 }; | 2461 }; |
| 2585 | 2462 |
| 2586 | 2463 |
| 2587 class LTypeof FINAL : public LTemplateInstruction<1, 2, 0> { | 2464 class LTypeof FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2588 public: | 2465 public: |
| 2589 LTypeof(LOperand* context, LOperand* value) { | 2466 LTypeof(LOperand* context, LOperand* value) { |
| 2590 inputs_[0] = context; | 2467 inputs_[0] = context; |
| 2591 inputs_[1] = value; | 2468 inputs_[1] = value; |
| 2592 } | 2469 } |
| 2593 | 2470 |
| 2594 LOperand* context() { return inputs_[0]; } | 2471 LOperand* context() { return inputs_[0]; } |
| 2595 LOperand* value() { return inputs_[1]; } | 2472 LOperand* value() { return inputs_[1]; } |
| 2596 | 2473 |
| 2597 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 2474 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
| 2598 }; | 2475 }; |
| 2599 | 2476 |
| 2600 | 2477 |
| 2601 class LTypeofIsAndBranch FINAL : public LControlInstruction<1, 0> { | 2478 class LTypeofIsAndBranch FINAL : public LControlInstruction<1, 0> { |
| 2602 public: | 2479 public: |
| 2603 explicit LTypeofIsAndBranch(LOperand* value) { | 2480 explicit LTypeofIsAndBranch(LOperand* value) { inputs_[0] = value; } |
| 2604 inputs_[0] = value; | |
| 2605 } | |
| 2606 | 2481 |
| 2607 LOperand* value() { return inputs_[0]; } | 2482 LOperand* value() { return inputs_[0]; } |
| 2608 | 2483 |
| 2609 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 2484 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
| 2610 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) | 2485 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
| 2611 | 2486 |
| 2612 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 2487 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
| 2613 | 2488 |
| 2614 virtual void PrintDataTo(StringStream* stream) OVERRIDE; | 2489 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2615 }; | 2490 }; |
| 2616 | 2491 |
| 2617 | 2492 |
| 2618 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 1> { | 2493 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 1> { |
| 2619 public: | 2494 public: |
| 2620 explicit LIsConstructCallAndBranch(LOperand* temp) { | 2495 explicit LIsConstructCallAndBranch(LOperand* temp) { temps_[0] = temp; } |
| 2621 temps_[0] = temp; | |
| 2622 } | |
| 2623 | 2496 |
| 2624 LOperand* temp() { return temps_[0]; } | 2497 LOperand* temp() { return temps_[0]; } |
| 2625 | 2498 |
| 2626 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, | 2499 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
| 2627 "is-construct-call-and-branch") | 2500 "is-construct-call-and-branch") |
| 2628 }; | 2501 }; |
| 2629 | 2502 |
| 2630 | 2503 |
| 2631 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> { | 2504 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> { |
| 2632 public: | 2505 public: |
| 2633 LOsrEntry() {} | 2506 LOsrEntry() {} |
| 2634 | 2507 |
| 2635 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { | 2508 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 2636 return false; | 2509 return false; |
| 2637 } | 2510 } |
| 2638 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2511 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2639 }; | 2512 }; |
| 2640 | 2513 |
| 2641 | 2514 |
| 2642 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> { | 2515 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2643 public: | 2516 public: |
| 2644 explicit LStackCheck(LOperand* context) { | 2517 explicit LStackCheck(LOperand* context) { inputs_[0] = context; } |
| 2645 inputs_[0] = context; | |
| 2646 } | |
| 2647 | 2518 |
| 2648 LOperand* context() { return inputs_[0]; } | 2519 LOperand* context() { return inputs_[0]; } |
| 2649 | 2520 |
| 2650 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 2521 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 2651 DECLARE_HYDROGEN_ACCESSOR(StackCheck) | 2522 DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
| 2652 | 2523 |
| 2653 Label* done_label() { return &done_label_; } | 2524 Label* done_label() { return &done_label_; } |
| 2654 | 2525 |
| 2655 private: | 2526 private: |
| 2656 Label done_label_; | 2527 Label done_label_; |
| 2657 }; | 2528 }; |
| 2658 | 2529 |
| 2659 | 2530 |
| 2660 class LForInPrepareMap FINAL : public LTemplateInstruction<1, 2, 0> { | 2531 class LForInPrepareMap FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2661 public: | 2532 public: |
| 2662 LForInPrepareMap(LOperand* context, LOperand* object) { | 2533 LForInPrepareMap(LOperand* context, LOperand* object) { |
| 2663 inputs_[0] = context; | 2534 inputs_[0] = context; |
| 2664 inputs_[1] = object; | 2535 inputs_[1] = object; |
| 2665 } | 2536 } |
| 2666 | 2537 |
| 2667 LOperand* context() { return inputs_[0]; } | 2538 LOperand* context() { return inputs_[0]; } |
| 2668 LOperand* object() { return inputs_[1]; } | 2539 LOperand* object() { return inputs_[1]; } |
| 2669 | 2540 |
| 2670 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") | 2541 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
| 2671 }; | 2542 }; |
| 2672 | 2543 |
| 2673 | 2544 |
| 2674 class LForInCacheArray FINAL : public LTemplateInstruction<1, 1, 0> { | 2545 class LForInCacheArray FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2675 public: | 2546 public: |
| 2676 explicit LForInCacheArray(LOperand* map) { | 2547 explicit LForInCacheArray(LOperand* map) { inputs_[0] = map; } |
| 2677 inputs_[0] = map; | |
| 2678 } | |
| 2679 | 2548 |
| 2680 LOperand* map() { return inputs_[0]; } | 2549 LOperand* map() { return inputs_[0]; } |
| 2681 | 2550 |
| 2682 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") | 2551 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
| 2683 | 2552 |
| 2684 int idx() { | 2553 int idx() { return HForInCacheArray::cast(this->hydrogen_value())->idx(); } |
| 2685 return HForInCacheArray::cast(this->hydrogen_value())->idx(); | |
| 2686 } | |
| 2687 }; | 2554 }; |
| 2688 | 2555 |
| 2689 | 2556 |
| 2690 class LCheckMapValue FINAL : public LTemplateInstruction<0, 2, 0> { | 2557 class LCheckMapValue FINAL : public LTemplateInstruction<0, 2, 0> { |
| 2691 public: | 2558 public: |
| 2692 LCheckMapValue(LOperand* value, LOperand* map) { | 2559 LCheckMapValue(LOperand* value, LOperand* map) { |
| 2693 inputs_[0] = value; | 2560 inputs_[0] = value; |
| 2694 inputs_[1] = map; | 2561 inputs_[1] = map; |
| 2695 } | 2562 } |
| 2696 | 2563 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2708 inputs_[1] = index; | 2575 inputs_[1] = index; |
| 2709 } | 2576 } |
| 2710 | 2577 |
| 2711 LOperand* object() { return inputs_[0]; } | 2578 LOperand* object() { return inputs_[0]; } |
| 2712 LOperand* index() { return inputs_[1]; } | 2579 LOperand* index() { return inputs_[1]; } |
| 2713 | 2580 |
| 2714 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2581 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| 2715 }; | 2582 }; |
| 2716 | 2583 |
| 2717 | 2584 |
| 2718 class LStoreFrameContext: public LTemplateInstruction<0, 1, 0> { | 2585 class LStoreFrameContext : public LTemplateInstruction<0, 1, 0> { |
| 2719 public: | 2586 public: |
| 2720 explicit LStoreFrameContext(LOperand* context) { | 2587 explicit LStoreFrameContext(LOperand* context) { inputs_[0] = context; } |
| 2721 inputs_[0] = context; | |
| 2722 } | |
| 2723 | 2588 |
| 2724 LOperand* context() { return inputs_[0]; } | 2589 LOperand* context() { return inputs_[0]; } |
| 2725 | 2590 |
| 2726 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context") | 2591 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context") |
| 2727 }; | 2592 }; |
| 2728 | 2593 |
| 2729 | 2594 |
| 2730 class LAllocateBlockContext: public LTemplateInstruction<1, 2, 0> { | 2595 class LAllocateBlockContext : public LTemplateInstruction<1, 2, 0> { |
| 2731 public: | 2596 public: |
| 2732 LAllocateBlockContext(LOperand* context, LOperand* function) { | 2597 LAllocateBlockContext(LOperand* context, LOperand* function) { |
| 2733 inputs_[0] = context; | 2598 inputs_[0] = context; |
| 2734 inputs_[1] = function; | 2599 inputs_[1] = function; |
| 2735 } | 2600 } |
| 2736 | 2601 |
| 2737 LOperand* context() { return inputs_[0]; } | 2602 LOperand* context() { return inputs_[0]; } |
| 2738 LOperand* function() { return inputs_[1]; } | 2603 LOperand* function() { return inputs_[1]; } |
| 2739 | 2604 |
| 2740 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } | 2605 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } |
| 2741 | 2606 |
| 2742 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") | 2607 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") |
| 2743 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) | 2608 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) |
| 2744 }; | 2609 }; |
| 2745 | 2610 |
| 2746 | 2611 |
| 2747 class LChunkBuilder; | 2612 class LChunkBuilder; |
| 2748 class LPlatformChunk FINAL : public LChunk { | 2613 class LPlatformChunk FINAL : public LChunk { |
| 2749 public: | 2614 public: |
| 2750 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2615 LPlatformChunk(CompilationInfo* info, HGraph* graph) : LChunk(info, graph) {} |
| 2751 : LChunk(info, graph) { } | |
| 2752 | 2616 |
| 2753 int GetNextSpillIndex(RegisterKind kind); | 2617 int GetNextSpillIndex(RegisterKind kind); |
| 2754 LOperand* GetNextSpillSlot(RegisterKind kind); | 2618 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 2755 }; | 2619 }; |
| 2756 | 2620 |
| 2757 | 2621 |
| 2758 class LChunkBuilder FINAL : public LChunkBuilderBase { | 2622 class LChunkBuilder FINAL : public LChunkBuilderBase { |
| 2759 public: | 2623 public: |
| 2760 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2624 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2761 : LChunkBuilderBase(graph->zone()), | 2625 : LChunkBuilderBase(graph->zone()), |
| 2762 chunk_(NULL), | 2626 chunk_(NULL), |
| 2763 info_(info), | 2627 info_(info), |
| 2764 graph_(graph), | 2628 graph_(graph), |
| 2765 status_(UNUSED), | 2629 status_(UNUSED), |
| 2766 current_instruction_(NULL), | 2630 current_instruction_(NULL), |
| 2767 current_block_(NULL), | 2631 current_block_(NULL), |
| 2768 next_block_(NULL), | 2632 next_block_(NULL), |
| 2769 allocator_(allocator) { } | 2633 allocator_(allocator) {} |
| 2770 | 2634 |
| 2771 Isolate* isolate() const { return graph_->isolate(); } | 2635 Isolate* isolate() const { return graph_->isolate(); } |
| 2772 | 2636 |
| 2773 // Build the sequence for the graph. | 2637 // Build the sequence for the graph. |
| 2774 LPlatformChunk* Build(); | 2638 LPlatformChunk* Build(); |
| 2775 | 2639 |
| 2776 // Declare methods that deal with the individual node types. | 2640 // Declare methods that deal with the individual node types. |
| 2777 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2641 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2778 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2642 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2779 #undef DECLARE_DO | 2643 #undef DECLARE_DO |
| 2780 | 2644 |
| 2781 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2645 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
| 2782 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); | 2646 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); |
| 2783 LInstruction* DoRSub(HSub* instr); | 2647 LInstruction* DoRSub(HSub* instr); |
| 2784 | 2648 |
| 2785 static bool HasMagicNumberForDivisor(int32_t divisor); | 2649 static bool HasMagicNumberForDivisor(int32_t divisor); |
| 2786 | 2650 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2797 LInstruction* DoDivByConstI(HDiv* instr); | 2661 LInstruction* DoDivByConstI(HDiv* instr); |
| 2798 LInstruction* DoDivI(HDiv* instr); | 2662 LInstruction* DoDivI(HDiv* instr); |
| 2799 LInstruction* DoModByPowerOf2I(HMod* instr); | 2663 LInstruction* DoModByPowerOf2I(HMod* instr); |
| 2800 LInstruction* DoModByConstI(HMod* instr); | 2664 LInstruction* DoModByConstI(HMod* instr); |
| 2801 LInstruction* DoModI(HMod* instr); | 2665 LInstruction* DoModI(HMod* instr); |
| 2802 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 2666 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
| 2803 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | 2667 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
| 2804 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 2668 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
| 2805 | 2669 |
| 2806 private: | 2670 private: |
| 2807 enum Status { | 2671 enum Status { UNUSED, BUILDING, DONE, ABORTED }; |
| 2808 UNUSED, | |
| 2809 BUILDING, | |
| 2810 DONE, | |
| 2811 ABORTED | |
| 2812 }; | |
| 2813 | 2672 |
| 2814 LPlatformChunk* chunk() const { return chunk_; } | 2673 LPlatformChunk* chunk() const { return chunk_; } |
| 2815 CompilationInfo* info() const { return info_; } | 2674 CompilationInfo* info() const { return info_; } |
| 2816 HGraph* graph() const { return graph_; } | 2675 HGraph* graph() const { return graph_; } |
| 2817 | 2676 |
| 2818 bool is_unused() const { return status_ == UNUSED; } | 2677 bool is_unused() const { return status_ == UNUSED; } |
| 2819 bool is_building() const { return status_ == BUILDING; } | 2678 bool is_building() const { return status_ == BUILDING; } |
| 2820 bool is_done() const { return status_ == DONE; } | 2679 bool is_done() const { return status_ == DONE; } |
| 2821 bool is_aborted() const { return status_ == ABORTED; } | 2680 bool is_aborted() const { return status_ == ABORTED; } |
| 2822 | 2681 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2872 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); | 2731 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); |
| 2873 | 2732 |
| 2874 // Methods for setting up define-use relationships. | 2733 // Methods for setting up define-use relationships. |
| 2875 // Return the same instruction that they are passed. | 2734 // Return the same instruction that they are passed. |
| 2876 LInstruction* Define(LTemplateResultInstruction<1>* instr, | 2735 LInstruction* Define(LTemplateResultInstruction<1>* instr, |
| 2877 LUnallocated* result); | 2736 LUnallocated* result); |
| 2878 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); | 2737 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); |
| 2879 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, | 2738 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, |
| 2880 int index); | 2739 int index); |
| 2881 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); | 2740 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); |
| 2882 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, | 2741 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, Register reg); |
| 2883 Register reg); | |
| 2884 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, | 2742 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, |
| 2885 DoubleRegister reg); | 2743 DoubleRegister reg); |
| 2886 LInstruction* AssignEnvironment(LInstruction* instr); | 2744 LInstruction* AssignEnvironment(LInstruction* instr); |
| 2887 LInstruction* AssignPointerMap(LInstruction* instr); | 2745 LInstruction* AssignPointerMap(LInstruction* instr); |
| 2888 | 2746 |
| 2889 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2747 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
| 2890 | 2748 |
| 2891 // By default we assume that instruction sequences generated for calls | 2749 // By default we assume that instruction sequences generated for calls |
| 2892 // cannot deoptimize eagerly and we do not attach environment to this | 2750 // cannot deoptimize eagerly and we do not attach environment to this |
| 2893 // instruction. | 2751 // instruction. |
| 2894 LInstruction* MarkAsCall( | 2752 LInstruction* MarkAsCall( |
| 2895 LInstruction* instr, | 2753 LInstruction* instr, HInstruction* hinstr, |
| 2896 HInstruction* hinstr, | |
| 2897 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2754 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
| 2898 | 2755 |
| 2899 void VisitInstruction(HInstruction* current); | 2756 void VisitInstruction(HInstruction* current); |
| 2900 void AddInstruction(LInstruction* instr, HInstruction* current); | 2757 void AddInstruction(LInstruction* instr, HInstruction* current); |
| 2901 | 2758 |
| 2902 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2759 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
| 2903 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2760 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 2904 LInstruction* DoArithmeticD(Token::Value op, | 2761 LInstruction* DoArithmeticD(Token::Value op, |
| 2905 HArithmeticBinaryOperation* instr); | 2762 HArithmeticBinaryOperation* instr); |
| 2906 LInstruction* DoArithmeticT(Token::Value op, | 2763 LInstruction* DoArithmeticT(Token::Value op, HBinaryOperation* instr); |
| 2907 HBinaryOperation* instr); | |
| 2908 | 2764 |
| 2909 LPlatformChunk* chunk_; | 2765 LPlatformChunk* chunk_; |
| 2910 CompilationInfo* info_; | 2766 CompilationInfo* info_; |
| 2911 HGraph* const graph_; | 2767 HGraph* const graph_; |
| 2912 Status status_; | 2768 Status status_; |
| 2913 HInstruction* current_instruction_; | 2769 HInstruction* current_instruction_; |
| 2914 HBasicBlock* current_block_; | 2770 HBasicBlock* current_block_; |
| 2915 HBasicBlock* next_block_; | 2771 HBasicBlock* next_block_; |
| 2916 LAllocator* allocator_; | 2772 LAllocator* allocator_; |
| 2917 | 2773 |
| 2918 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2774 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2919 }; | 2775 }; |
| 2920 | 2776 |
| 2921 #undef DECLARE_HYDROGEN_ACCESSOR | 2777 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2922 #undef DECLARE_CONCRETE_INSTRUCTION | 2778 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2779 } |
| 2780 } // namespace v8::internal |
| 2923 | 2781 |
| 2924 } } // namespace v8::internal | 2782 #endif // V8_PPC_LITHIUM_PPC_H_ |
| 2925 | |
| 2926 #endif // V8_ARM_LITHIUM_ARM_H_ | |
| OLD | NEW |