Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 6158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6169 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { | 6169 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
| 6170 ASSERT(!HasStackOverflow()); | 6170 ASSERT(!HasStackOverflow()); |
| 6171 ASSERT(current_block() != NULL); | 6171 ASSERT(current_block() != NULL); |
| 6172 ASSERT(current_block()->HasPredecessor()); | 6172 ASSERT(current_block()->HasPredecessor()); |
| 6173 Handle<JSFunction> closure = function_state()->compilation_info()->closure(); | 6173 Handle<JSFunction> closure = function_state()->compilation_info()->closure(); |
| 6174 HValue* context = environment()->LookupContext(); | 6174 HValue* context = environment()->LookupContext(); |
| 6175 HInstruction* literal; | 6175 HInstruction* literal; |
| 6176 | 6176 |
| 6177 // Check whether to use fast or slow deep-copying for boilerplate. | 6177 // Check whether to use fast or slow deep-copying for boilerplate. |
| 6178 int total_size = 0; | 6178 int total_size = 0; |
| 6179 int max_properties = HFastLiteral::kMaxLiteralProperties; | 6179 int max_properties = kMaxFastLiteralProperties; |
| 6180 Handle<Object> boilerplate(closure->literals()->get(expr->literal_index()), | 6180 Handle<Object> original_boilerplate(closure->literals()->get( |
| 6181 isolate()); | 6181 expr->literal_index()), isolate()); |
| 6182 if (boilerplate->IsJSObject() && | 6182 if (original_boilerplate->IsJSObject() && |
| 6183 IsFastLiteral(Handle<JSObject>::cast(boilerplate), | 6183 IsFastLiteral(Handle<JSObject>::cast(original_boilerplate), |
| 6184 HFastLiteral::kMaxLiteralDepth, | 6184 kMaxFastLiteralDepth, |
| 6185 &max_properties, | 6185 &max_properties, |
| 6186 &total_size)) { | 6186 &total_size)) { |
| 6187 Handle<JSObject> boilerplate_object = Handle<JSObject>::cast(boilerplate); | 6187 Handle<JSObject> original_boilerplate_object = |
| 6188 literal = new(zone()) HFastLiteral(context, | 6188 Handle<JSObject>::cast(original_boilerplate); |
| 6189 boilerplate_object, | 6189 Handle<JSObject> boilerplate_object = |
| 6190 total_size, | 6190 DeepCopy(original_boilerplate_object); |
| 6191 expr->literal_index(), | 6191 |
| 6192 expr->depth(), | 6192 literal = BuildFastLiteral(context, |
| 6193 DONT_TRACK_ALLOCATION_SITE); | 6193 boilerplate_object, |
| 6194 original_boilerplate_object, | |
| 6195 total_size, | |
| 6196 DONT_TRACK_ALLOCATION_SITE, | |
| 6197 environment()->previous_ast_id()); | |
| 6194 } else { | 6198 } else { |
| 6195 literal = new(zone()) HObjectLiteral(context, | 6199 literal = AddInstruction( |
| 6196 expr->constant_properties(), | 6200 new(zone()) HObjectLiteral(context, |
|
danno
2013/04/09 08:52:42
nit: strange indenting?
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 6197 expr->fast_elements(), | 6201 expr->constant_properties(), |
| 6198 expr->literal_index(), | 6202 expr->fast_elements(), |
| 6199 expr->depth(), | 6203 expr->literal_index(), |
| 6200 expr->has_function()); | 6204 expr->depth(), |
| 6205 expr->has_function())); | |
| 6201 } | 6206 } |
| 6202 | 6207 |
| 6203 // The object is expected in the bailout environment during computation | 6208 // The object is expected in the bailout environment during computation |
| 6204 // of the property values and is the value of the entire expression. | 6209 // of the property values and is the value of the entire expression. |
| 6205 PushAndAdd(literal); | 6210 Push(literal); |
| 6206 | 6211 |
| 6207 expr->CalculateEmitStore(zone()); | 6212 expr->CalculateEmitStore(zone()); |
| 6208 | 6213 |
| 6209 for (int i = 0; i < expr->properties()->length(); i++) { | 6214 for (int i = 0; i < expr->properties()->length(); i++) { |
| 6210 ObjectLiteral::Property* property = expr->properties()->at(i); | 6215 ObjectLiteral::Property* property = expr->properties()->at(i); |
| 6211 if (property->IsCompileTimeValue()) continue; | 6216 if (property->IsCompileTimeValue()) continue; |
| 6212 | 6217 |
| 6213 Literal* key = property->key(); | 6218 Literal* key = property->key(); |
| 6214 Expression* value = property->value(); | 6219 Expression* value = property->value(); |
| 6215 | 6220 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6292 if (raw_boilerplate.is_null()) { | 6297 if (raw_boilerplate.is_null()) { |
| 6293 return Bailout("array boilerplate creation failed"); | 6298 return Bailout("array boilerplate creation failed"); |
| 6294 } | 6299 } |
| 6295 literals->set(expr->literal_index(), *raw_boilerplate); | 6300 literals->set(expr->literal_index(), *raw_boilerplate); |
| 6296 if (JSObject::cast(*raw_boilerplate)->elements()->map() == | 6301 if (JSObject::cast(*raw_boilerplate)->elements()->map() == |
| 6297 isolate()->heap()->fixed_cow_array_map()) { | 6302 isolate()->heap()->fixed_cow_array_map()) { |
| 6298 isolate()->counters()->cow_arrays_created_runtime()->Increment(); | 6303 isolate()->counters()->cow_arrays_created_runtime()->Increment(); |
| 6299 } | 6304 } |
| 6300 } | 6305 } |
| 6301 | 6306 |
| 6302 Handle<JSObject> boilerplate = Handle<JSObject>::cast(raw_boilerplate); | 6307 Handle<JSObject> original_boilerplate_object = |
| 6308 Handle<JSObject>::cast(raw_boilerplate); | |
| 6303 ElementsKind boilerplate_elements_kind = | 6309 ElementsKind boilerplate_elements_kind = |
| 6304 Handle<JSObject>::cast(boilerplate)->GetElementsKind(); | 6310 Handle<JSObject>::cast(original_boilerplate_object)->GetElementsKind(); |
| 6305 | 6311 |
| 6306 // TODO(mvstanton): This heuristic is only a temporary solution. In the | 6312 // TODO(mvstanton): This heuristic is only a temporary solution. In the |
| 6307 // end, we want to quit creating allocation site info after a certain number | 6313 // end, we want to quit creating allocation site info after a certain number |
| 6308 // of GCs for a call site. | 6314 // of GCs for a call site. |
| 6309 AllocationSiteMode mode = AllocationSiteInfo::GetMode( | 6315 AllocationSiteMode mode = AllocationSiteInfo::GetMode( |
| 6310 boilerplate_elements_kind); | 6316 boilerplate_elements_kind); |
| 6311 | 6317 |
| 6312 // Check whether to use fast or slow deep-copying for boilerplate. | 6318 // Check whether to use fast or slow deep-copying for boilerplate. |
| 6313 int total_size = 0; | 6319 int total_size = 0; |
| 6314 int max_properties = HFastLiteral::kMaxLiteralProperties; | 6320 int max_properties = kMaxFastLiteralProperties; |
| 6315 if (IsFastLiteral(boilerplate, | 6321 if (IsFastLiteral(original_boilerplate_object, |
| 6316 HFastLiteral::kMaxLiteralDepth, | 6322 kMaxFastLiteralDepth, |
| 6317 &max_properties, | 6323 &max_properties, |
| 6318 &total_size)) { | 6324 &total_size)) { |
| 6319 if (mode == TRACK_ALLOCATION_SITE) { | 6325 if (mode == TRACK_ALLOCATION_SITE) { |
| 6320 total_size += AllocationSiteInfo::kSize; | 6326 total_size += AllocationSiteInfo::kSize; |
| 6321 } | 6327 } |
| 6322 literal = new(zone()) HFastLiteral(context, | 6328 |
| 6323 boilerplate, | 6329 Handle<JSObject> boilerplate_object = DeepCopy(original_boilerplate_object); |
| 6324 total_size, | 6330 literal = BuildFastLiteral(context, |
| 6325 expr->literal_index(), | 6331 boilerplate_object, |
| 6326 expr->depth(), | 6332 original_boilerplate_object, |
| 6327 mode); | 6333 total_size, |
| 6334 mode, | |
| 6335 environment()->previous_ast_id()); | |
| 6328 } else { | 6336 } else { |
| 6329 literal = new(zone()) HArrayLiteral(context, | 6337 literal = AddInstruction( |
| 6330 boilerplate, | 6338 new(zone()) HArrayLiteral(context, |
| 6331 length, | 6339 original_boilerplate_object, |
| 6332 expr->literal_index(), | 6340 length, |
| 6333 expr->depth(), | 6341 expr->literal_index(), |
| 6334 mode); | 6342 expr->depth(), |
| 6343 mode)); | |
| 6335 } | 6344 } |
| 6336 | 6345 |
| 6337 // The array is expected in the bailout environment during computation | 6346 // The array is expected in the bailout environment during computation |
| 6338 // of the property values and is the value of the entire expression. | 6347 // of the property values and is the value of the entire expression. |
| 6339 PushAndAdd(literal); | 6348 Push(literal); |
| 6340 | 6349 |
| 6341 HLoadElements* elements = NULL; | 6350 HLoadElements* elements = NULL; |
| 6342 | 6351 |
| 6343 for (int i = 0; i < length; i++) { | 6352 for (int i = 0; i < length; i++) { |
| 6344 Expression* subexpr = subexprs->at(i); | 6353 Expression* subexpr = subexprs->at(i); |
| 6345 // If the subexpression is a literal or a simple materialized literal it | 6354 // If the subexpression is a literal or a simple materialized literal it |
| 6346 // is already set in the cloned array. | 6355 // is already set in the cloned array. |
| 6347 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 6356 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 6348 | 6357 |
| 6349 CHECK_ALIVE(VisitForValue(subexpr)); | 6358 CHECK_ALIVE(VisitForValue(subexpr)); |
| (...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10069 if (function_state()->outer() != NULL) { | 10078 if (function_state()->outer() != NULL) { |
| 10070 return new(zone()) HConstant( | 10079 return new(zone()) HConstant( |
| 10071 function_state()->compilation_info()->closure(), | 10080 function_state()->compilation_info()->closure(), |
| 10072 Representation::Tagged()); | 10081 Representation::Tagged()); |
| 10073 } else { | 10082 } else { |
| 10074 return new(zone()) HThisFunction; | 10083 return new(zone()) HThisFunction; |
| 10075 } | 10084 } |
| 10076 } | 10085 } |
| 10077 | 10086 |
| 10078 | 10087 |
| 10088 HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( | |
| 10089 HValue* context, | |
| 10090 Handle<JSObject> boilerplate_object, | |
| 10091 Handle<JSObject> original_boilerplate_object, | |
| 10092 int size, | |
| 10093 AllocationSiteMode mode, | |
| 10094 BailoutId id) { | |
| 10095 Zone* zone = this->zone(); | |
| 10096 | |
| 10097 HValue* size_in_bytes = | |
| 10098 AddInstruction(new(zone) HConstant(size, Representation::Integer32())); | |
| 10099 HInstruction* result = | |
| 10100 AddInstruction(new(zone) HAllocate(context, | |
| 10101 size_in_bytes, | |
| 10102 HType::JSObject(), | |
| 10103 HAllocate::CAN_ALLOCATE_IN_NEW_SPACE)); | |
| 10104 int offset = 0; | |
| 10105 BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result, | |
| 10106 &offset, mode, id); | |
| 10107 ASSERT_EQ(size, offset); | |
| 10108 return result; | |
| 10109 } | |
| 10110 | |
| 10111 | |
| 10112 void HOptimizedGraphBuilder::BuildEmitDeepCopy( | |
| 10113 Handle<JSObject> boilerplate_object, | |
| 10114 Handle<JSObject> original_boilerplate_object, | |
| 10115 HInstruction* target, | |
| 10116 int* offset, | |
| 10117 AllocationSiteMode mode, | |
| 10118 BailoutId id) { | |
| 10119 Zone* zone = this->zone(); | |
| 10120 Factory* factory = isolate()->factory(); | |
| 10121 | |
| 10122 HInstruction* boilerplate = AddInstruction(new(zone) HConstant( | |
| 10123 boilerplate_object, Representation::Tagged())); | |
| 10124 HInstruction* original_boilerplate = AddInstruction(new(zone) HConstant( | |
| 10125 original_boilerplate_object, Representation::Tagged())); | |
| 10126 | |
| 10127 bool create_allocation_site_info = mode == TRACK_ALLOCATION_SITE && | |
| 10128 boilerplate_object->map()->CanTrackAllocationSite(); | |
| 10129 | |
| 10130 // Only elements backing stores for non-COW arrays need to be copied. | |
| 10131 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | |
| 10132 Handle<FixedArrayBase> original_elements( | |
| 10133 original_boilerplate_object->elements()); | |
| 10134 ElementsKind kind = boilerplate_object->map()->elements_kind(); | |
| 10135 bool has_elements = elements->length() > 0 && | |
| 10136 elements->map() != isolate()->heap()->fixed_cow_array_map(); | |
| 10137 | |
| 10138 // Increase the offset so that subsequent objects end up right after | |
| 10139 // this object and its backing store. | |
| 10140 int object_offset = *offset; | |
| 10141 int object_size = boilerplate_object->map()->instance_size(); | |
| 10142 int elements_size = has_elements ? elements->Size() : 0; | |
| 10143 int elements_offset = *offset + object_size; | |
| 10144 int inobject_properties = boilerplate_object->map()->inobject_properties(); | |
| 10145 if (create_allocation_site_info) { | |
| 10146 elements_offset += AllocationSiteInfo::kSize; | |
| 10147 *offset += AllocationSiteInfo::kSize; | |
| 10148 } | |
| 10149 | |
| 10150 *offset += object_size + elements_size; | |
| 10151 | |
| 10152 BuildCopyObjectHeader(boilerplate_object, target, object_offset, | |
| 10153 elements_offset, has_elements, id); | |
| 10154 | |
| 10155 // Copy in-object properties. | |
| 10156 HValue* object_properties = | |
| 10157 AddInstruction(new(zone) HInnerAllocatedObject(target, object_offset)); | |
| 10158 for (int i = 0; i < inobject_properties; i++) { | |
| 10159 Handle<Object> value = | |
| 10160 Handle<Object>(boilerplate_object->InObjectPropertyAt(i), | |
| 10161 isolate()); | |
| 10162 if (value->IsJSObject()) { | |
| 10163 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | |
| 10164 Handle<JSObject> original_value_object = Handle<JSObject>::cast( | |
| 10165 Handle<Object>(original_boilerplate_object->InObjectPropertyAt(i), | |
| 10166 isolate())); | |
| 10167 HInstruction* value_instruction = | |
| 10168 AddInstruction(new(zone) HInnerAllocatedObject(target, *offset)); | |
| 10169 AddInstruction(new(zone) HStoreNamedField( | |
| 10170 object_properties, factory->empty_string(), value_instruction, true, | |
| 10171 boilerplate_object->GetInObjectPropertyOffset(i))); | |
| 10172 AddSimulate(id); | |
| 10173 BuildEmitDeepCopy(value_object, original_value_object, target, | |
| 10174 offset, DONT_TRACK_ALLOCATION_SITE, id); | |
| 10175 } else { | |
| 10176 HInstruction* value_instruction = AddInstruction(new(zone) HConstant( | |
| 10177 value, Representation::Tagged())); | |
| 10178 AddInstruction(new(zone) HStoreNamedField( | |
| 10179 object_properties, factory->empty_string(), value_instruction, true, | |
| 10180 boilerplate_object->GetInObjectPropertyOffset(i))); | |
| 10181 AddSimulate(id); | |
| 10182 } | |
| 10183 } | |
| 10184 | |
| 10185 // Build Allocation Site Info if desired | |
| 10186 if (create_allocation_site_info) { | |
| 10187 HValue* alloc_site = | |
| 10188 AddInstruction(new(zone) HInnerAllocatedObject(target, JSArray::kSize)); | |
| 10189 Handle<Map> alloc_site_map(isolate()->heap()->allocation_site_info_map()); | |
| 10190 BuildStoreMap(alloc_site, alloc_site_map, id); | |
| 10191 int alloc_payload_offset = AllocationSiteInfo::kPayloadOffset; | |
| 10192 AddInstruction(new(zone) HStoreNamedField(alloc_site, | |
| 10193 factory->payload_string(), | |
| 10194 original_boilerplate, | |
| 10195 true, alloc_payload_offset)); | |
| 10196 AddSimulate(id); | |
| 10197 } | |
| 10198 | |
| 10199 if (has_elements) { | |
| 10200 HInstruction* boilerplate_elements = | |
|
danno
2013/04/09 08:52:42
From here....
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10201 AddInstruction(new(zone) HLoadElements(boilerplate, NULL)); | |
| 10202 HValue* object_elements = | |
| 10203 AddInstruction(new(zone) HInnerAllocatedObject( | |
| 10204 target, elements_offset)); | |
| 10205 AddInstruction(new(zone) HStoreNamedField(object_elements, | |
| 10206 factory->elements_field_string(), | |
| 10207 boilerplate_elements, | |
| 10208 true, JSObject::kElementsOffset)); | |
|
danno
2013/04/09 08:52:42
... til here is not needed.
This is a FixedArray,
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10209 AddSimulate(id); | |
| 10210 | |
|
danno
2013/04/09 08:52:42
ASSERT(kFixedArrayHeaderSize = 2 * kPointer);
Hannes Payer (out of office)
2013/04/09 14:20:13
What do you want to check but that assert?
| |
| 10211 HInstruction* object_elements_length = | |
| 10212 AddInstruction(new(zone) HFixedArrayBaseLength(boilerplate_elements)); | |
|
danno
2013/04/09 08:52:42
You can replace this with a constant load, too.
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10213 BuildInitializeElements(object_elements, kind, object_elements_length); | |
| 10214 | |
| 10215 // Copy elements backing store content. | |
| 10216 int elements_length = elements->length(); | |
| 10217 if (elements->IsFixedDoubleArray()) { | |
| 10218 for (int i = 0; i < elements_length; i++) { | |
| 10219 HValue* key_constant = | |
| 10220 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); | |
| 10221 HInstruction* value_instruction = | |
| 10222 AddInstruction(new(zone) HLoadKeyed( | |
| 10223 boilerplate_elements, key_constant, NULL, kind)); | |
| 10224 AddInstruction(new(zone) HStoreKeyed( | |
| 10225 object_elements, key_constant, value_instruction, kind)); | |
| 10226 AddSimulate(id); | |
| 10227 } | |
| 10228 } else if (elements->IsFixedArray()) { | |
| 10229 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | |
| 10230 Handle<FixedArray> original_fast_elements = | |
| 10231 Handle<FixedArray>::cast(original_elements); | |
| 10232 for (int i = 0; i < elements_length; i++) { | |
| 10233 Handle<Object> value(fast_elements->get(i), isolate()); | |
| 10234 HValue* key_constant = | |
| 10235 AddInstruction(new(zone) HConstant(i, Representation::Integer32())); | |
| 10236 if (value->IsJSObject()) { | |
| 10237 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | |
| 10238 Handle<JSObject> original_value_object = Handle<JSObject>::cast( | |
| 10239 Handle<Object>(original_fast_elements->get(i), isolate())); | |
| 10240 HInstruction* value_instruction = | |
| 10241 AddInstruction(new(zone) HInnerAllocatedObject(target, *offset)); | |
| 10242 AddInstruction(new(zone) HStoreKeyed( | |
| 10243 object_elements, key_constant, value_instruction, kind)); | |
| 10244 AddSimulate(id); | |
| 10245 BuildEmitDeepCopy(value_object, original_value_object, target, | |
| 10246 offset, DONT_TRACK_ALLOCATION_SITE, id); | |
| 10247 } else { | |
| 10248 HInstruction* value_instruction = | |
| 10249 AddInstruction(new(zone) HLoadKeyed( | |
| 10250 boilerplate_elements, key_constant, NULL, kind)); | |
| 10251 AddInstruction(new(zone) HStoreKeyed( | |
| 10252 object_elements, key_constant, value_instruction, kind)); | |
| 10253 AddSimulate(id); | |
| 10254 } | |
| 10255 } | |
| 10256 } else { | |
| 10257 UNREACHABLE(); | |
| 10258 } | |
| 10259 } | |
| 10260 } | |
| 10261 | |
| 10262 | |
| 10263 void HOptimizedGraphBuilder::BuildCopyObjectHeader( | |
| 10264 Handle<JSObject> boilerplate_object, | |
| 10265 HInstruction* target, | |
| 10266 int object_offset, | |
| 10267 int elements_offset, | |
| 10268 bool has_elements, | |
| 10269 BailoutId id) { | |
| 10270 ASSERT(boilerplate_object->properties()->length() == 0); | |
| 10271 Zone* zone = this->zone(); | |
| 10272 Factory* factory = isolate()->factory(); | |
| 10273 | |
| 10274 HValue* object_header = | |
| 10275 AddInstruction(new(zone) HInnerAllocatedObject(target, object_offset)); | |
| 10276 Handle<Map> boilerplate_object_map(boilerplate_object->map()); | |
| 10277 BuildStoreMap(object_header, boilerplate_object_map, id); | |
| 10278 | |
| 10279 HInstruction* value_instruction; | |
|
danno
2013/04/09 08:52:42
Maybe different names? elements?
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10280 Handle<Object> header_field ; | |
| 10281 if (!has_elements) { | |
| 10282 header_field = Handle<Object>(boilerplate_object->elements(), isolate()); | |
| 10283 value_instruction = AddInstruction(new(zone) HConstant( | |
| 10284 header_field, Representation::None())); | |
|
danno
2013/04/09 08:52:42
Tagged
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10285 } else { | |
| 10286 value_instruction = AddInstruction(new(zone) HInnerAllocatedObject( | |
| 10287 target, elements_offset)); | |
| 10288 } | |
| 10289 AddInstruction(new(zone) HStoreNamedField(object_header, | |
| 10290 factory->empty_string(), | |
|
danno
2013/04/09 08:52:42
nit: indent
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10291 value_instruction, | |
| 10292 true, JSObject::kElementsOffset)); | |
| 10293 AddSimulate(id); | |
|
danno
2013/04/09 08:52:42
Make sure to set the kChangesElementsPointer GVN f
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10294 | |
| 10295 header_field = Handle<Object>(boilerplate_object->properties(), isolate()); | |
| 10296 value_instruction = AddInstruction(new(zone) HConstant( | |
|
danno
2013/04/09 08:52:42
properties
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10297 header_field, Representation::None())); | |
| 10298 AddInstruction(new(zone) HStoreNamedField(object_header, | |
| 10299 factory->empty_string(), | |
| 10300 value_instruction, | |
| 10301 true, JSObject::kPropertiesOffset)); | |
|
danno
2013/04/09 08:52:42
As discussed, perhaps you only want to do this in
Hannes Payer (out of office)
2013/04/09 14:20:13
This belongs to elements. Done.
| |
| 10302 AddSimulate(id); | |
| 10303 | |
| 10304 if (boilerplate_object->IsJSArray()) { | |
| 10305 Handle<JSArray> boilerplate_array = | |
| 10306 Handle<JSArray>::cast(boilerplate_object); | |
| 10307 | |
| 10308 header_field = Handle<Object>(boilerplate_array->length(), isolate()); | |
| 10309 value_instruction = AddInstruction(new(zone) HConstant( | |
| 10310 header_field, Representation::None())); | |
| 10311 AddInstruction(new(zone) HStoreNamedField(object_header, | |
| 10312 factory->empty_string(), | |
|
danno
2013/04/09 08:52:42
length_field_string
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10313 value_instruction, | |
| 10314 true, JSArray::kLengthOffset)); | |
|
danno
2013/04/09 08:52:42
Make sure to set the kChangesArrayLengths GVN flag
Hannes Payer (out of office)
2013/04/09 14:20:13
Done.
| |
| 10315 AddSimulate(id); | |
| 10316 } | |
| 10317 } | |
| 10318 | |
| 10319 | |
| 10079 void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) { | 10320 void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) { |
| 10080 ASSERT(!HasStackOverflow()); | 10321 ASSERT(!HasStackOverflow()); |
| 10081 ASSERT(current_block() != NULL); | 10322 ASSERT(current_block() != NULL); |
| 10082 ASSERT(current_block()->HasPredecessor()); | 10323 ASSERT(current_block()->HasPredecessor()); |
| 10083 HInstruction* instr = BuildThisFunction(); | 10324 HInstruction* instr = BuildThisFunction(); |
| 10084 return ast_context()->ReturnInstruction(instr, expr->id()); | 10325 return ast_context()->ReturnInstruction(instr, expr->id()); |
| 10085 } | 10326 } |
| 10086 | 10327 |
| 10087 | 10328 |
| 10088 void HOptimizedGraphBuilder::VisitDeclarations( | 10329 void HOptimizedGraphBuilder::VisitDeclarations( |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11418 } | 11659 } |
| 11419 } | 11660 } |
| 11420 | 11661 |
| 11421 #ifdef DEBUG | 11662 #ifdef DEBUG |
| 11422 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11663 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11423 if (allocator_ != NULL) allocator_->Verify(); | 11664 if (allocator_ != NULL) allocator_->Verify(); |
| 11424 #endif | 11665 #endif |
| 11425 } | 11666 } |
| 11426 | 11667 |
| 11427 } } // namespace v8::internal | 11668 } } // namespace v8::internal |
| OLD | NEW |