// Get the elements kind and case on that.
__ cmp(r2, Operand(undefined_sentinel));
__ b(eq, &no_info);
- __ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
+ __ ldr(r3, FieldMemOperand(r2, PropertyCell::kValueOffset));
__ JumpIfNotSmi(r3, &no_info);
__ SmiUntag(r3);
__ jmp(&switch_ready);
PredictableCodeSizeScope predictable(masm_, 5 * Assembler::kInstrSize);
Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value());
__ mov(ip, Operand(Handle<Object>(cell)));
- __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
+ __ ldr(ip, FieldMemOperand(ip, PropertyCell::kValueOffset));
__ cmp(map, Operand(ip));
__ b(ne, &cache_miss);
// We use Factory::the_hole_value() on purpose instead of loading from the
AllowDeferredHandleDereference smi_check;
if (isolate()->heap()->InNewSpace(*target)) {
Register reg = ToRegister(instr->value());
- Handle<Cell> cell = isolate()->factory()->NewJSGlobalPropertyCell(target);
+ Handle<Cell> cell = isolate()->factory()->NewPropertyCell(target);
__ mov(ip, Operand(Handle<Object>(cell)));
__ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset));
__ cmp(reg, ip);
Handle<Code> CallStubCompiler::CompileCallGlobal(
Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function,
Handle<Name> name) {
// ----------- S t a t e -------------
Handle<Code> StoreStubCompiler::CompileStoreGlobal(
Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name) {
Label miss;
Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<JSObject> object,
Handle<GlobalObject> global,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name,
bool is_dont_delete) {
Label success, miss;
Handle<Object> value = Handle<Object>(properties->ValueAt(i),
isolate());
ASSERT(!value->IsCell());
- if (value->IsJSGlobalPropertyCell()) {
- value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value(),
+ if (value->IsPropertyCell()) {
+ value = Handle<Object>(PropertyCell::cast(*value)->value(),
isolate());
}
PropertyDetails details = properties->DetailsAt(i);
}
-Handle<JSGlobalPropertyCell> Factory::NewJSGlobalPropertyCell(
- Handle<Object> value) {
+Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) {
AllowDeferredHandleDereference convert_to_cell;
CALL_HEAP_FUNCTION(
isolate(),
- isolate()->heap()->AllocateJSGlobalPropertyCell(*value),
- JSGlobalPropertyCell);
+ isolate()->heap()->AllocatePropertyCell(*value),
+ PropertyCell);
}
Handle<Cell> NewCell(Handle<Object> value);
- Handle<JSGlobalPropertyCell> NewJSGlobalPropertyCell(
- Handle<Object> value);
+ Handle<PropertyCell> NewPropertyCell(Handle<Object> value);
Handle<Map> NewMap(
InstanceType type,
}
-MaybeObject* Heap::AllocateRawJSGlobalPropertyCell() {
+MaybeObject* Heap::AllocateRawPropertyCell() {
#ifdef DEBUG
isolate_->counters()->objs_since_last_full()->Increment();
isolate_->counters()->objs_since_last_young()->Increment();
#endif
MaybeObject* result =
- property_cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize);
+ property_cell_space_->AllocateRaw(PropertyCell::kSize);
if (result->IsFailure()) old_gen_exhausted_ = true;
return result;
}
default: return "system / Map";
}
case CELL_TYPE: return "system / Cell";
- case PROPERTY_CELL_TYPE: return "system / JSGlobalPropertyCell";
+ case PROPERTY_CELL_TYPE: return "system / PropertyCell";
case FOREIGN_TYPE: return "system / Foreign";
case ODDBALL_TYPE: return "system / Oddball";
#define MAKE_STRUCT_CASE(NAME, Name, name) \
} else if (obj->IsCell()) {
ExtractCellReferences(entry, Cell::cast(obj));
extract_indexed_refs = false;
- } else if (obj->IsJSGlobalPropertyCell()) {
- ExtractJSGlobalPropertyCellReferences(
- entry, JSGlobalPropertyCell::cast(obj));
+ } else if (obj->IsPropertyCell()) {
+ ExtractPropertyCellReferences(
+ entry, PropertyCell::cast(obj));
extract_indexed_refs = false;
}
if (extract_indexed_refs) {
}
-void V8HeapExplorer::ExtractJSGlobalPropertyCellReferences(
- int entry, JSGlobalPropertyCell* cell) {
+void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
+ PropertyCell* cell) {
SetInternalReference(cell, entry, "value", cell->value());
SetInternalReference(cell, entry, "type", cell->type());
}
if (dictionary->IsKey(k)) {
Object* target = dictionary->ValueAt(i);
// We assume that global objects can only have slow properties.
- Object* value = target->IsJSGlobalPropertyCell()
- ? JSGlobalPropertyCell::cast(target)->value()
+ Object* value = target->IsPropertyCell()
+ ? PropertyCell::cast(target)->value()
: target;
if (k != heap_->hidden_string()) {
SetPropertyReference(js_obj, entry, String::cast(k), value);
void ExtractCodeCacheReferences(int entry, CodeCache* code_cache);
void ExtractCodeReferences(int entry, Code* code);
void ExtractCellReferences(int entry, Cell* cell);
- void ExtractJSGlobalPropertyCellReferences(int entry,
- JSGlobalPropertyCell* cell);
+ void ExtractPropertyCellReferences(int entry, PropertyCell* cell);
void ExtractClosureReferences(JSObject* js_obj, int entry);
void ExtractPropertyReferences(JSObject* js_obj, int entry);
void ExtractElementReferences(JSObject* js_obj, int entry);
for (HeapObject* heap_object = js_global_property_cell_iterator.Next();
heap_object != NULL;
heap_object = js_global_property_cell_iterator.Next()) {
- if (heap_object->IsJSGlobalPropertyCell()) {
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object);
+ if (heap_object->IsPropertyCell()) {
+ PropertyCell* cell = PropertyCell::cast(heap_object);
Address value_address = cell->ValueAddress();
scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
Address type_address = cell->TypeAddress();
set_cell_map(Map::cast(obj));
{ MaybeObject* maybe_obj = AllocateMap(PROPERTY_CELL_TYPE,
- JSGlobalPropertyCell::kSize);
+ PropertyCell::kSize);
if (!maybe_obj->ToObject(&obj)) return false;
}
set_global_property_cell_map(Map::cast(obj));
}
-MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) {
+MaybeObject* Heap::AllocatePropertyCell(Object* value) {
Object* result;
- { MaybeObject* maybe_result = AllocateRawJSGlobalPropertyCell();
+ { MaybeObject* maybe_result = AllocateRawPropertyCell();
if (!maybe_result->ToObject(&result)) return maybe_result;
}
HeapObject::cast(result)->set_map_no_write_barrier(
global_property_cell_map());
- JSGlobalPropertyCell::cast(result)->set_value(value);
- JSGlobalPropertyCell::cast(result)->set_type(Type::None());
+ PropertyCell::cast(result)->set_value(value);
+ PropertyCell::cast(result)->set_type(Type::None());
return result;
}
// Make sure no field properties are described in the initial map.
// This guarantees us that normalizing the properties does not
- // require us to change property values to JSGlobalPropertyCells.
+ // require us to change property values to PropertyCells.
ASSERT(map->NextFreePropertyIndex() == 0);
// Make sure we don't have a ton of pre-allocated slots in the
ASSERT(details.type() == CALLBACKS); // Only accessors are expected.
PropertyDetails d = PropertyDetails(details.attributes(), CALLBACKS, i + 1);
Object* value = descs->GetCallbacksObject(i);
- MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value);
+ MaybeObject* maybe_value = AllocatePropertyCell(value);
if (!maybe_value->ToObject(&value)) return maybe_value;
MaybeObject* maybe_added = dictionary->Add(descs->GetKey(i), value, d);
map_space_->ReportStatistics();
PrintF("Cell space : ");
cell_space_->ReportStatistics();
- PrintF("JSGlobalPropertyCell space : ");
+ PrintF("PropertyCell space : ");
property_cell_space_->ReportStatistics();
PrintF("Large object space : ");
lo_space_->ReportStatistics();
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
// failed.
// Please note this does not perform a garbage collection.
- MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value);
+ MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value);
// Allocate Box.
MUST_USE_RESULT MaybeObject* AllocateBox(Object* value,
MUST_USE_RESULT inline MaybeObject* AllocateRawCell();
// Allocate an uninitialized object in the global property cell space.
- MUST_USE_RESULT inline MaybeObject* AllocateRawJSGlobalPropertyCell();
+ MUST_USE_RESULT inline MaybeObject* AllocateRawPropertyCell();
// Initializes a JSObject based on its map.
void InitializeJSObjectFromMap(JSObject* obj,
class HStoreGlobalCell: public HUnaryOperation {
public:
HStoreGlobalCell(HValue* value,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
PropertyDetails details)
: HUnaryOperation(value),
cell_(cell),
SetGVNFlag(kChangesGlobalVars);
}
- Handle<JSGlobalPropertyCell> cell() const { return cell_; }
+ Handle<PropertyCell> cell() const { return cell_; }
bool RequiresHoleCheck() {
return !details_.IsDontDelete() || details_.IsReadOnly();
}
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell)
private:
- Handle<JSGlobalPropertyCell> cell_;
+ Handle<PropertyCell> cell_;
PropertyDetails details_;
};
if (type == kUseCell) {
Handle<GlobalObject> global(current_info()->global_object());
- Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup));
+ Handle<PropertyCell> cell(global->GetPropertyCell(&lookup));
HLoadGlobalCell* instr =
new(zone()) HLoadGlobalCell(cell, lookup.GetPropertyDetails());
return ast_context()->ReturnInstruction(instr, expr->id());
GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true);
if (type == kUseCell) {
Handle<GlobalObject> global(current_info()->global_object());
- Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup));
+ Handle<PropertyCell> cell(global->GetPropertyCell(&lookup));
HInstruction* instr =
new(zone()) HStoreGlobalCell(value, cell, lookup.GetPropertyDetails());
instr->set_position(position);
Label initialize, done;
// Load the cache state into ecx.
- __ mov(ecx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset));
+ __ mov(ecx, FieldOperand(ebx, PropertyCell::kValueOffset));
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
Register value = ToRegister(instr->value());
- Handle<JSGlobalPropertyCell> cell_handle = instr->hydrogen()->cell();
+ Handle<PropertyCell> cell_handle = instr->hydrogen()->cell();
// If the cell we are storing to contains the hole it could have
// been deleted from the property dictionary. In that case, we need
Handle<Name> name,
Register scratch,
Label* miss) {
- Handle<JSGlobalPropertyCell> cell =
+ Handle<PropertyCell> cell =
GlobalObject::EnsurePropertyCell(global, name);
ASSERT(cell->value()->IsTheHole());
Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value();
if (Serializer::enabled()) {
__ mov(scratch, Immediate(cell));
- __ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
+ __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset),
Immediate(the_hole));
} else {
__ cmp(Operand::ForCell(cell), Immediate(the_hole));
Handle<Code> CallStubCompiler::CompileCallGlobal(
Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function,
Handle<Name> name) {
// ----------- S t a t e -------------
Handle<Code> StoreStubCompiler::CompileStoreGlobal(
Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name) {
Label miss;
// Compute the cell operand to use.
__ mov(scratch1(), Immediate(cell));
Operand cell_operand =
- FieldOperand(scratch1(), JSGlobalPropertyCell::kValueOffset);
+ FieldOperand(scratch1(), PropertyCell::kValueOffset);
// Check that the value in the cell is not the hole. If it is, this
// cell could have been deleted and reintroducing the global needs
Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<JSObject> object,
Handle<GlobalObject> global,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name,
bool is_dont_delete) {
Label success, miss;
// Get the value from the cell.
if (Serializer::enabled()) {
__ mov(eax, Immediate(cell));
- __ mov(eax, FieldOperand(eax, JSGlobalPropertyCell::kValueOffset));
+ __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset));
} else {
__ mov(eax, Operand::ForCell(cell));
}
if (holder->IsGlobalObject()) {
Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder);
- Handle<JSGlobalPropertyCell> cell(
+ Handle<PropertyCell> cell(
global->GetPropertyCell(lookup), isolate());
if (!cell->value()->IsJSFunction()) return Handle<Code>::null();
Handle<JSFunction> function(JSFunction::cast(cell->value()));
case NORMAL:
if (holder->IsGlobalObject()) {
Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder);
- Handle<JSGlobalPropertyCell> cell(
+ Handle<PropertyCell> cell(
global->GetPropertyCell(lookup), isolate());
return isolate()->stub_cache()->ComputeLoadGlobal(
name, receiver, global, cell, lookup->IsDontDelete());
// from the property cell. So the property must be directly on the
// global object.
Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
- Handle<JSGlobalPropertyCell> cell(
+ Handle<PropertyCell> cell(
global->GetPropertyCell(lookup), isolate());
return isolate()->stub_cache()->ComputeStoreGlobal(
name, global, cell, strict_mode);
heap()->property_cell_space());
HeapObject* cell;
while ((cell = js_global_property_cell_iterator.Next()) != NULL) {
- ASSERT(cell->IsJSGlobalPropertyCell());
+ ASSERT(cell->IsPropertyCell());
if (IsMarked(cell)) {
- int offset = JSGlobalPropertyCell::kValueOffset;
+ int offset = PropertyCell::kValueOffset;
MarkCompactMarkingVisitor::VisitPointer(
heap(),
reinterpret_cast<Object**>(cell->address() + offset));
- offset = JSGlobalPropertyCell::kTypeOffset;
+ offset = PropertyCell::kTypeOffset;
MarkCompactMarkingVisitor::VisitPointer(
heap(),
reinterpret_cast<Object**>(cell->address() + offset));
for (HeapObject* cell = js_global_property_cell_iterator.Next();
cell != NULL;
cell = js_global_property_cell_iterator.Next()) {
- if (cell->IsJSGlobalPropertyCell()) {
+ if (cell->IsPropertyCell()) {
Address value_address =
reinterpret_cast<Address>(cell) +
- (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag);
+ (PropertyCell::kValueOffset - kHeapObjectTag);
updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
Address type_address =
reinterpret_cast<Address>(cell) +
- (JSGlobalPropertyCell::kTypeOffset - kHeapObjectTag);
+ (PropertyCell::kTypeOffset - kHeapObjectTag);
updating_visitor.VisitPointer(reinterpret_cast<Object**>(type_address));
}
}
Cell::cast(this)->CellVerify();
break;
case PROPERTY_CELL_TYPE:
- JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify();
+ PropertyCell::cast(this)->PropertyCellVerify();
break;
case JS_ARRAY_TYPE:
JSArray::cast(this)->JSArrayVerify();
}
-void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() {
- CHECK(IsJSGlobalPropertyCell());
+void PropertyCell::PropertyCellVerify() {
+ CHECK(IsPropertyCell());
VerifyObjectField(kValueOffset);
VerifyObjectField(kTypeOffset);
}
TYPE_CHECKER(Code, CODE_TYPE)
TYPE_CHECKER(Oddball, ODDBALL_TYPE)
TYPE_CHECKER(Cell, CELL_TYPE)
-TYPE_CHECKER(JSGlobalPropertyCell, PROPERTY_CELL_TYPE)
+TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE)
TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE)
TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE)
TYPE_CHECKER(JSModule, JS_MODULE_TYPE)
void Cell::set_value(Object* val, WriteBarrierMode ignored) {
// The write barrier is not used for global property cells.
- ASSERT(!val->IsJSGlobalPropertyCell() && !val->IsCell());
+ ASSERT(!val->IsPropertyCell() && !val->IsCell());
WRITE_FIELD(this, kValueOffset, val);
}
-Object* JSGlobalPropertyCell::type_raw() {
+Object* PropertyCell::type_raw() {
return READ_FIELD(this, kTypeOffset);
}
-void JSGlobalPropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) {
+void PropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) {
WRITE_FIELD(this, kTypeOffset, val);
}
CAST_ACCESSOR(HeapNumber)
CAST_ACCESSOR(Oddball)
CAST_ACCESSOR(Cell)
-CAST_ACCESSOR(JSGlobalPropertyCell)
+CAST_ACCESSOR(PropertyCell)
CAST_ACCESSOR(SharedFunctionInfo)
CAST_ACCESSOR(Map)
CAST_ACCESSOR(JSFunction)
Cell::cast(this)->CellPrint(out);
break;
case PROPERTY_CELL_TYPE:
- JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out);
+ PropertyCell::cast(this)->PropertyCellPrint(out);
break;
case JS_ARRAY_BUFFER_TYPE:
JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
}
-void JSGlobalPropertyCell::JSGlobalPropertyCellPrint(FILE* out) {
- HeapObject::PrintHeader(out, "JSGlobalPropertyCell");
+void PropertyCell::PropertyCellPrint(FILE* out) {
+ HeapObject::PrintHeader(out, "PropertyCell");
}
table_.Register(kVisitPropertyCell,
&FixedBodyVisitor<StaticVisitor,
- JSGlobalPropertyCell::BodyDescriptor,
+ PropertyCell::BodyDescriptor,
void>::Visit);
table_.template RegisterSpecializations<DataObjectVisitor,
ASSERT(!HasFastProperties());
Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
if (IsGlobalObject()) {
- value = JSGlobalPropertyCell::cast(value)->value();
+ value = PropertyCell::cast(value)->value();
}
- ASSERT(!value->IsJSGlobalPropertyCell() && !value->IsCell());
+ ASSERT(!value->IsPropertyCell() && !value->IsCell());
return value;
}
Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) {
ASSERT(!HasFastProperties());
if (IsGlobalObject()) {
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(
+ PropertyCell* cell = PropertyCell::cast(
property_dictionary()->ValueAt(result->GetDictionaryEntry()));
cell->set_value(value);
} else {
if (IsGlobalObject()) {
Heap* heap = name->GetHeap();
MaybeObject* maybe_store_value =
- heap->AllocateJSGlobalPropertyCell(value);
+ heap->AllocatePropertyCell(value);
if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value;
}
Object* dict;
details.attributes(), details.type(), enumeration_index);
if (IsGlobalObject()) {
- JSGlobalPropertyCell* cell =
- JSGlobalPropertyCell::cast(property_dictionary()->ValueAt(entry));
+ PropertyCell* cell =
+ PropertyCell::cast(property_dictionary()->ValueAt(entry));
cell->set_value(value);
// Please note we have to update the property details.
property_dictionary()->DetailsAtPut(entry, details);
ASSERT(new_map->is_dictionary_map());
set_map(new_map);
}
- JSGlobalPropertyCell* cell =
- JSGlobalPropertyCell::cast(dictionary->ValueAt(entry));
+ PropertyCell* cell = PropertyCell::cast(dictionary->ValueAt(entry));
cell->set_value(cell->GetHeap()->the_hole_value());
dictionary->DetailsAtPut(entry, details.AsDeleted());
} else {
break;
case PROPERTY_CELL_TYPE:
accumulator->Add("PropertyCell for ");
- JSGlobalPropertyCell::cast(this)->value()->ShortPrint(accumulator);
+ PropertyCell::cast(this)->value()->ShortPrint(accumulator);
break;
default:
accumulator->Add("<Other heap object (%d)>", map()->instance_type());
Cell::BodyDescriptor::IterateBody(this, v);
break;
case PROPERTY_CELL_TYPE:
- JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v);
+ PropertyCell::BodyDescriptor::IterateBody(this, v);
break;
case SYMBOL_TYPE:
Symbol::BodyDescriptor::IterateBody(this, v);
int entry = dict->FindEntry(name);
if (entry != NameDictionary::kNotFound) {
store_value = dict->ValueAt(entry);
- JSGlobalPropertyCell::cast(store_value)->set_value(value);
+ PropertyCell::cast(store_value)->set_value(value);
// Assign an enumeration index to the property and update
// SetNextEnumerationIndex.
int index = dict->NextEnumerationIndex();
}
Heap* heap = GetHeap();
{ MaybeObject* maybe_store_value =
- heap->AllocateJSGlobalPropertyCell(value);
+ heap->AllocatePropertyCell(value);
if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value;
}
- JSGlobalPropertyCell::cast(store_value)->set_value(value);
+ PropertyCell::cast(store_value)->set_value(value);
}
PropertyDetails details = PropertyDetails(attributes, NORMAL, 0);
Object* result;
result->NotFound();
return;
}
- value = JSGlobalPropertyCell::cast(value)->value();
+ value = PropertyCell::cast(value)->value();
}
// Make sure to disallow caching for uninitialized constants
// found in the dictionary-mode objects.
}
-JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
+PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
ASSERT(!HasFastProperties());
Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
- return JSGlobalPropertyCell::cast(value);
+ return PropertyCell::cast(value);
}
-Handle<JSGlobalPropertyCell> GlobalObject::EnsurePropertyCell(
+Handle<PropertyCell> GlobalObject::EnsurePropertyCell(
Handle<GlobalObject> global,
Handle<Name> name) {
Isolate* isolate = global->GetIsolate();
CALL_HEAP_FUNCTION(isolate,
global->EnsurePropertyCell(*name),
- JSGlobalPropertyCell);
+ PropertyCell);
}
Heap* heap = GetHeap();
Object* cell;
{ MaybeObject* maybe_cell =
- heap->AllocateJSGlobalPropertyCell(heap->the_hole_value());
+ heap->AllocatePropertyCell(heap->the_hole_value());
if (!maybe_cell->ToObject(&cell)) return maybe_cell;
}
PropertyDetails details(NONE, NORMAL, 0);
return cell;
} else {
Object* value = property_dictionary()->ValueAt(entry);
- ASSERT(value->IsJSGlobalPropertyCell());
+ ASSERT(value->IsPropertyCell());
return value;
}
}
Object* k = HashTable<Shape, Key>::KeyAt(i);
if (Dictionary<Shape, Key>::IsKey(k)) {
Object* e = ValueAt(i);
- if (e->IsJSGlobalPropertyCell()) {
- e = JSGlobalPropertyCell::cast(e)->value();
+ if (e->IsPropertyCell()) {
+ e = PropertyCell::cast(e)->value();
}
if (e == value) return k;
}
}
-Type* JSGlobalPropertyCell::type() {
+Type* PropertyCell::type() {
return static_cast<Type*>(type_raw());
}
-void JSGlobalPropertyCell::set_type(Type* type, WriteBarrierMode ignored) {
+void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) {
set_type_raw(type, ignored);
}
// - Symbol
// - HeapNumber
// - Cell
-// - JSGlobalPropertyCell
+// - PropertyCell
// - Code
// - Map
// - Oddball
V(UndetectableObject) \
V(AccessCheckNeeded) \
V(Cell) \
- V(JSGlobalPropertyCell) \
+ V(PropertyCell) \
V(ObjectHashTable) \
// Forward declaration.
class Cell;
-class JSGlobalPropertyCell;
+class PropertyCell;
// TypeFeedbackCells is a fixed array used to hold the association between
// cache cells and AST ids for code generated by the full compiler.
DECL_ACCESSORS(global_receiver, JSObject)
// Retrieve the property cell used to store a property.
- JSGlobalPropertyCell* GetPropertyCell(LookupResult* result);
+ PropertyCell* GetPropertyCell(LookupResult* result);
// This is like GetProperty, but is used when you know the lookup won't fail
// by throwing an exception. This is for the debug and builtins global
}
// Ensure that the global object has a cell for the given property name.
- static Handle<JSGlobalPropertyCell> EnsurePropertyCell(
+ static Handle<PropertyCell> EnsurePropertyCell(
Handle<GlobalObject> global,
Handle<Name> name);
// TODO(kmillikin): This function can be eliminated once the stub cache is
static inline Cell* FromValueAddress(Address value) {
Object* result = FromAddress(value - kValueOffset);
- ASSERT(result->IsCell() || result->IsJSGlobalPropertyCell());
+ ASSERT(result->IsCell() || result->IsPropertyCell());
return static_cast<Cell*>(result);
}
};
-class JSGlobalPropertyCell: public Cell {
+class PropertyCell: public Cell {
public:
Type* type();
void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
// Casting.
- static inline JSGlobalPropertyCell* cast(Object* obj);
+ static inline PropertyCell* cast(Object* obj);
inline Address TypeAddress() {
return address() + kTypeOffset;
}
// Dispatched behavior.
- DECLARE_PRINTER(JSGlobalPropertyCell)
- DECLARE_VERIFIER(JSGlobalPropertyCell)
+ DECLARE_PRINTER(PropertyCell)
+ DECLARE_VERIFIER(PropertyCell)
// Layout description.
static const int kTypeOffset = kValueOffset + kPointerSize;
typedef FixedBodyDescriptor<
kValueOffset,
kTypeOffset + kPointerSize,
- JSGlobalPropertyCell::kSize> BodyDescriptor;
+ PropertyCell::kSize> BodyDescriptor;
private:
DECL_ACCESSORS(type_raw, Object)
- DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell);
};
Object* value;
value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry());
if (holder()->IsGlobalObject()) {
- value = JSGlobalPropertyCell::cast(value)->value();
+ value = PropertyCell::cast(value)->value();
}
return value;
}
(dictionary->DetailsAt(entry).type() == NORMAL)) {
Object* value = dictionary->ValueAt(entry);
if (!receiver->IsGlobalObject()) return value;
- value = JSGlobalPropertyCell::cast(value)->value();
+ value = PropertyCell::cast(value)->value();
if (!value->IsTheHole()) return value;
// If value is the hole do the general lookup.
}
void PropertyCellSpace::VerifyObject(HeapObject* object) {
// The object should be a global object property cell or a free-list node.
- CHECK(object->IsJSGlobalPropertyCell() ||
+ CHECK(object->IsPropertyCell() ||
object->map() == heap()->two_pointer_filler_map());
}
// Creates a property cell space object with a maximum capacity.
PropertyCellSpace(Heap* heap, intptr_t max_capacity,
AllocationSpace id)
- : FixedSpace(heap, max_capacity, id, JSGlobalPropertyCell::kSize)
+ : FixedSpace(heap, max_capacity, id, PropertyCell::kSize)
{}
virtual int RoundSizeDownToObjectAlignment(int size) {
- if (IsPowerOf2(JSGlobalPropertyCell::kSize)) {
- return RoundDown(size, JSGlobalPropertyCell::kSize);
+ if (IsPowerOf2(PropertyCell::kSize)) {
+ return RoundDown(size, PropertyCell::kSize);
} else {
- return (size / JSGlobalPropertyCell::kSize) * JSGlobalPropertyCell::kSize;
+ return (size / PropertyCell::kSize) * PropertyCell::kSize;
}
}
Handle<Code> StubCache::ComputeLoadGlobal(Handle<Name> name,
Handle<JSObject> receiver,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
bool is_dont_delete) {
Handle<JSObject> stub_holder = StubHolder(receiver, holder);
Handle<Code> stub = FindIC(name, stub_holder, Code::LOAD_IC, Code::NORMAL);
Handle<Code> StubCache::ComputeStoreGlobal(Handle<Name> name,
Handle<GlobalObject> receiver,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
StrictModeFlag strict_mode) {
Handle<Code> stub = FindIC(
name, Handle<JSObject>::cast(receiver),
Handle<Name> name,
Handle<JSObject> receiver,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function) {
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<Code> ComputeLoadGlobal(Handle<Name> name,
Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
bool is_dont_delete);
// ---
Handle<Code> ComputeStoreGlobal(Handle<Name> name,
Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
StrictModeFlag strict_mode);
Handle<Code> ComputeStoreCallback(Handle<Name> name,
Handle<Name> name,
Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function);
// ---
Handle<Code> CompileLoadGlobal(Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name,
bool is_dont_delete);
Handle<Name> name);
Handle<Code> CompileStoreGlobal(Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> holder,
+ Handle<PropertyCell> holder,
Handle<Name> name);
private:
Handle<Code> CompileCallGlobal(Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function,
Handle<Name> name);
Handle<Name> name,
Register scratch,
Label* miss) {
- Handle<JSGlobalPropertyCell> cell =
+ Handle<PropertyCell> cell =
GlobalObject::EnsurePropertyCell(global, name);
ASSERT(cell->value()->IsTheHole());
__ Move(scratch, cell);
Handle<JSFunction> function) {
if (HasCustomCallGenerator(function)) {
Handle<Code> code = CompileCustomCall(object, holder,
- Handle<JSGlobalPropertyCell>::null(),
+ Handle<PropertyCell>::null(),
function, Handle<String>::cast(name));
// A null handle means bail out to the regular compiler code below.
if (!code.is_null()) return code;
Handle<Code> CallStubCompiler::CompileCallGlobal(
Handle<JSObject> object,
Handle<GlobalObject> holder,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<JSFunction> function,
Handle<Name> name) {
// ----------- S t a t e -------------
Handle<Code> StoreStubCompiler::CompileStoreGlobal(
Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name) {
Label miss;
// Compute the cell operand to use.
__ Move(scratch1(), cell);
Operand cell_operand =
- FieldOperand(scratch1(), JSGlobalPropertyCell::kValueOffset);
+ FieldOperand(scratch1(), PropertyCell::kValueOffset);
// Check that the value in the cell is not the hole. If it is, this
// cell could have been deleted and reintroducing the global needs
Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<JSObject> object,
Handle<GlobalObject> global,
- Handle<JSGlobalPropertyCell> cell,
+ Handle<PropertyCell> cell,
Handle<Name> name,
bool is_dont_delete) {
Label success, miss;
// Get the value from the cell.
__ Move(rbx, cell);
- __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
+ __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset));
// Check for deleted property if property can actually be deleted.
if (!is_dont_delete) {