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

Unified Diff: src/property.h

Issue 8341009: Make the GC aware of JSReceiver pointers in LookupResults. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Inlined LookupResult constructor and destructor. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profile-generator.cc ('k') | src/property.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property.h
diff --git a/src/property.h b/src/property.h
index ee2e8c844eaf29c6b8441f1eab0376b85bbffcc5..ffea41e66688ae46af057dc51736f0bad54384c1 100644
--- a/src/property.h
+++ b/src/property.h
@@ -164,10 +164,20 @@ class CallbacksDescriptor: public Descriptor {
class LookupResult BASE_EMBEDDED {
public:
- LookupResult()
- : lookup_type_(NOT_FOUND),
+ explicit LookupResult(Isolate* isolate)
+ : isolate_(isolate),
+ next_(isolate->top_lookup_result()),
+ lookup_type_(NOT_FOUND),
+ holder_(NULL),
cacheable_(true),
- details_(NONE, NORMAL) {}
+ details_(NONE, NORMAL) {
+ isolate->SetTopLookupResult(this);
+ }
+
+ ~LookupResult() {
+ ASSERT(isolate_->top_lookup_result() == this);
+ isolate_->SetTopLookupResult(next_);
+ }
void DescriptorResult(JSObject* holder, PropertyDetails details, int number) {
lookup_type_ = DESCRIPTOR_TYPE;
@@ -215,6 +225,7 @@ class LookupResult BASE_EMBEDDED {
void NotFound() {
lookup_type_ = NOT_FOUND;
+ holder_ = NULL;
}
JSObject* holder() {
@@ -346,7 +357,12 @@ class LookupResult BASE_EMBEDDED {
return holder()->GetNormalizedProperty(this);
}
+ void Iterate(ObjectVisitor* visitor);
+
private:
+ Isolate* isolate_;
+ LookupResult* next_;
+
// Where did we find the result;
enum {
NOT_FOUND,
« no previous file with comments | « src/profile-generator.cc ('k') | src/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698