| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 | 6 |
| 7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/profiler.h" | 10 #include "vm/profiler.h" |
| (...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 // Token position of * in `i * i`. | 2358 // Token position of * in `i * i`. |
| 2359 const TokenPosition squarePosition = TokenPosition(6); | 2359 const TokenPosition squarePosition = TokenPosition(6); |
| 2360 | 2360 |
| 2361 // Token position of the call to `doWork`. | 2361 // Token position of the call to `doWork`. |
| 2362 const TokenPosition callPosition = TokenPosition(39); | 2362 const TokenPosition callPosition = TokenPosition(39); |
| 2363 | 2363 |
| 2364 DisableNativeProfileScope dnps; | 2364 DisableNativeProfileScope dnps; |
| 2365 // Disable profiling for this thread. | 2365 // Disable profiling for this thread. |
| 2366 DisableThreadInterruptsScope dtis(Thread::Current()); | 2366 DisableThreadInterruptsScope dtis(Thread::Current()); |
| 2367 | 2367 |
| 2368 DisableBackgroundCompilationScope dbcs; |
| 2369 |
| 2368 SampleBuffer* sample_buffer = Profiler::sample_buffer(); | 2370 SampleBuffer* sample_buffer = Profiler::sample_buffer(); |
| 2369 EXPECT(sample_buffer != NULL); | 2371 EXPECT(sample_buffer != NULL); |
| 2370 | 2372 |
| 2371 Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); | 2373 Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); |
| 2372 EXPECT_VALID(lib); | 2374 EXPECT_VALID(lib); |
| 2373 Library& root_library = Library::Handle(); | 2375 Library& root_library = Library::Handle(); |
| 2374 root_library ^= Api::UnwrapHandle(lib); | 2376 root_library ^= Api::UnwrapHandle(lib); |
| 2375 | 2377 |
| 2376 // Invoke main so that it gets compiled. | 2378 // Invoke main so that it gets compiled. |
| 2377 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 2379 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); | 2497 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); |
| 2496 // Verify exclusive ticks in main. | 2498 // Verify exclusive ticks in main. |
| 2497 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); | 2499 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); |
| 2498 // Verify inclusive ticks in main. | 2500 // Verify inclusive ticks in main. |
| 2499 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); | 2501 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); |
| 2500 } | 2502 } |
| 2501 | 2503 |
| 2502 #endif // !PRODUCT | 2504 #endif // !PRODUCT |
| 2503 | 2505 |
| 2504 } // namespace dart | 2506 } // namespace dart |
| OLD | NEW |