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 1511 matching lines...) Loading... |
1522 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1522 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1523 Comment cmnt(masm_, "[ ObjectLiteral"); | 1523 Comment cmnt(masm_, "[ ObjectLiteral"); |
1524 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1524 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1525 int flags = expr->fast_elements() | 1525 int flags = expr->fast_elements() |
1526 ? ObjectLiteral::kFastElements | 1526 ? ObjectLiteral::kFastElements |
1527 : ObjectLiteral::kNoFlags; | 1527 : ObjectLiteral::kNoFlags; |
1528 flags |= expr->has_function() | 1528 flags |= expr->has_function() |
1529 ? ObjectLiteral::kHasFunction | 1529 ? ObjectLiteral::kHasFunction |
1530 : ObjectLiteral::kNoFlags; | 1530 : ObjectLiteral::kNoFlags; |
1531 int properties_count = constant_properties->length() / 2; | 1531 int properties_count = constant_properties->length() / 2; |
1532 if (expr->depth() > 1) { | 1532 if ((FLAG_track_double_fields && expr->may_store_doubles()) || |
| 1533 expr->depth() > 1) { |
1533 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1534 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1534 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1535 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1535 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1536 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1536 __ push(Immediate(constant_properties)); | 1537 __ push(Immediate(constant_properties)); |
1537 __ push(Immediate(Smi::FromInt(flags))); | 1538 __ push(Immediate(Smi::FromInt(flags))); |
1538 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1539 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1539 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || | 1540 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || |
1540 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1541 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1541 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1542 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1542 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1543 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); |
(...skipping 3188 matching lines...) Loading... |
4731 *stack_depth = 0; | 4732 *stack_depth = 0; |
4732 *context_length = 0; | 4733 *context_length = 0; |
4733 return previous_; | 4734 return previous_; |
4734 } | 4735 } |
4735 | 4736 |
4736 #undef __ | 4737 #undef __ |
4737 | 4738 |
4738 } } // namespace v8::internal | 4739 } } // namespace v8::internal |
4739 | 4740 |
4740 #endif // V8_TARGET_ARCH_IA32 | 4741 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |