Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: test/cctest/test-deoptimization.cc

Issue 1423723002: Map v8::Function to JSReceiver + IsCallable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // handle callbacks are processed. 110 // handle callbacks are processed.
111 static void NonIncrementalGC(i::Isolate* isolate) { 111 static void NonIncrementalGC(i::Isolate* isolate) {
112 isolate->heap()->CollectAllGarbage(); 112 isolate->heap()->CollectAllGarbage();
113 } 113 }
114 114
115 115
116 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, 116 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj,
117 const char* property_name) { 117 const char* property_name) {
118 v8::Local<v8::Function> fun = 118 v8::Local<v8::Function> fun =
119 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); 119 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name)));
120 return v8::Utils::OpenHandle(*fun); 120 return i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*fun));
121 } 121 }
122 122
123 123
124 TEST(DeoptimizeSimple) { 124 TEST(DeoptimizeSimple) {
125 LocalContext env; 125 LocalContext env;
126 v8::HandleScope scope(env->GetIsolate()); 126 v8::HandleScope scope(env->GetIsolate());
127 127
128 // Test lazy deoptimization of a simple function. 128 // Test lazy deoptimization of a simple function.
129 { 129 {
130 AlwaysOptimizeAllowNativesSyntaxNoInlining options; 130 AlwaysOptimizeAllowNativesSyntaxNoInlining options;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized()); 791 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized());
792 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized()); 792 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized());
793 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized()); 793 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized());
794 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); 794 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
795 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 795 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
796 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); 796 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
797 } 797 }
798 isolate->Exit(); 798 isolate->Exit();
799 isolate->Dispose(); 799 isolate->Dispose();
800 } 800 }
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698