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 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 if (result_saved) { | 1872 if (result_saved) { |
1873 __ addp(rsp, Immediate(kPointerSize)); // literal index | 1873 __ addp(rsp, Immediate(kPointerSize)); // literal index |
1874 context()->PlugTOS(); | 1874 context()->PlugTOS(); |
1875 } else { | 1875 } else { |
1876 context()->Plug(rax); | 1876 context()->Plug(rax); |
1877 } | 1877 } |
1878 } | 1878 } |
1879 | 1879 |
1880 | 1880 |
1881 void FullCodeGenerator::VisitAssignment(Assignment* expr) { | 1881 void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
1882 ASSERT(expr->target()->IsValidLeftHandSide()); | 1882 ASSERT(expr->target()->IsValidReferenceExpression()); |
1883 | 1883 |
1884 Comment cmnt(masm_, "[ Assignment"); | 1884 Comment cmnt(masm_, "[ Assignment"); |
1885 | 1885 |
1886 // Left-hand side can only be a property, a global or a (parameter or local) | 1886 // Left-hand side can only be a property, a global or a (parameter or local) |
1887 // slot. | 1887 // slot. |
1888 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; | 1888 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |
1889 LhsKind assign_type = VARIABLE; | 1889 LhsKind assign_type = VARIABLE; |
1890 Property* property = expr->target()->AsProperty(); | 1890 Property* property = expr->target()->AsProperty(); |
1891 if (property != NULL) { | 1891 if (property != NULL) { |
1892 assign_type = (property->key()->IsPropertyName()) | 1892 assign_type = (property->key()->IsPropertyName()) |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 __ Pop(rdx); | 2371 __ Pop(rdx); |
2372 BinaryOpICStub stub(op, mode); | 2372 BinaryOpICStub stub(op, mode); |
2373 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2373 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2374 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); | 2374 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); |
2375 patch_site.EmitPatchInfo(); | 2375 patch_site.EmitPatchInfo(); |
2376 context()->Plug(rax); | 2376 context()->Plug(rax); |
2377 } | 2377 } |
2378 | 2378 |
2379 | 2379 |
2380 void FullCodeGenerator::EmitAssignment(Expression* expr) { | 2380 void FullCodeGenerator::EmitAssignment(Expression* expr) { |
2381 ASSERT(expr->IsValidLeftHandSide()); | 2381 ASSERT(expr->IsValidReferenceExpression()); |
2382 | 2382 |
2383 // Left-hand side can only be a property, a global or a (parameter or local) | 2383 // Left-hand side can only be a property, a global or a (parameter or local) |
2384 // slot. | 2384 // slot. |
2385 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; | 2385 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |
2386 LhsKind assign_type = VARIABLE; | 2386 LhsKind assign_type = VARIABLE; |
2387 Property* prop = expr->AsProperty(); | 2387 Property* prop = expr->AsProperty(); |
2388 if (prop != NULL) { | 2388 if (prop != NULL) { |
2389 assign_type = (prop->key()->IsPropertyName()) | 2389 assign_type = (prop->key()->IsPropertyName()) |
2390 ? NAMED_PROPERTY | 2390 ? NAMED_PROPERTY |
2391 : KEYED_PROPERTY; | 2391 : KEYED_PROPERTY; |
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4290 break; | 4290 break; |
4291 } | 4291 } |
4292 | 4292 |
4293 default: | 4293 default: |
4294 UNREACHABLE(); | 4294 UNREACHABLE(); |
4295 } | 4295 } |
4296 } | 4296 } |
4297 | 4297 |
4298 | 4298 |
4299 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { | 4299 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
4300 ASSERT(expr->expression()->IsValidLeftHandSide()); | 4300 ASSERT(expr->expression()->IsValidReferenceExpression()); |
4301 | 4301 |
4302 Comment cmnt(masm_, "[ CountOperation"); | 4302 Comment cmnt(masm_, "[ CountOperation"); |
4303 SetSourcePosition(expr->position()); | 4303 SetSourcePosition(expr->position()); |
4304 | 4304 |
4305 // Expression can only be a property, a global or a (parameter or local) | 4305 // Expression can only be a property, a global or a (parameter or local) |
4306 // slot. | 4306 // slot. |
4307 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; | 4307 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |
4308 LhsKind assign_type = VARIABLE; | 4308 LhsKind assign_type = VARIABLE; |
4309 Property* prop = expr->expression()->AsProperty(); | 4309 Property* prop = expr->expression()->AsProperty(); |
4310 // In case of a property we use the uninitialized expression context | 4310 // In case of a property we use the uninitialized expression context |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4916 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4916 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4917 Assembler::target_address_at(call_target_address, | 4917 Assembler::target_address_at(call_target_address, |
4918 unoptimized_code)); | 4918 unoptimized_code)); |
4919 return OSR_AFTER_STACK_CHECK; | 4919 return OSR_AFTER_STACK_CHECK; |
4920 } | 4920 } |
4921 | 4921 |
4922 | 4922 |
4923 } } // namespace v8::internal | 4923 } } // namespace v8::internal |
4924 | 4924 |
4925 #endif // V8_TARGET_ARCH_X64 | 4925 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |