OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 .FromJust(); | 363 .FromJust(); |
364 CompileRun("Obj.prototype.method1.toString();"); | 364 CompileRun("Obj.prototype.method1.toString();"); |
365 | 365 |
366 logger->LogCompiledFunctions(); | 366 logger->LogCompiledFunctions(); |
367 | 367 |
368 bool exists = false; | 368 bool exists = false; |
369 i::Vector<const char> log( | 369 i::Vector<const char> log( |
370 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); | 370 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); |
371 CHECK(exists); | 371 CHECK(exists); |
372 | 372 |
| 373 Address ObjMethod1_entry = reinterpret_cast<Address>(ObjMethod1); |
| 374 #if USES_FUNCTION_DESCRIPTORS |
| 375 ObjMethod1_entry = *FUNCTION_ENTRYPOINT_ADDRESS(ObjMethod1_entry); |
| 376 #endif |
373 i::EmbeddedVector<char, 100> ref_data; | 377 i::EmbeddedVector<char, 100> ref_data; |
374 i::SNPrintF(ref_data, | 378 i::SNPrintF(ref_data, |
375 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"method1\"", | 379 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"method1\"", |
376 reinterpret_cast<intptr_t>(ObjMethod1)); | 380 reinterpret_cast<intptr_t>(ObjMethod1_entry)); |
377 | 381 |
378 CHECK(StrNStr(log.start(), ref_data.start(), log.length())); | 382 CHECK(StrNStr(log.start(), ref_data.start(), log.length())); |
379 log.Dispose(); | 383 log.Dispose(); |
380 } | 384 } |
381 isolate->Dispose(); | 385 isolate->Dispose(); |
382 } | 386 } |
383 | 387 |
384 | 388 |
385 static void Prop1Getter(v8::Local<v8::String> property, | 389 static void Prop1Getter(v8::Local<v8::String> property, |
386 const v8::PropertyCallbackInfo<v8::Value>& info) { | 390 const v8::PropertyCallbackInfo<v8::Value>& info) { |
(...skipping 25 matching lines...) Expand all Loading... |
412 inst->SetAccessor(v8_str("prop1"), Prop1Getter, Prop1Setter); | 416 inst->SetAccessor(v8_str("prop1"), Prop1Getter, Prop1Setter); |
413 inst->SetAccessor(v8_str("prop2"), Prop2Getter); | 417 inst->SetAccessor(v8_str("prop2"), Prop2Getter); |
414 | 418 |
415 logger->LogAccessorCallbacks(); | 419 logger->LogAccessorCallbacks(); |
416 | 420 |
417 bool exists = false; | 421 bool exists = false; |
418 i::Vector<const char> log( | 422 i::Vector<const char> log( |
419 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); | 423 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); |
420 CHECK(exists); | 424 CHECK(exists); |
421 | 425 |
| 426 Address Prop1Getter_entry = reinterpret_cast<Address>(Prop1Getter); |
| 427 #if USES_FUNCTION_DESCRIPTORS |
| 428 Prop1Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Getter_entry); |
| 429 #endif |
422 EmbeddedVector<char, 100> prop1_getter_record; | 430 EmbeddedVector<char, 100> prop1_getter_record; |
423 i::SNPrintF(prop1_getter_record, | 431 i::SNPrintF(prop1_getter_record, |
424 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop1\"", | 432 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop1\"", |
425 reinterpret_cast<intptr_t>(Prop1Getter)); | 433 reinterpret_cast<intptr_t>(Prop1Getter_entry)); |
426 CHECK(StrNStr(log.start(), prop1_getter_record.start(), log.length())); | 434 CHECK(StrNStr(log.start(), prop1_getter_record.start(), log.length())); |
427 | 435 |
| 436 Address Prop1Setter_entry = reinterpret_cast<Address>(Prop1Setter); |
| 437 #if USES_FUNCTION_DESCRIPTORS |
| 438 Prop1Setter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Setter_entry); |
| 439 #endif |
428 EmbeddedVector<char, 100> prop1_setter_record; | 440 EmbeddedVector<char, 100> prop1_setter_record; |
429 i::SNPrintF(prop1_setter_record, | 441 i::SNPrintF(prop1_setter_record, |
430 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"set prop1\"", | 442 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"set prop1\"", |
431 reinterpret_cast<intptr_t>(Prop1Setter)); | 443 reinterpret_cast<intptr_t>(Prop1Setter_entry)); |
432 CHECK(StrNStr(log.start(), prop1_setter_record.start(), log.length())); | 444 CHECK(StrNStr(log.start(), prop1_setter_record.start(), log.length())); |
433 | 445 |
| 446 Address Prop2Getter_entry = reinterpret_cast<Address>(Prop2Getter); |
| 447 #if USES_FUNCTION_DESCRIPTORS |
| 448 Prop2Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop2Getter_entry); |
| 449 #endif |
434 EmbeddedVector<char, 100> prop2_getter_record; | 450 EmbeddedVector<char, 100> prop2_getter_record; |
435 i::SNPrintF(prop2_getter_record, | 451 i::SNPrintF(prop2_getter_record, |
436 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop2\"", | 452 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop2\"", |
437 reinterpret_cast<intptr_t>(Prop2Getter)); | 453 reinterpret_cast<intptr_t>(Prop2Getter_entry)); |
438 CHECK(StrNStr(log.start(), prop2_getter_record.start(), log.length())); | 454 CHECK(StrNStr(log.start(), prop2_getter_record.start(), log.length())); |
439 log.Dispose(); | 455 log.Dispose(); |
440 } | 456 } |
441 isolate->Dispose(); | 457 isolate->Dispose(); |
442 } | 458 } |
443 | 459 |
444 | 460 |
445 typedef i::NativesCollection<i::TEST> TestSources; | 461 typedef i::NativesCollection<i::TEST> TestSources; |
446 | 462 |
447 | 463 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" | 609 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" |
594 "(){})();"; | 610 "(){})();"; |
595 | 611 |
596 CompileRun(source_text); | 612 CompileRun(source_text); |
597 | 613 |
598 // Must not crash. | 614 // Must not crash. |
599 logger->LogCompiledFunctions(); | 615 logger->LogCompiledFunctions(); |
600 } | 616 } |
601 isolate->Dispose(); | 617 isolate->Dispose(); |
602 } | 618 } |
OLD | NEW |