| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 context()->Plug(rax); | 1211 context()->Plug(rax); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 | 1214 |
| 1215 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1215 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 1216 Comment cmnt(masm_, "[ ObjectLiteral"); | 1216 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 1217 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1217 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1218 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1218 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
| 1219 __ Push(Smi::FromInt(expr->literal_index())); | 1219 __ Push(Smi::FromInt(expr->literal_index())); |
| 1220 __ Push(expr->constant_properties()); | 1220 __ Push(expr->constant_properties()); |
| 1221 __ Push(Smi::FromInt(expr->fast_elements() ? 1 : 0)); | 1221 int flags = expr->fast_elements() |
| 1222 ? ObjectLiteral::kFastElements |
| 1223 : ObjectLiteral::kNoFlags; |
| 1224 flags |= expr->has_function() |
| 1225 ? ObjectLiteral::kHasFunction |
| 1226 : ObjectLiteral::kNoFlags; |
| 1227 __ push(Immediate(Smi::FromInt(flags))); |
| 1222 if (expr->depth() > 1) { | 1228 if (expr->depth() > 1) { |
| 1223 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1229 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
| 1224 } else { | 1230 } else { |
| 1225 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | 1231 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
| 1226 } | 1232 } |
| 1227 | 1233 |
| 1228 // If result_saved is true the result is on top of the stack. If | 1234 // If result_saved is true the result is on top of the stack. If |
| 1229 // result_saved is false the result is in rax. | 1235 // result_saved is false the result is in rax. |
| 1230 bool result_saved = false; | 1236 bool result_saved = false; |
| 1231 | 1237 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 VisitForStackValue(key); | 1285 VisitForStackValue(key); |
| 1280 __ Push(property->kind() == ObjectLiteral::Property::SETTER ? | 1286 __ Push(property->kind() == ObjectLiteral::Property::SETTER ? |
| 1281 Smi::FromInt(1) : | 1287 Smi::FromInt(1) : |
| 1282 Smi::FromInt(0)); | 1288 Smi::FromInt(0)); |
| 1283 VisitForStackValue(value); | 1289 VisitForStackValue(value); |
| 1284 __ CallRuntime(Runtime::kDefineAccessor, 4); | 1290 __ CallRuntime(Runtime::kDefineAccessor, 4); |
| 1285 break; | 1291 break; |
| 1286 } | 1292 } |
| 1287 } | 1293 } |
| 1288 | 1294 |
| 1295 if (expr->has_function()) { |
| 1296 ASSERT(result_saved); |
| 1297 __ push(Operand(esp, 0)); |
| 1298 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 1299 } |
| 1300 |
| 1289 if (result_saved) { | 1301 if (result_saved) { |
| 1290 context()->PlugTOS(); | 1302 context()->PlugTOS(); |
| 1291 } else { | 1303 } else { |
| 1292 context()->Plug(rax); | 1304 context()->Plug(rax); |
| 1293 } | 1305 } |
| 1294 } | 1306 } |
| 1295 | 1307 |
| 1296 | 1308 |
| 1297 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1309 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
| 1298 Comment cmnt(masm_, "[ ArrayLiteral"); | 1310 Comment cmnt(masm_, "[ ArrayLiteral"); |
| (...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3644 __ ret(0); | 3656 __ ret(0); |
| 3645 } | 3657 } |
| 3646 | 3658 |
| 3647 | 3659 |
| 3648 #undef __ | 3660 #undef __ |
| 3649 | 3661 |
| 3650 | 3662 |
| 3651 } } // namespace v8::internal | 3663 } } // namespace v8::internal |
| 3652 | 3664 |
| 3653 #endif // V8_TARGET_ARCH_X64 | 3665 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |