Commit 0f9253b5 authored by whesse@chromium.org's avatar whesse@chromium.org

Initialize list of frame elements to proper size.

Review URL: http://codereview.chromium.org/57006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1641 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ab845fd8
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Copyright 2006-2009 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:
......@@ -67,6 +67,7 @@ class List {
INLINE(bool is_empty() const) { return length_ == 0; }
INLINE(int length() const) { return length_; }
INLINE(int capacity() const) { return capacity_; }
Vector<T> ToVector() { return Vector<T>(data_, length_); }
......
// Copyright 2008 the V8 project authors. All rights reserved.
// Copyright 2009 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,9 @@ namespace v8 { namespace internal {
VirtualFrame::VirtualFrame(CodeGenerator* cgen)
: cgen_(cgen),
masm_(cgen->masm()),
elements_(0),
elements_(cgen->scope()->num_parameters()
+ cgen->scope()->num_stack_slots()
+ kPreallocatedElements),
parameter_count_(cgen->scope()->num_parameters()),
local_count_(0),
stack_pointer_(parameter_count_), // 0-based index of TOS.
......
// Copyright 2008 the V8 project authors. All rights reserved.
// Copyright 2009 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:
......@@ -331,6 +331,7 @@ class VirtualFrame : public Malloced {
static const int kContextOffset = StandardFrameConstants::kContextOffset;
static const int kHandlerSize = StackHandlerConstants::kSize / kPointerSize;
static const int kPreallocatedElements = 5 + 8; // 8 expression stack slots.
CodeGenerator* cgen_;
MacroAssembler* masm_;
......
// Copyright 2008 the V8 project authors. All rights reserved.
// Copyright 2009 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:
......@@ -43,7 +43,9 @@ namespace v8 { namespace internal {
VirtualFrame::VirtualFrame(CodeGenerator* cgen)
: cgen_(cgen),
masm_(cgen->masm()),
elements_(0),
elements_(cgen->scope()->num_parameters()
+ cgen->scope()->num_stack_slots()
+ kPreallocatedElements),
parameter_count_(cgen->scope()->num_parameters()),
local_count_(0),
stack_pointer_(parameter_count_ + 1), // 0-based index of TOS.
......
// Copyright 2008 the V8 project authors. All rights reserved.
// Copyright 2009 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:
......@@ -340,6 +340,7 @@ class VirtualFrame : public Malloced {
static const int kContextOffset = StandardFrameConstants::kContextOffset;
static const int kHandlerSize = StackHandlerConstants::kSize / kPointerSize;
static const int kPreallocatedElements = 5 + 8; // 8 expression stack slots.
CodeGenerator* cgen_;
MacroAssembler* masm_;
......
......@@ -53,7 +53,7 @@ VirtualFrame::SpilledScope::~SpilledScope() {
VirtualFrame::VirtualFrame(VirtualFrame* original)
: cgen_(original->cgen_),
masm_(original->masm_),
elements_(original->elements_.length()),
elements_(original->elements_.capacity()),
parameter_count_(original->parameter_count_),
local_count_(original->local_count_),
stack_pointer_(original->stack_pointer_),
......
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