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 26 matching lines...) Expand all Loading... |
37 #endif | 37 #endif |
38 | 38 |
39 #include "include/v8-util.h" | 39 #include "include/v8-util.h" |
40 #include "src/api.h" | 40 #include "src/api.h" |
41 #include "src/arguments.h" | 41 #include "src/arguments.h" |
42 #include "src/base/platform/platform.h" | 42 #include "src/base/platform/platform.h" |
43 #include "src/compilation-cache.h" | 43 #include "src/compilation-cache.h" |
44 #include "src/cpu-profiler.h" | 44 #include "src/cpu-profiler.h" |
45 #include "src/execution.h" | 45 #include "src/execution.h" |
46 #include "src/isolate.h" | 46 #include "src/isolate.h" |
47 #include "src/objects.h" | |
48 #include "src/parser.h" | 47 #include "src/parser.h" |
49 #include "src/snapshot.h" | 48 #include "src/snapshot.h" |
50 #include "src/unicode-inl.h" | 49 #include "src/unicode-inl.h" |
51 #include "src/utils.h" | 50 #include "src/utils.h" |
52 #include "src/vm-state.h" | 51 #include "src/vm-state.h" |
53 #include "test/cctest/cctest.h" | 52 #include "test/cctest/cctest.h" |
54 | 53 |
55 static const bool kLogThreading = false; | 54 static const bool kLogThreading = false; |
56 | 55 |
57 using ::v8::Boolean; | 56 using ::v8::Boolean; |
(...skipping 23651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23709 last_event_message = message; | 23708 last_event_message = message; |
23710 last_event_status = status; | 23709 last_event_status = status; |
23711 } | 23710 } |
23712 | 23711 |
23713 | 23712 |
23714 TEST(EventLogging) { | 23713 TEST(EventLogging) { |
23715 v8::Isolate* isolate = CcTest::isolate(); | 23714 v8::Isolate* isolate = CcTest::isolate(); |
23716 isolate->SetEventLogger(StoringEventLoggerCallback); | 23715 isolate->SetEventLogger(StoringEventLoggerCallback); |
23717 v8::internal::HistogramTimer histogramTimer( | 23716 v8::internal::HistogramTimer histogramTimer( |
23718 "V8.Test", 0, 10000, 50, | 23717 "V8.Test", 0, 10000, 50, |
23719 reinterpret_cast<v8::internal::Isolate*>(isolate)); | 23718 reinterpret_cast<v8::internal::Isolate*>(isolate), |
| 23719 v8::internal::Logger::NORMAL); |
23720 histogramTimer.Start(); | 23720 histogramTimer.Start(); |
23721 CHECK_EQ("V8.Test", last_event_message); | 23721 CHECK_EQ("V8.Test", last_event_message); |
23722 CHECK_EQ(0, last_event_status); | 23722 CHECK_EQ(0, last_event_status); |
23723 histogramTimer.Stop(); | 23723 histogramTimer.Stop(); |
23724 CHECK_EQ("V8.Test", last_event_message); | 23724 CHECK_EQ("V8.Test", last_event_message); |
23725 CHECK_EQ(1, last_event_status); | 23725 CHECK_EQ(1, last_event_status); |
23726 } | 23726 } |
23727 | 23727 |
23728 | 23728 |
23729 TEST(Promises) { | 23729 TEST(Promises) { |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24720 TEST(ClassPrototypeCreationContext) { | 24720 TEST(ClassPrototypeCreationContext) { |
24721 i::FLAG_harmony_classes = true; | 24721 i::FLAG_harmony_classes = true; |
24722 v8::Isolate* isolate = CcTest::isolate(); | 24722 v8::Isolate* isolate = CcTest::isolate(); |
24723 v8::HandleScope handle_scope(isolate); | 24723 v8::HandleScope handle_scope(isolate); |
24724 LocalContext env; | 24724 LocalContext env; |
24725 | 24725 |
24726 Handle<Object> result = Handle<Object>::Cast( | 24726 Handle<Object> result = Handle<Object>::Cast( |
24727 CompileRun("'use strict'; class Example { }; Example.prototype")); | 24727 CompileRun("'use strict'; class Example { }; Example.prototype")); |
24728 CHECK(env.local() == result->CreationContext()); | 24728 CHECK(env.local() == result->CreationContext()); |
24729 } | 24729 } |
OLD | NEW |