| 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 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 context()->Plug(rax); | 1354 context()->Plug(rax); |
| 1355 } | 1355 } |
| 1356 | 1356 |
| 1357 | 1357 |
| 1358 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1358 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 1359 Comment cmnt(masm_, "[ ObjectLiteral"); | 1359 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 1360 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1360 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1361 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1361 __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
| 1362 __ Push(Smi::FromInt(expr->literal_index())); | 1362 __ Push(Smi::FromInt(expr->literal_index())); |
| 1363 __ Push(expr->constant_properties()); | 1363 __ Push(expr->constant_properties()); |
| 1364 __ Push(Smi::FromInt(expr->fast_elements() ? 1 : 0)); | 1364 int flags = expr->fast_elements() |
| 1365 ? ObjectLiteral::kFastElements |
| 1366 : ObjectLiteral::kNoFlags; |
| 1367 flags |= expr->has_function() |
| 1368 ? ObjectLiteral::kHasFunction |
| 1369 : ObjectLiteral::kNoFlags; |
| 1370 __ Push(Smi::FromInt(flags)); |
| 1365 if (expr->depth() > 1) { | 1371 if (expr->depth() > 1) { |
| 1366 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1372 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
| 1367 } else { | 1373 } else { |
| 1368 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | 1374 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
| 1369 } | 1375 } |
| 1370 | 1376 |
| 1371 // If result_saved is true the result is on top of the stack. If | 1377 // If result_saved is true the result is on top of the stack. If |
| 1372 // result_saved is false the result is in rax. | 1378 // result_saved is false the result is in rax. |
| 1373 bool result_saved = false; | 1379 bool result_saved = false; |
| 1374 | 1380 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 VisitForStackValue(key); | 1430 VisitForStackValue(key); |
| 1425 __ Push(property->kind() == ObjectLiteral::Property::SETTER ? | 1431 __ Push(property->kind() == ObjectLiteral::Property::SETTER ? |
| 1426 Smi::FromInt(1) : | 1432 Smi::FromInt(1) : |
| 1427 Smi::FromInt(0)); | 1433 Smi::FromInt(0)); |
| 1428 VisitForStackValue(value); | 1434 VisitForStackValue(value); |
| 1429 __ CallRuntime(Runtime::kDefineAccessor, 4); | 1435 __ CallRuntime(Runtime::kDefineAccessor, 4); |
| 1430 break; | 1436 break; |
| 1431 } | 1437 } |
| 1432 } | 1438 } |
| 1433 | 1439 |
| 1440 if (expr->has_function()) { |
| 1441 ASSERT(result_saved); |
| 1442 __ push(Operand(rsp, 0)); |
| 1443 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 1444 } |
| 1445 |
| 1434 if (result_saved) { | 1446 if (result_saved) { |
| 1435 context()->PlugTOS(); | 1447 context()->PlugTOS(); |
| 1436 } else { | 1448 } else { |
| 1437 context()->Plug(rax); | 1449 context()->Plug(rax); |
| 1438 } | 1450 } |
| 1439 } | 1451 } |
| 1440 | 1452 |
| 1441 | 1453 |
| 1442 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1454 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
| 1443 Comment cmnt(masm_, "[ ArrayLiteral"); | 1455 Comment cmnt(masm_, "[ ArrayLiteral"); |
| (...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3984 __ ret(0); | 3996 __ ret(0); |
| 3985 } | 3997 } |
| 3986 | 3998 |
| 3987 | 3999 |
| 3988 #undef __ | 4000 #undef __ |
| 3989 | 4001 |
| 3990 | 4002 |
| 3991 } } // namespace v8::internal | 4003 } } // namespace v8::internal |
| 3992 | 4004 |
| 3993 #endif // V8_TARGET_ARCH_X64 | 4005 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |