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 22017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22028 CompileRun("var obj = {};" | 22028 CompileRun("var obj = {};" |
22029 "Object.observe(obj, function(changes) { debugger; });" | 22029 "Object.observe(obj, function(changes) { debugger; });" |
22030 "obj.a = 0;"); | 22030 "obj.a = 0;"); |
22031 } | 22031 } |
22032 isolate->RunMicrotasks(); | 22032 isolate->RunMicrotasks(); |
22033 isolate->SetAutorunMicrotasks(true); | 22033 isolate->SetAutorunMicrotasks(true); |
22034 v8::Debug::SetDebugEventListener(NULL); | 22034 v8::Debug::SetDebugEventListener(NULL); |
22035 } | 22035 } |
22036 | 22036 |
22037 | 22037 |
22038 #ifdef DEBUG | 22038 #ifdef ENABLE_DISASSEMBLER |
22039 static int probes_counter = 0; | 22039 static int probes_counter = 0; |
22040 static int misses_counter = 0; | 22040 static int misses_counter = 0; |
22041 static int updates_counter = 0; | 22041 static int updates_counter = 0; |
22042 | 22042 |
22043 | 22043 |
22044 static int* LookupCounter(const char* name) { | 22044 static int* LookupCounter(const char* name) { |
22045 if (strcmp(name, "c:V8.MegamorphicStubCacheProbes") == 0) { | 22045 if (strcmp(name, "c:V8.MegamorphicStubCacheProbes") == 0) { |
22046 return &probes_counter; | 22046 return &probes_counter; |
22047 } else if (strcmp(name, "c:V8.MegamorphicStubCacheMisses") == 0) { | 22047 } else if (strcmp(name, "c:V8.MegamorphicStubCacheMisses") == 0) { |
22048 return &misses_counter; | 22048 return &misses_counter; |
(...skipping 13 matching lines...) Expand all Loading... |
22062 "var a = new ClassA();" | 22062 "var a = new ClassA();" |
22063 "var b = new ClassB();" | 22063 "var b = new ClassB();" |
22064 "for (var i = 0; i < 10000; i++) {" | 22064 "for (var i = 0; i < 10000; i++) {" |
22065 " fooify(a);" | 22065 " fooify(a);" |
22066 " fooify(b);" | 22066 " fooify(b);" |
22067 "}"; | 22067 "}"; |
22068 #endif | 22068 #endif |
22069 | 22069 |
22070 | 22070 |
22071 static void StubCacheHelper(bool primary) { | 22071 static void StubCacheHelper(bool primary) { |
22072 #ifdef DEBUG | 22072 #ifdef ENABLE_DISASSEMBLER |
22073 i::FLAG_native_code_counters = true; | 22073 i::FLAG_native_code_counters = true; |
22074 if (primary) { | 22074 if (primary) { |
22075 i::FLAG_test_primary_stub_cache = true; | 22075 i::FLAG_test_primary_stub_cache = true; |
22076 } else { | 22076 } else { |
22077 i::FLAG_test_secondary_stub_cache = true; | 22077 i::FLAG_test_secondary_stub_cache = true; |
22078 } | 22078 } |
22079 i::FLAG_crankshaft = false; | 22079 i::FLAG_crankshaft = false; |
22080 LocalContext env; | 22080 LocalContext env; |
22081 env->GetIsolate()->SetCounterFunction(LookupCounter); | 22081 env->GetIsolate()->SetCounterFunction(LookupCounter); |
22082 v8::HandleScope scope(env->GetIsolate()); | 22082 v8::HandleScope scope(env->GetIsolate()); |
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24470 v8::HandleScope scope(CcTest::isolate()); | 24470 v8::HandleScope scope(CcTest::isolate()); |
24471 RandomLengthOneByteResource* r = | 24471 RandomLengthOneByteResource* r = |
24472 new RandomLengthOneByteResource(i::String::kMaxLength); | 24472 new RandomLengthOneByteResource(i::String::kMaxLength); |
24473 v8::Local<v8::String> str = v8::String::NewExternal(CcTest::isolate(), r); | 24473 v8::Local<v8::String> str = v8::String::NewExternal(CcTest::isolate(), r); |
24474 CHECK(!str.IsEmpty()); | 24474 CHECK(!str.IsEmpty()); |
24475 v8::TryCatch try_catch; | 24475 v8::TryCatch try_catch; |
24476 v8::Local<v8::String> result = v8::String::Concat(str, str); | 24476 v8::Local<v8::String> result = v8::String::Concat(str, str); |
24477 CHECK(result.IsEmpty()); | 24477 CHECK(result.IsEmpty()); |
24478 CHECK(!try_catch.HasCaught()); | 24478 CHECK(!try_catch.HasCaught()); |
24479 } | 24479 } |
OLD | NEW |