| OLD | NEW |
| 1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 i::FLAG_allow_natives_syntax = allow_natives_syntax_; | 90 i::FLAG_allow_natives_syntax = allow_natives_syntax_; |
| 91 i::FLAG_use_inlining = use_inlining_; | 91 i::FLAG_use_inlining = use_inlining_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 bool allow_natives_syntax_; | 95 bool allow_natives_syntax_; |
| 96 bool use_inlining_; | 96 bool use_inlining_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 | 99 |
| 100 Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, | 100 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, |
| 101 const char* property_name) { | 101 const char* property_name) { |
| 102 v8::Local<v8::Function> fun = | 102 v8::Local<v8::Function> fun = |
| 103 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); | 103 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); |
| 104 return v8::Utils::OpenHandle(*fun); | 104 return v8::Utils::OpenHandle(*fun); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 TEST(DeoptimizeSimple) { | 108 TEST(DeoptimizeSimple) { |
| 109 v8::HandleScope scope; | 109 v8::HandleScope scope; |
| 110 const char* extension_list[] = { "v8/gc" }; | 110 const char* extension_list[] = { "v8/gc" }; |
| 111 v8::ExtensionConfiguration extensions(1, extension_list); | 111 v8::ExtensionConfiguration extensions(1, extension_list); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 } | 706 } |
| 707 | 707 |
| 708 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized()); | 708 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized()); |
| 709 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized()); | 709 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized()); |
| 710 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized()); | 710 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized()); |
| 711 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); | 711 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); |
| 712 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); | 712 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); |
| 713 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); | 713 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); |
| 714 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current())); | 714 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current())); |
| 715 } | 715 } |
| OLD | NEW |