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

Side by Side Diff: src/objects.cc

Issue 8491041: Fix missing fast property accessors in heap snapshots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments addressed Created 9 years, 1 month 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 case EXTERNAL_DOUBLE_ELEMENTS: 96 case EXTERNAL_DOUBLE_ELEMENTS:
97 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS"); 97 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS");
98 break; 98 break;
99 case EXTERNAL_PIXEL_ELEMENTS: 99 case EXTERNAL_PIXEL_ELEMENTS:
100 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS"); 100 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS");
101 break; 101 break;
102 } 102 }
103 } 103 }
104 104
105 105
106 // Getters and setters are stored in a fixed array property. These are
107 // constants for their indices.
108 const int kGetterIndex = 0;
109 const int kSetterIndex = 1;
110
111 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor, 106 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor,
112 Object* value) { 107 Object* value) {
113 Object* result; 108 Object* result;
114 { MaybeObject* maybe_result = 109 { MaybeObject* maybe_result =
115 constructor->GetHeap()->AllocateJSObject(constructor); 110 constructor->GetHeap()->AllocateJSObject(constructor);
116 if (!maybe_result->ToObject(&result)) return maybe_result; 111 if (!maybe_result->ToObject(&result)) return maybe_result;
117 } 112 }
118 JSValue::cast(result)->set_value(value); 113 JSValue::cast(result)->set_value(value);
119 return result; 114 return result;
120 } 115 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 196
202 MaybeObject* Object::GetPropertyWithReceiver(Object* receiver, 197 MaybeObject* Object::GetPropertyWithReceiver(Object* receiver,
203 String* name, 198 String* name,
204 PropertyAttributes* attributes) { 199 PropertyAttributes* attributes) {
205 LookupResult result(name->GetIsolate()); 200 LookupResult result(name->GetIsolate());
206 Lookup(name, &result); 201 Lookup(name, &result);
207 MaybeObject* value = GetProperty(receiver, &result, name, attributes); 202 MaybeObject* value = GetProperty(receiver, &result, name, attributes);
208 ASSERT(*attributes <= ABSENT); 203 ASSERT(*attributes <= ABSENT);
209 return value; 204 return value;
210 } 205 }
211 206
mnaganov (inactive) 2011/11/14 10:22:38 nit: V8 style prescribes to have 2 empty lines bet
212
213 MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver, 207 MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver,
214 Object* structure, 208 Object* structure,
215 String* name) { 209 String* name) {
216 Isolate* isolate = name->GetIsolate(); 210 Isolate* isolate = name->GetIsolate();
217 // To accommodate both the old and the new api we switch on the 211 // To accommodate both the old and the new api we switch on the
218 // data structure used to store the callbacks. Eventually foreign 212 // data structure used to store the callbacks. Eventually foreign
219 // callbacks should be phased out. 213 // callbacks should be phased out.
220 if (structure->IsForeign()) { 214 if (structure->IsForeign()) {
221 AccessorDescriptor* callback = 215 AccessorDescriptor* callback =
222 reinterpret_cast<AccessorDescriptor*>( 216 reinterpret_cast<AccessorDescriptor*>(
(...skipping 12299 matching lines...) Expand 10 before | Expand all | Expand 10 after
12522 if (break_point_objects()->IsUndefined()) return 0; 12516 if (break_point_objects()->IsUndefined()) return 0;
12523 // Single break point. 12517 // Single break point.
12524 if (!break_point_objects()->IsFixedArray()) return 1; 12518 if (!break_point_objects()->IsFixedArray()) return 1;
12525 // Multiple break points. 12519 // Multiple break points.
12526 return FixedArray::cast(break_point_objects())->length(); 12520 return FixedArray::cast(break_point_objects())->length();
12527 } 12521 }
12528 #endif // ENABLE_DEBUGGER_SUPPORT 12522 #endif // ENABLE_DEBUGGER_SUPPORT
12529 12523
12530 12524
12531 } } // namespace v8::internal 12525 } } // namespace v8::internal
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | src/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698