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

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

Issue 536065: Optimized calling of C++ builtins (and HandleApiCall (Closed)
Patch Set: Created 10 years, 11 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 | « src/x64/builtins-x64.cc ('k') | test/cctest/test-serialize.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 2007-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-2009 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 4877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4888 value = CompileRun(apply_99); 4888 value = CompileRun(apply_99);
4889 CHECK(!try_catch.HasCaught()); 4889 CHECK(!try_catch.HasCaught());
4890 CHECK_EQ(99, value->Int32Value()); 4890 CHECK_EQ(99, value->Int32Value());
4891 4891
4892 const char* call_17 = "Function.prototype.call.call(obj, this, 17)"; 4892 const char* call_17 = "Function.prototype.call.call(obj, this, 17)";
4893 value = CompileRun(call_17); 4893 value = CompileRun(call_17);
4894 CHECK(!try_catch.HasCaught()); 4894 CHECK(!try_catch.HasCaught());
4895 CHECK_EQ(17, value->Int32Value()); 4895 CHECK_EQ(17, value->Int32Value());
4896 4896
4897 // Check that the call-as-function handler can be called through 4897 // Check that the call-as-function handler can be called through
4898 // new. Currently, there is no way to check in the call-as-function 4898 // new.
4899 // handler if it has been called through new or not.
4900 value = CompileRun("new obj(43)"); 4899 value = CompileRun("new obj(43)");
4901 CHECK(!try_catch.HasCaught()); 4900 CHECK(!try_catch.HasCaught());
4902 CHECK_EQ(-43, value->Int32Value()); 4901 CHECK_EQ(-43, value->Int32Value());
4903 } 4902 }
4904 4903
4905 4904
4906 static int CountHandles() { 4905 static int CountHandles() {
4907 return v8::HandleScope::NumberOfHandles(); 4906 return v8::HandleScope::NumberOfHandles();
4908 } 4907 }
4909 4908
(...skipping 3750 matching lines...) Expand 10 before | Expand all | Expand 10 after
8660 CompileRun(source_exception); 8659 CompileRun(source_exception);
8661 other_context->Exit(); 8660 other_context->Exit();
8662 v8::internal::Heap::CollectAllGarbage(false); 8661 v8::internal::Heap::CollectAllGarbage(false);
8663 if (GetGlobalObjectsCount() == 1) break; 8662 if (GetGlobalObjectsCount() == 1) break;
8664 } 8663 }
8665 CHECK_GE(2, gc_count); 8664 CHECK_GE(2, gc_count);
8666 CHECK_EQ(1, GetGlobalObjectsCount()); 8665 CHECK_EQ(1, GetGlobalObjectsCount());
8667 8666
8668 other_context.Dispose(); 8667 other_context.Dispose();
8669 } 8668 }
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698