Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index ed21567e51b1a8f455fbf4bd0c00771808ce2273..9a6e07dcfa7d978adcf8c54826a304b5027adb54 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -500,7 +500,7 @@ class ReachabilityAnalyzer BASE_EMBEDDED { |
| void HGraph::Verify(bool do_full_verify) const { |
| // Allow dereferencing for debug mode verification. |
| - AllowHandleDereference allow_handle_deref; |
| + AllowHandleDereference allow_handle_deref(isolate()); |
| for (int i = 0; i < blocks_.length(); i++) { |
| HBasicBlock* block = blocks_.at(i); |
| @@ -925,7 +925,7 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
| AddInstruction(new(zone) HLoadElements(object, mapcheck)); |
| if (is_store && (fast_elements || fast_smi_only_elements)) { |
| HCheckMaps* check_cow_map = new(zone) HCheckMaps( |
| - elements, Isolate::Current()->factory()->fixed_array_map(), zone); |
| + elements, graph()->isolate()->factory()->fixed_array_map(), zone); |
| check_cow_map->ClearGVNFlag(kDependsOnElementsKind); |
| AddInstruction(check_cow_map); |
| } |
| @@ -5134,7 +5134,7 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) { |
| HInstruction* enum_length = AddInstruction(new(zone()) HMapEnumLength(map)); |
| HInstruction* start_index = AddInstruction(new(zone()) HConstant( |
| - Handle<Object>(Smi::FromInt(0)), Representation::Integer32())); |
| + Handle<Object>(Smi::FromInt(0), isolate()), Representation::Integer32())); |
| Push(map); |
| Push(array); |
| @@ -5483,12 +5483,13 @@ static bool LookupAccessorPair(Handle<Map> map, |
| Handle<String> name, |
| Handle<AccessorPair>* accessors, |
| Handle<JSObject>* holder) { |
| - LookupResult lookup(map->GetIsolate()); |
| + Isolate* isolate = map->GetIsolate(); |
| + LookupResult lookup(isolate); |
| // Check for a JavaScript accessor directly in the map. |
| map->LookupDescriptor(NULL, *name, &lookup); |
| if (lookup.IsPropertyCallbacks()) { |
| - Handle<Object> callback(lookup.GetValueFromMap(*map)); |
| + Handle<Object> callback(lookup.GetValueFromMap(*map), isolate); |
| if (!callback->IsAccessorPair()) return false; |
| *accessors = Handle<AccessorPair>::cast(callback); |
| *holder = Handle<JSObject>(); |
| @@ -5501,7 +5502,7 @@ static bool LookupAccessorPair(Handle<Map> map, |
| // Check for a JavaScript accessor somewhere in the proto chain. |
| LookupInPrototypes(map, name, &lookup); |
| if (lookup.IsPropertyCallbacks()) { |
| - Handle<Object> callback(lookup.GetValue()); |
| + Handle<Object> callback(lookup.GetValue(), isolate); |
| if (!callback->IsAccessorPair()) return false; |
| *accessors = Handle<AccessorPair>::cast(callback); |
| *holder = Handle<JSObject>(lookup.holder()); |
| @@ -5551,9 +5552,10 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate, |
| ASSERT(max_depth >= 0 && *max_properties >= 0); |
| if (max_depth == 0) return false; |
| + Isolate* isolate = boilerplate->GetIsolate(); |
| Handle<FixedArrayBase> elements(boilerplate->elements()); |
| if (elements->length() > 0 && |
| - elements->map() != boilerplate->GetHeap()->fixed_cow_array_map()) { |
| + elements->map() != isolate->heap()->fixed_cow_array_map()) { |
| if (boilerplate->HasFastDoubleElements()) { |
| *total_size += FixedDoubleArray::SizeFor(elements->length()); |
| } else if (boilerplate->HasFastObjectElements()) { |
| @@ -5561,7 +5563,7 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate, |
| int length = elements->length(); |
| for (int i = 0; i < length; i++) { |
| if ((*max_properties)-- == 0) return false; |
| - Handle<Object> value(fast_elements->get(i)); |
| + Handle<Object> value(fast_elements->get(i), isolate); |
| if (value->IsJSObject()) { |
| Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
| if (!IsFastLiteral(value_object, |
| @@ -5585,7 +5587,7 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate, |
| int nof = boilerplate->map()->inobject_properties(); |
| for (int i = 0; i < nof; i++) { |
| if ((*max_properties)-- == 0) return false; |
| - Handle<Object> value(boilerplate->InObjectPropertyAt(i)); |
| + Handle<Object> value(boilerplate->InObjectPropertyAt(i), isolate); |
| if (value->IsJSObject()) { |
| Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
| if (!IsFastLiteral(value_object, |
| @@ -5614,7 +5616,8 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
| // Check whether to use fast or slow deep-copying for boilerplate. |
| int total_size = 0; |
| int max_properties = HFastLiteral::kMaxLiteralProperties; |
| - Handle<Object> boilerplate(closure->literals()->get(expr->literal_index())); |
| + Handle<Object> boilerplate(closure->literals()->get(expr->literal_index()), |
| + isolate()); |
| if (boilerplate->IsJSObject() && |
| IsFastLiteral(Handle<JSObject>::cast(boilerplate), |
| HFastLiteral::kMaxLiteralDepth, |
| @@ -5719,7 +5722,8 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| HInstruction* literal; |
| Handle<FixedArray> literals(environment()->closure()->literals()); |
| - Handle<Object> raw_boilerplate(literals->get(expr->literal_index())); |
| + Handle<Object> raw_boilerplate(literals->get(expr->literal_index()), |
| + isolate()); |
| if (raw_boilerplate->IsUndefined()) { |
| raw_boilerplate = Runtime::CreateArrayLiteralBoilerplate( |
| @@ -5791,7 +5795,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| AddInstruction(elements); |
| HValue* key = AddInstruction( |
| - new(zone()) HConstant(Handle<Object>(Smi::FromInt(i)), |
| + new(zone()) HConstant(Handle<Object>(Smi::FromInt(i), isolate()), |
| Representation::Integer32())); |
| switch (boilerplate_elements_kind) { |
| @@ -7051,8 +7055,8 @@ bool HOptimizedGraphBuilder::TryArgumentsAccess(Property* expr) { |
| int argument_count = environment()-> |
| arguments_environment()->parameter_count() - 1; |
| result = new(zone()) HConstant( |
| - Handle<Object>(Smi::FromInt(argument_count)), |
| - Representation::Integer32()); |
| + Handle<Object>(Smi::FromInt(argument_count), isolate()), |
| + Representation::Integer32()); |
| } |
| } else { |
| Push(graph()->GetArgumentsObject()); |
| @@ -7075,7 +7079,7 @@ bool HOptimizedGraphBuilder::TryArgumentsAccess(Property* expr) { |
| int argument_count = environment()-> |
| arguments_environment()->parameter_count() - 1; |
| HInstruction* length = AddInstruction(new(zone()) HConstant( |
| - Handle<Object>(Smi::FromInt(argument_count)), |
| + Handle<Object>(Smi::FromInt(argument_count), isolate()), |
| Representation::Integer32())); |
|
Michael Starzinger
2013/02/25 10:50:58
Indentation of third line is off.
Sven Panne
2013/02/25 14:44:43
Done.
|
| HInstruction* checked_key = AddBoundsCheck(key, length); |
| result = new(zone()) HAccessArgumentsAt(elements, length, checked_key); |
| @@ -7886,7 +7890,8 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( |
| new(zone()) HUnaryMathOperation(context, left, kMathPowHalf); |
| } else if (exponent == -0.5) { |
| HConstant* double_one = |
| - new(zone()) HConstant(Handle<Object>(Smi::FromInt(1)), |
| + new(zone()) HConstant(Handle<Object>(Smi::FromInt(1), |
| + isolate()), |
| Representation::Double()); |
| AddInstruction(double_one); |
| HUnaryMathOperation* square_root = |