OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 class CompareStub: public CodeStub { | 345 class CompareStub: public CodeStub { |
346 public: | 346 public: |
347 CompareStub(Condition cc, | 347 CompareStub(Condition cc, |
348 bool strict, | 348 bool strict, |
349 NaNInformation nan_info = kBothCouldBeNaN, | 349 NaNInformation nan_info = kBothCouldBeNaN, |
350 bool include_number_compare = true) : | 350 bool include_number_compare = true) : |
351 cc_(cc), | 351 cc_(cc), |
352 strict_(strict), | 352 strict_(strict), |
353 never_nan_nan_(nan_info == kCantBothBeNaN), | 353 never_nan_nan_(nan_info == kCantBothBeNaN), |
354 include_number_compare_(include_number_compare) { } | 354 include_number_compare_(include_number_compare), |
| 355 name_(NULL) { } |
355 | 356 |
356 void Generate(MacroAssembler* masm); | 357 void Generate(MacroAssembler* masm); |
357 | 358 |
358 private: | 359 private: |
359 Condition cc_; | 360 Condition cc_; |
360 bool strict_; | 361 bool strict_; |
361 // Only used for 'equal' comparisons. Tells the stub that we already know | 362 // Only used for 'equal' comparisons. Tells the stub that we already know |
362 // that at least one side of the comparison is not NaN. This allows the | 363 // that at least one side of the comparison is not NaN. This allows the |
363 // stub to use object identity in the positive case. We ignore it when | 364 // stub to use object identity in the positive case. We ignore it when |
364 // generating the minor key for other comparisons to avoid creating more | 365 // generating the minor key for other comparisons to avoid creating more |
(...skipping 15 matching lines...) Expand all Loading... |
380 int MinorKey(); | 381 int MinorKey(); |
381 | 382 |
382 // Branch to the label if the given object isn't a symbol. | 383 // Branch to the label if the given object isn't a symbol. |
383 void BranchIfNonSymbol(MacroAssembler* masm, | 384 void BranchIfNonSymbol(MacroAssembler* masm, |
384 Label* label, | 385 Label* label, |
385 Register object, | 386 Register object, |
386 Register scratch); | 387 Register scratch); |
387 | 388 |
388 // Unfortunately you have to run without snapshots to see most of these | 389 // Unfortunately you have to run without snapshots to see most of these |
389 // names in the profile since most compare stubs end up in the snapshot. | 390 // names in the profile since most compare stubs end up in the snapshot. |
| 391 char* name_; |
390 const char* GetName(); | 392 const char* GetName(); |
391 #ifdef DEBUG | 393 #ifdef DEBUG |
392 void Print() { | 394 void Print() { |
393 PrintF("CompareStub (cc %d), (strict %s)\n", | 395 PrintF("CompareStub (cc %d), (strict %s), " |
| 396 "(never_nan_nan %s), (number_compare %s)\n", |
394 static_cast<int>(cc_), | 397 static_cast<int>(cc_), |
395 strict_ ? "true" : "false"); | 398 strict_ ? "true" : "false", |
| 399 never_nan_nan_ ? "true" : "false", |
| 400 include_number_compare_ ? "included" : "not included"); |
396 } | 401 } |
397 #endif | 402 #endif |
398 }; | 403 }; |
399 | 404 |
400 | 405 |
401 class CEntryStub : public CodeStub { | 406 class CEntryStub : public CodeStub { |
402 public: | 407 public: |
403 explicit CEntryStub(int result_size, | 408 explicit CEntryStub(int result_size, |
404 ExitFrame::Mode mode = ExitFrame::MODE_NORMAL) | 409 ExitFrame::Mode mode = ExitFrame::MODE_NORMAL) |
405 : result_size_(result_size), mode_(mode) { } | 410 : result_size_(result_size), mode_(mode) { } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 private: | 601 private: |
597 Major MajorKey() { return ToBoolean; } | 602 Major MajorKey() { return ToBoolean; } |
598 int MinorKey() { return 0; } | 603 int MinorKey() { return 0; } |
599 }; | 604 }; |
600 | 605 |
601 | 606 |
602 } // namespace internal | 607 } // namespace internal |
603 } // namespace v8 | 608 } // namespace v8 |
604 | 609 |
605 #endif // V8_CODEGEN_H_ | 610 #endif // V8_CODEGEN_H_ |
OLD | NEW |