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 7734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7745 | 7745 |
7746 | 7746 |
7747 v8::Local<Function> args_fun; | 7747 v8::Local<Function> args_fun; |
7748 | 7748 |
7749 | 7749 |
7750 static void ArgumentsTestCallback( | 7750 static void ArgumentsTestCallback( |
7751 const v8::FunctionCallbackInfo<v8::Value>& args) { | 7751 const v8::FunctionCallbackInfo<v8::Value>& args) { |
7752 ApiTestFuzzer::Fuzz(); | 7752 ApiTestFuzzer::Fuzz(); |
7753 v8::Isolate* isolate = args.GetIsolate(); | 7753 v8::Isolate* isolate = args.GetIsolate(); |
7754 Local<Context> context = isolate->GetCurrentContext(); | 7754 Local<Context> context = isolate->GetCurrentContext(); |
7755 CHECK(args_fun->Equals(context, args.Callee()).FromJust()); | |
7756 CHECK_EQ(3, args.Length()); | 7755 CHECK_EQ(3, args.Length()); |
7757 CHECK(v8::Integer::New(isolate, 1)->Equals(context, args[0]).FromJust()); | 7756 CHECK(v8::Integer::New(isolate, 1)->Equals(context, args[0]).FromJust()); |
7758 CHECK(v8::Integer::New(isolate, 2)->Equals(context, args[1]).FromJust()); | 7757 CHECK(v8::Integer::New(isolate, 2)->Equals(context, args[1]).FromJust()); |
7759 CHECK(v8::Integer::New(isolate, 3)->Equals(context, args[2]).FromJust()); | 7758 CHECK(v8::Integer::New(isolate, 3)->Equals(context, args[2]).FromJust()); |
7760 CHECK(v8::Undefined(isolate)->Equals(context, args[3]).FromJust()); | 7759 CHECK(v8::Undefined(isolate)->Equals(context, args[3]).FromJust()); |
7761 v8::HandleScope scope(args.GetIsolate()); | 7760 v8::HandleScope scope(args.GetIsolate()); |
7762 CcTest::heap()->CollectAllGarbage(); | 7761 CcTest::heap()->CollectAllGarbage(); |
7763 } | 7762 } |
7764 | 7763 |
7765 | 7764 |
(...skipping 13696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21462 class ApiCallOptimizationChecker { | 21461 class ApiCallOptimizationChecker { |
21463 private: | 21462 private: |
21464 static Local<Object> data; | 21463 static Local<Object> data; |
21465 static Local<Object> receiver; | 21464 static Local<Object> receiver; |
21466 static Local<Object> holder; | 21465 static Local<Object> holder; |
21467 static Local<Object> callee; | 21466 static Local<Object> callee; |
21468 static int count; | 21467 static int count; |
21469 | 21468 |
21470 static void OptimizationCallback( | 21469 static void OptimizationCallback( |
21471 const v8::FunctionCallbackInfo<v8::Value>& info) { | 21470 const v8::FunctionCallbackInfo<v8::Value>& info) { |
21472 CHECK(callee == info.Callee()); | |
21473 CHECK(data == info.Data()); | 21471 CHECK(data == info.Data()); |
21474 CHECK(receiver == info.This()); | 21472 CHECK(receiver == info.This()); |
21475 if (info.Length() == 1) { | 21473 if (info.Length() == 1) { |
21476 CHECK(v8_num(1)->Equals(info[0])); | 21474 CHECK(v8_num(1)->Equals(info[0])); |
21477 } | 21475 } |
21478 CHECK(holder == info.Holder()); | 21476 CHECK(holder == info.Holder()); |
21479 count++; | 21477 count++; |
21480 info.GetReturnValue().Set(v8_str("returned")); | 21478 info.GetReturnValue().Set(v8_str("returned")); |
21481 } | 21479 } |
21482 | 21480 |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23825 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); | 23823 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); |
23826 ExpectString("typeof obj2.values", "function"); | 23824 ExpectString("typeof obj2.values", "function"); |
23827 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); | 23825 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); |
23828 | 23826 |
23829 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); | 23827 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); |
23830 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); | 23828 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); |
23831 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); | 23829 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); |
23832 CHECK_EQ(fn2->GetCreationContext(), *ctx2); | 23830 CHECK_EQ(fn2->GetCreationContext(), *ctx2); |
23833 } | 23831 } |
23834 } | 23832 } |
OLD | NEW |