Remove globale pretenuring mode from runtime.
BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/132003002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18738 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
b4949cfd62
commit
b704d49176
@ -3562,8 +3562,7 @@ void Heap::SetNumberStringCache(Object* number, String* string) {
|
||||
|
||||
|
||||
MaybeObject* Heap::NumberToString(Object* number,
|
||||
bool check_number_string_cache,
|
||||
PretenureFlag pretenure) {
|
||||
bool check_number_string_cache) {
|
||||
isolate_->counters()->number_to_string_runtime()->Increment();
|
||||
if (check_number_string_cache) {
|
||||
Object* cached = GetNumberStringCache(number);
|
||||
@ -3584,8 +3583,11 @@ MaybeObject* Heap::NumberToString(Object* number,
|
||||
}
|
||||
|
||||
Object* js_string;
|
||||
|
||||
// We tenure the allocated string since it is referenced from the
|
||||
// number-string cache which lives in the old space.
|
||||
MaybeObject* maybe_js_string =
|
||||
AllocateStringFromOneByte(CStrVector(str), pretenure);
|
||||
AllocateStringFromOneByte(CStrVector(str), TENURED);
|
||||
if (maybe_js_string->ToObject(&js_string)) {
|
||||
SetNumberStringCache(number, String::cast(js_string));
|
||||
}
|
||||
|
@ -1571,8 +1571,7 @@ class Heap {
|
||||
bool RootCanBeTreatedAsConstant(RootListIndex root_index);
|
||||
|
||||
MUST_USE_RESULT MaybeObject* NumberToString(
|
||||
Object* number, bool check_number_string_cache = true,
|
||||
PretenureFlag pretenure = NOT_TENURED);
|
||||
Object* number, bool check_number_string_cache = true);
|
||||
MUST_USE_RESULT MaybeObject* Uint32ToString(
|
||||
uint32_t value, bool check_number_string_cache = true);
|
||||
|
||||
|
@ -259,9 +259,11 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
|
||||
constant_properties,
|
||||
&is_result_from_cache);
|
||||
|
||||
PretenureFlag pretenure_flag =
|
||||
isolate->heap()->InNewSpace(*literals) ? NOT_TENURED : TENURED;
|
||||
|
||||
Handle<JSObject> boilerplate =
|
||||
isolate->factory()->NewJSObjectFromMap(
|
||||
map, isolate->heap()->GetPretenureMode());
|
||||
isolate->factory()->NewJSObjectFromMap(map, pretenure_flag);
|
||||
|
||||
// Normalize the elements of the boilerplate to save space if needed.
|
||||
if (!should_have_fast_elements) JSObject::NormalizeElements(boilerplate);
|
||||
@ -367,9 +369,11 @@ Handle<Object> Runtime::CreateArrayLiteralBoilerplate(
|
||||
Handle<JSFunction> constructor(
|
||||
JSFunction::NativeContextFromLiterals(*literals)->array_function());
|
||||
|
||||
PretenureFlag pretenure_flag =
|
||||
isolate->heap()->InNewSpace(*literals) ? NOT_TENURED : TENURED;
|
||||
|
||||
Handle<JSArray> object = Handle<JSArray>::cast(
|
||||
isolate->factory()->NewJSObject(
|
||||
constructor, isolate->heap()->GetPretenureMode()));
|
||||
isolate->factory()->NewJSObject(constructor, pretenure_flag));
|
||||
|
||||
ElementsKind constant_elements_kind =
|
||||
static_cast<ElementsKind>(Smi::cast(elements->get(0))->value());
|
||||
@ -6809,8 +6813,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToStringSkipCache) {
|
||||
Object* number = args[0];
|
||||
RUNTIME_ASSERT(number->IsNumber());
|
||||
|
||||
return isolate->heap()->NumberToString(
|
||||
number, false, isolate->heap()->GetPretenureMode());
|
||||
return isolate->heap()->NumberToString(number, false);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user