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

Side by Side Diff: test/cctest/cctest.h

Issue 1414483004: Add the rate of js invocations from the api as a signal of idleness (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments from Hannes Created 5 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
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/heap-tester.h » ('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 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
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
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_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/heap-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698