OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 Apply(context_, eax); | 894 Apply(context_, eax); |
895 } | 895 } |
896 | 896 |
897 | 897 |
898 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 898 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
899 Comment cmnt(masm_, "[ ObjectLiteral"); | 899 Comment cmnt(masm_, "[ ObjectLiteral"); |
900 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 900 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
901 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | 901 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); |
902 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 902 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
903 __ push(Immediate(expr->constant_properties())); | 903 __ push(Immediate(expr->constant_properties())); |
| 904 __ push(Immediate(Smi::FromInt(expr->fast_elements() ? 1 : 0))); |
904 if (expr->depth() > 1) { | 905 if (expr->depth() > 1) { |
905 __ CallRuntime(Runtime::kCreateObjectLiteral, 3); | 906 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
906 } else { | 907 } else { |
907 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3); | 908 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
908 } | 909 } |
909 | 910 |
910 // If result_saved is true the result is on top of the stack. If | 911 // If result_saved is true the result is on top of the stack. If |
911 // result_saved is false the result is in eax. | 912 // result_saved is false the result is in eax. |
912 bool result_saved = false; | 913 bool result_saved = false; |
913 | 914 |
914 for (int i = 0; i < expr->properties()->length(); i++) { | 915 for (int i = 0; i < expr->properties()->length(); i++) { |
915 ObjectLiteral::Property* property = expr->properties()->at(i); | 916 ObjectLiteral::Property* property = expr->properties()->at(i); |
916 if (property->IsCompileTimeValue()) continue; | 917 if (property->IsCompileTimeValue()) continue; |
917 | 918 |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 __ add(Operand(edx), Immediate(masm_->CodeObject())); | 2006 __ add(Operand(edx), Immediate(masm_->CodeObject())); |
2006 __ mov(Operand(esp, 0), edx); | 2007 __ mov(Operand(esp, 0), edx); |
2007 // And return. | 2008 // And return. |
2008 __ ret(0); | 2009 __ ret(0); |
2009 } | 2010 } |
2010 | 2011 |
2011 | 2012 |
2012 #undef __ | 2013 #undef __ |
2013 | 2014 |
2014 } } // namespace v8::internal | 2015 } } // namespace v8::internal |
OLD | NEW |