OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 CHECK_EQ(count_before, count_after); | 236 CHECK_EQ(count_before, count_after); |
237 } | 237 } |
238 | 238 |
239 static v8::Handle<Value> CheckAccessorArgsCorrect(Local<String> name, | 239 static v8::Handle<Value> CheckAccessorArgsCorrect(Local<String> name, |
240 const AccessorInfo& info) { | 240 const AccessorInfo& info) { |
241 CHECK(info.This() == info.Holder()); | 241 CHECK(info.This() == info.Holder()); |
242 CHECK(info.Data()->Equals(v8::String::New("data"))); | 242 CHECK(info.Data()->Equals(v8::String::New("data"))); |
243 ApiTestFuzzer::Fuzz(); | 243 ApiTestFuzzer::Fuzz(); |
244 CHECK(info.This() == info.Holder()); | 244 CHECK(info.This() == info.Holder()); |
245 CHECK(info.Data()->Equals(v8::String::New("data"))); | 245 CHECK(info.Data()->Equals(v8::String::New("data"))); |
246 i::Heap::CollectAllGarbage(true); | 246 i::Heap::CollectAllGarbage(i::Heap::kForceCompactionMask); |
247 CHECK(info.This() == info.Holder()); | 247 CHECK(info.This() == info.Holder()); |
248 CHECK(info.Data()->Equals(v8::String::New("data"))); | 248 CHECK(info.Data()->Equals(v8::String::New("data"))); |
249 return v8::Integer::New(17); | 249 return v8::Integer::New(17); |
250 } | 250 } |
251 | 251 |
252 THREADED_TEST(DirectCall) { | 252 THREADED_TEST(DirectCall) { |
253 v8::HandleScope scope; | 253 v8::HandleScope scope; |
254 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 254 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
255 obj->SetAccessor(v8_str("xxx"), | 255 obj->SetAccessor(v8_str("xxx"), |
256 CheckAccessorArgsCorrect, | 256 CheckAccessorArgsCorrect, |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 obj->SetAccessor(v8_str("xxx"), AllocateHandles); | 441 obj->SetAccessor(v8_str("xxx"), AllocateHandles); |
442 LocalContext env; | 442 LocalContext env; |
443 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 443 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
444 v8::Handle<v8::Value> result = Script::Compile(String::New( | 444 v8::Handle<v8::Value> result = Script::Compile(String::New( |
445 "var result;" | 445 "var result;" |
446 "for (var i = 0; i < 4; i++)" | 446 "for (var i = 0; i < 4; i++)" |
447 " result = obj.xxx;" | 447 " result = obj.xxx;" |
448 "result;"))->Run(); | 448 "result;"))->Run(); |
449 CHECK_EQ(100, result->Int32Value()); | 449 CHECK_EQ(100, result->Int32Value()); |
450 } | 450 } |
OLD | NEW |