Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: src/ppc/lithium-ppc.h

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

Powered by Google App Engine
This is Rietveld 408576698