| 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 21907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21918 class ApiCallOptimizationChecker { | 21918 class ApiCallOptimizationChecker { |
| 21919 private: | 21919 private: |
| 21920 static Local<Object> data; | 21920 static Local<Object> data; |
| 21921 static Local<Object> receiver; | 21921 static Local<Object> receiver; |
| 21922 static Local<Object> holder; | 21922 static Local<Object> holder; |
| 21923 static Local<Object> callee; | 21923 static Local<Object> callee; |
| 21924 static int count; | 21924 static int count; |
| 21925 | 21925 |
| 21926 static void OptimizationCallback( | 21926 static void OptimizationCallback( |
| 21927 const v8::FunctionCallbackInfo<v8::Value>& info) { | 21927 const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 21928 ApiTestFuzzer::Fuzz(); | |
| 21929 CHECK(callee == info.Callee()); | 21928 CHECK(callee == info.Callee()); |
| 21930 CHECK(data == info.Data()); | 21929 CHECK(data == info.Data()); |
| 21931 CHECK(receiver == info.This()); | 21930 CHECK(receiver == info.This()); |
| 21932 if (info.Length() == 1) { | 21931 if (info.Length() == 1) { |
| 21933 CHECK_EQ(v8_num(1), info[0]); | 21932 CHECK_EQ(v8_num(1), info[0]); |
| 21934 } | 21933 } |
| 21935 CHECK(holder == info.Holder()); | 21934 CHECK(holder == info.Holder()); |
| 21936 count++; | 21935 count++; |
| 21937 info.GetReturnValue().Set(v8_str("returned")); | 21936 info.GetReturnValue().Set(v8_str("returned")); |
| 21938 } | 21937 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22110 Local<Object> ApiCallOptimizationChecker::holder; | 22109 Local<Object> ApiCallOptimizationChecker::holder; |
| 22111 Local<Object> ApiCallOptimizationChecker::callee; | 22110 Local<Object> ApiCallOptimizationChecker::callee; |
| 22112 int ApiCallOptimizationChecker::count = 0; | 22111 int ApiCallOptimizationChecker::count = 0; |
| 22113 | 22112 |
| 22114 | 22113 |
| 22115 TEST(TestFunctionCallOptimization) { | 22114 TEST(TestFunctionCallOptimization) { |
| 22116 i::FLAG_allow_natives_syntax = true; | 22115 i::FLAG_allow_natives_syntax = true; |
| 22117 ApiCallOptimizationChecker checker; | 22116 ApiCallOptimizationChecker checker; |
| 22118 checker.RunAll(); | 22117 checker.RunAll(); |
| 22119 } | 22118 } |
| OLD | NEW |