| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 v8::Local<v8::Value> result = CompileRun(code); | 523 v8::Local<v8::Value> result = CompileRun(code); |
| 524 CHECK(result->IsUndefined()); | 524 CHECK(result->IsUndefined()); |
| 525 } | 525 } |
| 526 | 526 |
| 527 | 527 |
| 528 static inline void DisableInlineAllocationSteps(v8::internal::NewSpace* space) { | 528 static inline void DisableInlineAllocationSteps(v8::internal::NewSpace* space) { |
| 529 space->LowerInlineAllocationLimit(0); | 529 space->LowerInlineAllocationLimit(0); |
| 530 } | 530 } |
| 531 | 531 |
| 532 | 532 |
| 533 static inline void CheckDoubleEquals(double expected, double actual) { |
| 534 const double kEpsilon = 1e-10; |
| 535 CHECK_LE(expected, actual + kEpsilon); |
| 536 CHECK_GE(expected, actual - kEpsilon); |
| 537 } |
| 538 |
| 539 |
| 533 static int LenFromSize(int size) { | 540 static int LenFromSize(int size) { |
| 534 return (size - i::FixedArray::kHeaderSize) / i::kPointerSize; | 541 return (size - i::FixedArray::kHeaderSize) / i::kPointerSize; |
| 535 } | 542 } |
| 536 | 543 |
| 537 | 544 |
| 538 static inline void CreatePadding(i::Heap* heap, int padding_size, | 545 static inline void CreatePadding(i::Heap* heap, int padding_size, |
| 539 i::PretenureFlag tenure) { | 546 i::PretenureFlag tenure) { |
| 540 const int max_number_of_objects = 20; | 547 const int max_number_of_objects = 20; |
| 541 v8::internal::Handle<v8::internal::FixedArray> | 548 v8::internal::Handle<v8::internal::FixedArray> |
| 542 big_objects[max_number_of_objects]; | 549 big_objects[max_number_of_objects]; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 HandleAndZoneScope() {} | 694 HandleAndZoneScope() {} |
| 688 | 695 |
| 689 // Prefixing the below with main_ reduces a lot of naming clashes. | 696 // Prefixing the below with main_ reduces a lot of naming clashes. |
| 690 i::Zone* main_zone() { return &main_zone_; } | 697 i::Zone* main_zone() { return &main_zone_; } |
| 691 | 698 |
| 692 private: | 699 private: |
| 693 i::Zone main_zone_; | 700 i::Zone main_zone_; |
| 694 }; | 701 }; |
| 695 | 702 |
| 696 #endif // ifndef CCTEST_H_ | 703 #endif // ifndef CCTEST_H_ |
| OLD | NEW |