Fixed a number of build issues.
Fixed problem with missing I-cache flusing on ARM.
Changed space layout in memory management by splitting up code space into old data space and code space.
Added utf-8 conversion support to the API (issue 57).
Optimized repeated calls to eval with the same strings. These repeated calls are common in web applications.
Added Xcode project file.
Optimized a couple of Array operation.
Fixed parser bug by checking for end-of-string when parsing break and continue (issue 35).
Fixed problem where asian characters were not categorized as letters.
Fixed bug that disallowed calling functions fetched from an array using a string as an array index (issue 32).
Fixed bug where the internal field count on object templates were sometimes ignored (issue 54).
Added -f option to the shell sample for compatibility with other engines (issue 18).
Added source info to TryCatches in the API.
Fixed problem where the seed for the random number generator was clipped in a double to unsigned int conversion.
Fixed bug where cons string symbols were sometimes converted to non-symbol flat strings during GC.
Fixed bug in error reporting when attempting to convert null to an object.
git-svn-id: http://v8.googlecode.com/svn/trunk@267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 22ef441..c03c22c 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 Google Inc. All Rights Reserved.
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -44,7 +44,8 @@
}
-Object* Heap::AllocateRaw(int size_in_bytes, AllocationSpace space) {
+Object* Heap::AllocateRaw(int size_in_bytes,
+ AllocationSpace space) {
ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
#ifdef DEBUG
if (FLAG_gc_interval >= 0 &&
@@ -60,8 +61,10 @@
}
Object* result;
- if (OLD_SPACE == space) {
- result = old_space_->AllocateRaw(size_in_bytes);
+ if (OLD_POINTER_SPACE == space) {
+ result = old_pointer_space_->AllocateRaw(size_in_bytes);
+ } else if (OLD_DATA_SPACE == space) {
+ result = old_data_space_->AllocateRaw(size_in_bytes);
} else if (CODE_SPACE == space) {
result = code_space_->AllocateRaw(size_in_bytes);
} else if (LO_SPACE == space) {
@@ -75,32 +78,6 @@
}
-Object* Heap::AllocateForDeserialization(int size_in_bytes,
- AllocationSpace space) {
- ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
- PagedSpace* where;
-
- switch (space) {
- case NEW_SPACE:
- return new_space_->AllocateRaw(size_in_bytes);
- case LO_SPACE:
- return lo_space_->AllocateRaw(size_in_bytes);
- case OLD_SPACE:
- where = old_space_;
- break;
- case CODE_SPACE:
- where = code_space_;
- break;
- case MAP_SPACE:
- where = map_space_;
- break;
- }
-
- // Only paged spaces fall through.
- return where->AllocateForDeserialization(size_in_bytes);
-}
-
-
Object* Heap::NumberFromInt32(int32_t value) {
if (Smi::IsValid(value)) return Smi::FromInt(value);
// Bypass NumberFromDouble to avoid various redundant checks.
@@ -160,9 +137,9 @@
}
-AllocationSpace Heap::TargetSpace(HeapObject* object) {
- // Heap numbers and sequential strings are promoted to code space, all
- // other object types are promoted to old space. We do not use
+OldSpace* Heap::TargetSpace(HeapObject* object) {
+ // Heap numbers and sequential strings are promoted to old data space, all
+ // other object types are promoted to old pointer space. We do not use
// object->IsHeapNumber() and object->IsSeqString() because we already
// know that object has the heap object tag.
InstanceType type = object->map()->instance_type();
@@ -171,7 +148,7 @@
type != HEAP_NUMBER_TYPE &&
(type >= FIRST_NONSTRING_TYPE ||
String::cast(object)->representation_tag() != kSeqStringTag);
- return has_pointers ? OLD_SPACE : CODE_SPACE;
+ return has_pointers ? old_pointer_space_ : old_data_space_;
}