Commit 0a2f7aca authored by danno@chromium.org's avatar danno@chromium.org

Fix serialization tests and Mac build

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/16109018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 41068422
......@@ -410,7 +410,7 @@ class Operand BASE_EMBEDDED {
RelocInfo::EXTERNAL_REFERENCE);
}
static Operand Cell(Handle<Cell> cell) {
static Operand ForCell(Handle<Cell> cell) {
AllowDeferredHandleDereference embedding_raw_address;
return Operand(reinterpret_cast<int32_t>(cell.location()),
RelocInfo::CELL);
......
......@@ -2680,7 +2680,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
__ mov(map, FieldOperand(object, HeapObject::kMapOffset));
__ bind(deferred->map_check()); // Label for calculating code patching.
Handle<Cell> cache_cell = factory()->NewCell(factory()->the_hole_value());
__ cmp(map, Operand::Cell(cache_cell)); // Patched to cached map.
__ cmp(map, Operand::ForCell(cache_cell)); // Patched to cached map.
__ j(not_equal, &cache_miss, Label::kNear);
__ mov(eax, factory()->the_hole_value()); // Patched to either true or false.
__ jmp(&done);
......@@ -2862,7 +2862,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
Register result = ToRegister(instr->result());
__ mov(result, Operand::Cell(instr->hydrogen()->cell()));
__ mov(result, Operand::ForCell(instr->hydrogen()->cell()));
if (instr->hydrogen()->RequiresHoleCheck()) {
__ cmp(result, factory()->the_hole_value());
DeoptimizeIf(equal, instr->environment());
......@@ -2892,12 +2892,12 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
// to update the property details in the property dictionary to mark
// it as no longer deleted. We deoptimize in that case.
if (instr->hydrogen()->RequiresHoleCheck()) {
__ cmp(Operand::Cell(cell_handle), factory()->the_hole_value());
__ cmp(Operand::ForCell(cell_handle), factory()->the_hole_value());
DeoptimizeIf(equal, instr->environment());
}
// Store the value.
__ mov(Operand::Cell(cell_handle), value);
__ mov(Operand::ForCell(cell_handle), value);
// Cells are always rescanned, so no write barrier here.
}
......@@ -5747,7 +5747,7 @@ void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
if (instr->hydrogen()->target_in_new_space()) {
Register reg = ToRegister(instr->value());
Handle<Cell> cell = isolate()->factory()->NewCell(target);
__ cmp(reg, Operand::Cell(cell));
__ cmp(reg, Operand::ForCell(cell));
} else {
Operand operand = ToOperand(instr->value());
__ cmp(operand, target);
......
......@@ -2496,7 +2496,7 @@ void MacroAssembler::LoadHeapObject(Register result,
AllowDeferredHandleDereference embedding_raw_address;
if (isolate()->heap()->InNewSpace(*object)) {
Handle<Cell> cell = isolate()->factory()->NewCell(object);
mov(result, Operand::Cell(cell));
mov(result, Operand::ForCell(cell));
} else {
mov(result, object);
}
......@@ -2507,7 +2507,7 @@ void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
AllowDeferredHandleDereference using_raw_address;
if (isolate()->heap()->InNewSpace(*object)) {
Handle<Cell> cell = isolate()->factory()->NewCell(object);
cmp(reg, Operand::Cell(cell));
cmp(reg, Operand::ForCell(cell));
} else {
cmp(reg, object);
}
......@@ -2518,7 +2518,7 @@ void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
AllowDeferredHandleDereference using_raw_address;
if (isolate()->heap()->InNewSpace(*object)) {
Handle<Cell> cell = isolate()->factory()->NewCell(object);
push(Operand::Cell(cell));
push(Operand::ForCell(cell));
} else {
Push(object);
}
......
......@@ -762,7 +762,7 @@ static void GenerateCheckPropertyCell(MacroAssembler* masm,
__ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
Immediate(the_hole));
} else {
__ cmp(Operand::Cell(cell), Immediate(the_hole));
__ cmp(Operand::ForCell(cell), Immediate(the_hole));
}
__ j(not_equal, miss);
}
......@@ -1573,7 +1573,7 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(
__ mov(edi, Immediate(cell));
__ mov(edi, FieldOperand(edi, Cell::kValueOffset));
} else {
__ mov(edi, Operand::Cell(cell));
__ mov(edi, Operand::ForCell(cell));
}
// Check that the cell contains the same function.
......@@ -3121,7 +3121,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
__ mov(eax, Immediate(cell));
__ mov(eax, FieldOperand(eax, JSGlobalPropertyCell::kValueOffset));
} else {
__ mov(eax, Operand::Cell(cell));
__ mov(eax, Operand::ForCell(cell));
}
// Check for deleted property if property can actually be deleted.
......
......@@ -195,7 +195,8 @@ class FileByteSink : public SnapshotByteSink {
int data_space_used,
int code_space_used,
int map_space_used,
int cell_space_used);
int cell_space_used,
int property_cell_space_used);
private:
FILE* fp_;
......@@ -209,7 +210,8 @@ void FileByteSink::WriteSpaceUsed(
int data_space_used,
int code_space_used,
int map_space_used,
int cell_space_used) {
int cell_space_used,
int property_cell_space_used) {
int file_name_length = StrLength(file_name_) + 10;
Vector<char> name = Vector<char>::New(file_name_length + 1);
OS::SNPrintF(name, "%s.size", file_name_);
......@@ -221,6 +223,7 @@ void FileByteSink::WriteSpaceUsed(
fprintf(fp, "code %d\n", code_space_used);
fprintf(fp, "map %d\n", map_space_used);
fprintf(fp, "cell %d\n", cell_space_used);
fprintf(fp, "property cell %d\n", property_cell_space_used);
fclose(fp);
}
......@@ -236,7 +239,8 @@ static bool WriteToFile(const char* snapshot_file) {
ser.CurrentAllocationAddress(OLD_DATA_SPACE),
ser.CurrentAllocationAddress(CODE_SPACE),
ser.CurrentAllocationAddress(MAP_SPACE),
ser.CurrentAllocationAddress(CELL_SPACE));
ser.CurrentAllocationAddress(CELL_SPACE),
ser.CurrentAllocationAddress(PROPERTY_CELL_SPACE));
return true;
}
......@@ -425,7 +429,8 @@ TEST(PartialSerialization) {
p_ser.CurrentAllocationAddress(OLD_DATA_SPACE),
p_ser.CurrentAllocationAddress(CODE_SPACE),
p_ser.CurrentAllocationAddress(MAP_SPACE),
p_ser.CurrentAllocationAddress(CELL_SPACE));
p_ser.CurrentAllocationAddress(CELL_SPACE),
p_ser.CurrentAllocationAddress(PROPERTY_CELL_SPACE));
startup_sink.WriteSpaceUsed(
startup_serializer.CurrentAllocationAddress(NEW_SPACE),
......@@ -433,7 +438,8 @@ TEST(PartialSerialization) {
startup_serializer.CurrentAllocationAddress(OLD_DATA_SPACE),
startup_serializer.CurrentAllocationAddress(CODE_SPACE),
startup_serializer.CurrentAllocationAddress(MAP_SPACE),
startup_serializer.CurrentAllocationAddress(CELL_SPACE));
startup_serializer.CurrentAllocationAddress(CELL_SPACE),
startup_serializer.CurrentAllocationAddress(PROPERTY_CELL_SPACE));
startup_name.Dispose();
}
}
......@@ -566,7 +572,8 @@ TEST(ContextSerialization) {
p_ser.CurrentAllocationAddress(OLD_DATA_SPACE),
p_ser.CurrentAllocationAddress(CODE_SPACE),
p_ser.CurrentAllocationAddress(MAP_SPACE),
p_ser.CurrentAllocationAddress(CELL_SPACE));
p_ser.CurrentAllocationAddress(CELL_SPACE),
p_ser.CurrentAllocationAddress(PROPERTY_CELL_SPACE));
startup_sink.WriteSpaceUsed(
startup_serializer.CurrentAllocationAddress(NEW_SPACE),
......@@ -574,7 +581,8 @@ TEST(ContextSerialization) {
startup_serializer.CurrentAllocationAddress(OLD_DATA_SPACE),
startup_serializer.CurrentAllocationAddress(CODE_SPACE),
startup_serializer.CurrentAllocationAddress(MAP_SPACE),
startup_serializer.CurrentAllocationAddress(CELL_SPACE));
startup_serializer.CurrentAllocationAddress(CELL_SPACE),
startup_serializer.CurrentAllocationAddress(PROPERTY_CELL_SPACE));
startup_name.Dispose();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment