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 1536 matching lines...) Loading... |
1547 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1547 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1548 Comment cmnt(masm_, "[ ObjectLiteral"); | 1548 Comment cmnt(masm_, "[ ObjectLiteral"); |
1549 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1549 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1550 int flags = expr->fast_elements() | 1550 int flags = expr->fast_elements() |
1551 ? ObjectLiteral::kFastElements | 1551 ? ObjectLiteral::kFastElements |
1552 : ObjectLiteral::kNoFlags; | 1552 : ObjectLiteral::kNoFlags; |
1553 flags |= expr->has_function() | 1553 flags |= expr->has_function() |
1554 ? ObjectLiteral::kHasFunction | 1554 ? ObjectLiteral::kHasFunction |
1555 : ObjectLiteral::kNoFlags; | 1555 : ObjectLiteral::kNoFlags; |
1556 int properties_count = constant_properties->length() / 2; | 1556 int properties_count = constant_properties->length() / 2; |
1557 if (expr->depth() > 1) { | 1557 if ((FLAG_track_double_fields && expr->may_store_doubles()) || |
| 1558 expr->depth() > 1) { |
1558 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1559 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1559 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1560 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
1560 __ Push(Smi::FromInt(expr->literal_index())); | 1561 __ Push(Smi::FromInt(expr->literal_index())); |
1561 __ Push(constant_properties); | 1562 __ Push(constant_properties); |
1562 __ Push(Smi::FromInt(flags)); | 1563 __ Push(Smi::FromInt(flags)); |
1563 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1564 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1564 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || | 1565 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || |
1565 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1566 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1566 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1567 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1567 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1568 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
(...skipping 3155 matching lines...) Loading... |
4723 *context_length = 0; | 4724 *context_length = 0; |
4724 return previous_; | 4725 return previous_; |
4725 } | 4726 } |
4726 | 4727 |
4727 | 4728 |
4728 #undef __ | 4729 #undef __ |
4729 | 4730 |
4730 } } // namespace v8::internal | 4731 } } // namespace v8::internal |
4731 | 4732 |
4732 #endif // V8_TARGET_ARCH_X64 | 4733 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |