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 22022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22033 CompileRun("var obj = {};" | 22033 CompileRun("var obj = {};" |
22034 "Object.observe(obj, function(changes) { debugger; });" | 22034 "Object.observe(obj, function(changes) { debugger; });" |
22035 "obj.a = 0;"); | 22035 "obj.a = 0;"); |
22036 } | 22036 } |
22037 isolate->RunMicrotasks(); | 22037 isolate->RunMicrotasks(); |
22038 isolate->SetAutorunMicrotasks(true); | 22038 isolate->SetAutorunMicrotasks(true); |
22039 v8::Debug::SetDebugEventListener(NULL); | 22039 v8::Debug::SetDebugEventListener(NULL); |
22040 } | 22040 } |
22041 | 22041 |
22042 | 22042 |
22043 #ifdef DEBUG | 22043 #ifdef ENABLE_DISASSEMBLER |
22044 static int probes_counter = 0; | 22044 static int probes_counter = 0; |
22045 static int misses_counter = 0; | 22045 static int misses_counter = 0; |
22046 static int updates_counter = 0; | 22046 static int updates_counter = 0; |
22047 | 22047 |
22048 | 22048 |
22049 static int* LookupCounter(const char* name) { | 22049 static int* LookupCounter(const char* name) { |
22050 if (strcmp(name, "c:V8.MegamorphicStubCacheProbes") == 0) { | 22050 if (strcmp(name, "c:V8.MegamorphicStubCacheProbes") == 0) { |
22051 return &probes_counter; | 22051 return &probes_counter; |
22052 } else if (strcmp(name, "c:V8.MegamorphicStubCacheMisses") == 0) { | 22052 } else if (strcmp(name, "c:V8.MegamorphicStubCacheMisses") == 0) { |
22053 return &misses_counter; | 22053 return &misses_counter; |
(...skipping 13 matching lines...) Expand all Loading... |
22067 "var a = new ClassA();" | 22067 "var a = new ClassA();" |
22068 "var b = new ClassB();" | 22068 "var b = new ClassB();" |
22069 "for (var i = 0; i < 10000; i++) {" | 22069 "for (var i = 0; i < 10000; i++) {" |
22070 " fooify(a);" | 22070 " fooify(a);" |
22071 " fooify(b);" | 22071 " fooify(b);" |
22072 "}"; | 22072 "}"; |
22073 #endif | 22073 #endif |
22074 | 22074 |
22075 | 22075 |
22076 static void StubCacheHelper(bool primary) { | 22076 static void StubCacheHelper(bool primary) { |
22077 #ifdef DEBUG | 22077 #ifdef ENABLE_DISASSEMBLER |
22078 i::FLAG_native_code_counters = true; | 22078 i::FLAG_native_code_counters = true; |
22079 if (primary) { | 22079 if (primary) { |
22080 i::FLAG_test_primary_stub_cache = true; | 22080 i::FLAG_test_primary_stub_cache = true; |
22081 } else { | 22081 } else { |
22082 i::FLAG_test_secondary_stub_cache = true; | 22082 i::FLAG_test_secondary_stub_cache = true; |
22083 } | 22083 } |
22084 i::FLAG_crankshaft = false; | 22084 i::FLAG_crankshaft = false; |
22085 LocalContext env; | 22085 LocalContext env; |
22086 env->GetIsolate()->SetCounterFunction(LookupCounter); | 22086 env->GetIsolate()->SetCounterFunction(LookupCounter); |
22087 v8::HandleScope scope(env->GetIsolate()); | 22087 v8::HandleScope scope(env->GetIsolate()); |
(...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24564 | 24564 |
24565 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)"); | 24565 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)"); |
24566 CHECK(result->Equals(proto2)); | 24566 CHECK(result->Equals(proto2)); |
24567 | 24567 |
24568 result = CompileRun( | 24568 result = CompileRun( |
24569 "function f() { return %_GetPrototype(object); }" | 24569 "function f() { return %_GetPrototype(object); }" |
24570 "%OptimizeFunctionOnNextCall(f);" | 24570 "%OptimizeFunctionOnNextCall(f);" |
24571 "f()"); | 24571 "f()"); |
24572 CHECK(result->Equals(proto2)); | 24572 CHECK(result->Equals(proto2)); |
24573 } | 24573 } |
OLD | NEW |