OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 Apply(context_, rax); | 896 Apply(context_, rax); |
897 } | 897 } |
898 | 898 |
899 | 899 |
900 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 900 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
901 Comment cmnt(masm_, "[ ObjectLiteral"); | 901 Comment cmnt(masm_, "[ ObjectLiteral"); |
902 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 902 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
903 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 903 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
904 __ Push(Smi::FromInt(expr->literal_index())); | 904 __ Push(Smi::FromInt(expr->literal_index())); |
905 __ Push(expr->constant_properties()); | 905 __ Push(expr->constant_properties()); |
| 906 __ Push(Smi::FromInt(expr->fast_elements() ? 1 : 0)); |
906 if (expr->depth() > 1) { | 907 if (expr->depth() > 1) { |
907 __ CallRuntime(Runtime::kCreateObjectLiteral, 3); | 908 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
908 } else { | 909 } else { |
909 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3); | 910 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
910 } | 911 } |
911 | 912 |
912 // If result_saved is true the result is on top of the stack. If | 913 // If result_saved is true the result is on top of the stack. If |
913 // result_saved is false the result is in rax. | 914 // result_saved is false the result is in rax. |
914 bool result_saved = false; | 915 bool result_saved = false; |
915 | 916 |
916 for (int i = 0; i < expr->properties()->length(); i++) { | 917 for (int i = 0; i < expr->properties()->length(); i++) { |
917 ObjectLiteral::Property* property = expr->properties()->at(i); | 918 ObjectLiteral::Property* property = expr->properties()->at(i); |
918 if (property->IsCompileTimeValue()) continue; | 919 if (property->IsCompileTimeValue()) continue; |
919 | 920 |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 __ movq(Operand(rsp, 0), rdx); | 1985 __ movq(Operand(rsp, 0), rdx); |
1985 // And return. | 1986 // And return. |
1986 __ ret(0); | 1987 __ ret(0); |
1987 } | 1988 } |
1988 | 1989 |
1989 | 1990 |
1990 #undef __ | 1991 #undef __ |
1991 | 1992 |
1992 | 1993 |
1993 } } // namespace v8::internal | 1994 } } // namespace v8::internal |
OLD | NEW |