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