Chromium Code Reviews| Index: test/cctest/test-heap-profiler.cc |
| diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
| index 59e7b8f25498896a962ae736a1af8a335cdc21ba..22e0080987c92cd44017231539ecc10031a3e02f 100644 |
| --- a/test/cctest/test-heap-profiler.cc |
| +++ b/test/cctest/test-heap-profiler.cc |
| @@ -1191,9 +1191,10 @@ class GraphWithImplicitRefs { |
| explicit GraphWithImplicitRefs(LocalContext* env) { |
| CHECK_EQ(NULL, instance_); |
| instance_ = this; |
| - v8::Isolate* isolate = (*env)->GetIsolate(); |
| + isolate_ = (*env)->GetIsolate(); |
| for (int i = 0; i < kObjectsCount; i++) { |
| - objects_[i] = v8::Persistent<v8::Object>::New(isolate, v8::Object::New()); |
| + objects_[i] = |
| + v8::Persistent<v8::Object>::New(isolate_, v8::Object::New()); |
| } |
| (*env)->Global()->Set(v8_str("root_object"), objects_[0]); |
| } |
| @@ -1208,15 +1209,18 @@ class GraphWithImplicitRefs { |
| private: |
| void AddImplicitReferences() { |
| // 0 -> 1 |
| - v8::V8::AddImplicitReferences( |
| - v8::Persistent<v8::Object>::Cast(objects_[0]), &objects_[1], 1); |
| - // Adding two more references(note length=2 in params): 1 -> 2, 1 -> 3 |
| - v8::V8::AddImplicitReferences( |
| - v8::Persistent<v8::Object>::Cast(objects_[1]), &objects_[2], 2); |
| + isolate_->SetReference(v8::Persistent<v8::Object>::Cast(objects_[0]), |
|
yurys
2013/04/24 14:21:24
Can you also add a test for the references provide
marja
2013/04/24 14:33:53
Offline discussion: references from an one-object
|
| + v8::Persistent<v8::Object>::Cast(objects_[1])); |
| + // Adding two more references: 1 -> 2, 1 -> 3 |
| + isolate_->SetReference(v8::Persistent<v8::Object>::Cast(objects_[1]), |
| + v8::Persistent<v8::Object>::Cast(objects_[2])); |
| + isolate_->SetReference(v8::Persistent<v8::Object>::Cast(objects_[1]), |
| + v8::Persistent<v8::Object>::Cast(objects_[3])); |
| } |
| v8::Persistent<v8::Value> objects_[kObjectsCount]; |
| static GraphWithImplicitRefs* instance_; |
| + v8::Isolate* isolate_; |
| }; |
| GraphWithImplicitRefs* GraphWithImplicitRefs::instance_ = NULL; |