OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 22098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22109 Local<Object> ApiCallOptimizationChecker::holder; | 22109 Local<Object> ApiCallOptimizationChecker::holder; |
22110 Local<Object> ApiCallOptimizationChecker::callee; | 22110 Local<Object> ApiCallOptimizationChecker::callee; |
22111 int ApiCallOptimizationChecker::count = 0; | 22111 int ApiCallOptimizationChecker::count = 0; |
22112 | 22112 |
22113 | 22113 |
22114 TEST(TestFunctionCallOptimization) { | 22114 TEST(TestFunctionCallOptimization) { |
22115 i::FLAG_allow_natives_syntax = true; | 22115 i::FLAG_allow_natives_syntax = true; |
22116 ApiCallOptimizationChecker checker; | 22116 ApiCallOptimizationChecker checker; |
22117 checker.RunAll(); | 22117 checker.RunAll(); |
22118 } | 22118 } |
| 22119 |
| 22120 |
| 22121 static const char* last_event_message; |
| 22122 static int last_event_status; |
| 22123 void StoringEventLoggerCallback(const char* message, int status) { |
| 22124 last_event_message = message; |
| 22125 last_event_status = status; |
| 22126 } |
| 22127 |
| 22128 |
| 22129 TEST(EventLogging) { |
| 22130 LocalContext env; |
| 22131 v8::V8::SetEventLogger(StoringEventLoggerCallback); |
| 22132 v8::internal::HistogramTimer* histogramTimer = |
| 22133 new v8::internal::HistogramTimer( |
| 22134 "V8.Test", 0, 10000, 50, |
| 22135 reinterpret_cast<v8::internal::Isolate*>(env->GetIsolate())); |
| 22136 histogramTimer->Start(); |
| 22137 CHECK_EQ("V8.Test", last_event_message); |
| 22138 CHECK_EQ(0, last_event_status); |
| 22139 histogramTimer->Stop(); |
| 22140 CHECK_EQ("V8.Test", last_event_message); |
| 22141 CHECK_EQ(1, last_event_status); |
| 22142 } |
OLD | NEW |