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

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

Issue 15974006: Transforming PersistentHandleVisitor to not need to copy Persistent handles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17767 matching lines...) Expand 10 before | Expand all | Expand 10 after
17778 "})()", 17778 "})()",
17779 "ReferenceError: cell is not defined"); 17779 "ReferenceError: cell is not defined");
17780 } 17780 }
17781 17781
17782 17782
17783 class Visitor42 : public v8::PersistentHandleVisitor { 17783 class Visitor42 : public v8::PersistentHandleVisitor {
17784 public: 17784 public:
17785 explicit Visitor42(v8::Persistent<v8::Object> object) 17785 explicit Visitor42(v8::Persistent<v8::Object> object)
17786 : counter_(0), object_(object) { } 17786 : counter_(0), object_(object) { }
17787 17787
17788 #ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS
17788 virtual void VisitPersistentHandle(Persistent<Value> value, 17789 virtual void VisitPersistentHandle(Persistent<Value> value,
17789 uint16_t class_id) { 17790 uint16_t class_id) {
17791 VisitPersistentHandle(&value, class_id);
17792 }
17793 #endif
17794
17795 virtual void VisitPersistentHandle(Persistent<Value>* value,
17796 uint16_t class_id) {
17790 if (class_id == 42) { 17797 if (class_id == 42) {
17791 CHECK(value->IsObject()); 17798 CHECK((*value)->IsObject());
17792 v8::Persistent<v8::Object> visited = 17799 v8::Persistent<v8::Object> visited =
17793 v8::Persistent<v8::Object>::Cast(value); 17800 v8::Persistent<v8::Object>::Cast(*value);
17794 CHECK_EQ(42, visited.WrapperClassId(v8::Isolate::GetCurrent())); 17801 CHECK_EQ(42, visited.WrapperClassId(v8::Isolate::GetCurrent()));
17795 CHECK_EQ(Handle<Value>(*object_), Handle<Value>(*visited)); 17802 CHECK_EQ(Handle<Value>(*object_), Handle<Value>(*visited));
17796 ++counter_; 17803 ++counter_;
17797 } 17804 }
17798 } 17805 }
17799 17806
17800 int counter_; 17807 int counter_;
17801 v8::Persistent<v8::Object> object_; 17808 v8::Persistent<v8::Object> object_;
17802 }; 17809 };
17803 17810
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
19342 i::Semaphore* sem_; 19349 i::Semaphore* sem_;
19343 volatile int sem_value_; 19350 volatile int sem_value_;
19344 }; 19351 };
19345 19352
19346 19353
19347 THREADED_TEST(SemaphoreInterruption) { 19354 THREADED_TEST(SemaphoreInterruption) {
19348 ThreadInterruptTest().RunTest(); 19355 ThreadInterruptTest().RunTest();
19349 } 19356 }
19350 19357
19351 #endif // WIN32 19358 #endif // WIN32
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698