| Index: src/contexts.cc
|
| diff --git a/src/contexts.cc b/src/contexts.cc
|
| index 8263269d117c2d06a6f8fd2947f31097ef942895..9f39aecd542ca24dbbad3bf7baf1109e853494ba 100644
|
| --- a/src/contexts.cc
|
| +++ b/src/contexts.cc
|
| @@ -20,8 +20,11 @@ Handle<ScriptContextTable> ScriptContextTable::Extend(
|
| CHECK(used >= 0 && length > 0 && used < length);
|
| if (used + 1 == length) {
|
| CHECK(length < Smi::kMaxValue / 2);
|
| - result = Handle<ScriptContextTable>::cast(
|
| - FixedArray::CopySize(table, length * 2));
|
| + Isolate* isolate = table->GetIsolate();
|
| + Handle<FixedArray> copy =
|
| + isolate->factory()->CopyFixedArrayAndGrow(table, length);
|
| + copy->set_map(isolate->heap()->script_context_table_map());
|
| + result = Handle<ScriptContextTable>::cast(copy);
|
| } else {
|
| result = table;
|
| }
|
|
|