Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 17576005: Rename Literal::handle to Literal::value (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/typing.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 __ push(rax); // Save result on the stack 1656 __ push(rax); // Save result on the stack
1657 result_saved = true; 1657 result_saved = true;
1658 } 1658 }
1659 switch (property->kind()) { 1659 switch (property->kind()) {
1660 case ObjectLiteral::Property::CONSTANT: 1660 case ObjectLiteral::Property::CONSTANT:
1661 UNREACHABLE(); 1661 UNREACHABLE();
1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1663 ASSERT(!CompileTimeValue::IsCompileTimeValue(value)); 1663 ASSERT(!CompileTimeValue::IsCompileTimeValue(value));
1664 // Fall through. 1664 // Fall through.
1665 case ObjectLiteral::Property::COMPUTED: 1665 case ObjectLiteral::Property::COMPUTED:
1666 if (key->handle()->IsInternalizedString()) { 1666 if (key->value()->IsInternalizedString()) {
1667 if (property->emit_store()) { 1667 if (property->emit_store()) {
1668 VisitForAccumulatorValue(value); 1668 VisitForAccumulatorValue(value);
1669 __ Move(rcx, key->handle()); 1669 __ Move(rcx, key->value());
1670 __ movq(rdx, Operand(rsp, 0)); 1670 __ movq(rdx, Operand(rsp, 0));
1671 Handle<Code> ic = is_classic_mode() 1671 Handle<Code> ic = is_classic_mode()
1672 ? isolate()->builtins()->StoreIC_Initialize() 1672 ? isolate()->builtins()->StoreIC_Initialize()
1673 : isolate()->builtins()->StoreIC_Initialize_Strict(); 1673 : isolate()->builtins()->StoreIC_Initialize_Strict();
1674 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId()); 1674 CallIC(ic, RelocInfo::CODE_TARGET, key->LiteralFeedbackId());
1675 PrepareForBailoutForId(key->id(), NO_REGISTERS); 1675 PrepareForBailoutForId(key->id(), NO_REGISTERS);
1676 } else { 1676 } else {
1677 VisitForEffect(value); 1677 VisitForEffect(value);
1678 } 1678 }
1679 break; 1679 break;
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 // Only the value field needs a write barrier, as the other values are in the 2240 // Only the value field needs a write barrier, as the other values are in the
2241 // root set. 2241 // root set.
2242 __ RecordWriteField(rax, JSGeneratorObject::kResultValuePropertyOffset, 2242 __ RecordWriteField(rax, JSGeneratorObject::kResultValuePropertyOffset,
2243 rcx, rdx, kDontSaveFPRegs); 2243 rcx, rdx, kDontSaveFPRegs);
2244 } 2244 }
2245 2245
2246 2246
2247 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2247 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2248 SetSourcePosition(prop->position()); 2248 SetSourcePosition(prop->position());
2249 Literal* key = prop->key()->AsLiteral(); 2249 Literal* key = prop->key()->AsLiteral();
2250 __ Move(rcx, key->handle()); 2250 __ Move(rcx, key->value());
2251 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 2251 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2252 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); 2252 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId());
2253 } 2253 }
2254 2254
2255 2255
2256 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2256 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2257 SetSourcePosition(prop->position()); 2257 SetSourcePosition(prop->position());
2258 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2258 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2259 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId()); 2259 CallIC(ic, RelocInfo::CODE_TARGET, prop->PropertyFeedbackId());
2260 } 2260 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 Variable* var = expr->AsVariableProxy()->var(); 2359 Variable* var = expr->AsVariableProxy()->var();
2360 EffectContext context(this); 2360 EffectContext context(this);
2361 EmitVariableAssignment(var, Token::ASSIGN); 2361 EmitVariableAssignment(var, Token::ASSIGN);
2362 break; 2362 break;
2363 } 2363 }
2364 case NAMED_PROPERTY: { 2364 case NAMED_PROPERTY: {
2365 __ push(rax); // Preserve value. 2365 __ push(rax); // Preserve value.
2366 VisitForAccumulatorValue(prop->obj()); 2366 VisitForAccumulatorValue(prop->obj());
2367 __ movq(rdx, rax); 2367 __ movq(rdx, rax);
2368 __ pop(rax); // Restore value. 2368 __ pop(rax); // Restore value.
2369 __ Move(rcx, prop->key()->AsLiteral()->handle()); 2369 __ Move(rcx, prop->key()->AsLiteral()->value());
2370 Handle<Code> ic = is_classic_mode() 2370 Handle<Code> ic = is_classic_mode()
2371 ? isolate()->builtins()->StoreIC_Initialize() 2371 ? isolate()->builtins()->StoreIC_Initialize()
2372 : isolate()->builtins()->StoreIC_Initialize_Strict(); 2372 : isolate()->builtins()->StoreIC_Initialize_Strict();
2373 CallIC(ic); 2373 CallIC(ic);
2374 break; 2374 break;
2375 } 2375 }
2376 case KEYED_PROPERTY: { 2376 case KEYED_PROPERTY: {
2377 __ push(rax); // Preserve value. 2377 __ push(rax); // Preserve value.
2378 VisitForStackValue(prop->obj()); 2378 VisitForStackValue(prop->obj());
2379 VisitForAccumulatorValue(prop->key()); 2379 VisitForAccumulatorValue(prop->key());
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 2482
2483 2483
2484 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { 2484 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
2485 // Assignment to a property, using a named store IC. 2485 // Assignment to a property, using a named store IC.
2486 Property* prop = expr->target()->AsProperty(); 2486 Property* prop = expr->target()->AsProperty();
2487 ASSERT(prop != NULL); 2487 ASSERT(prop != NULL);
2488 ASSERT(prop->key()->AsLiteral() != NULL); 2488 ASSERT(prop->key()->AsLiteral() != NULL);
2489 2489
2490 // Record source code position before IC call. 2490 // Record source code position before IC call.
2491 SetSourcePosition(expr->position()); 2491 SetSourcePosition(expr->position());
2492 __ Move(rcx, prop->key()->AsLiteral()->handle()); 2492 __ Move(rcx, prop->key()->AsLiteral()->value());
2493 __ pop(rdx); 2493 __ pop(rdx);
2494 Handle<Code> ic = is_classic_mode() 2494 Handle<Code> ic = is_classic_mode()
2495 ? isolate()->builtins()->StoreIC_Initialize() 2495 ? isolate()->builtins()->StoreIC_Initialize()
2496 : isolate()->builtins()->StoreIC_Initialize_Strict(); 2496 : isolate()->builtins()->StoreIC_Initialize_Strict();
2497 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId()); 2497 CallIC(ic, RelocInfo::CODE_TARGET, expr->AssignmentFeedbackId());
2498 2498
2499 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 2499 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
2500 context()->Plug(rax); 2500 context()->Plug(rax);
2501 } 2501 }
2502 2502
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 // The receiver is either the global receiver or an object found by 2742 // The receiver is either the global receiver or an object found by
2743 // LoadContextSlot. That object could be the hole if the receiver is 2743 // LoadContextSlot. That object could be the hole if the receiver is
2744 // implicitly the global object. 2744 // implicitly the global object.
2745 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT); 2745 EmitCallWithStub(expr, RECEIVER_MIGHT_BE_IMPLICIT);
2746 } else if (property != NULL) { 2746 } else if (property != NULL) {
2747 { PreservePositionScope scope(masm()->positions_recorder()); 2747 { PreservePositionScope scope(masm()->positions_recorder());
2748 VisitForStackValue(property->obj()); 2748 VisitForStackValue(property->obj());
2749 } 2749 }
2750 if (property->key()->IsPropertyName()) { 2750 if (property->key()->IsPropertyName()) {
2751 EmitCallWithIC(expr, 2751 EmitCallWithIC(expr,
2752 property->key()->AsLiteral()->handle(), 2752 property->key()->AsLiteral()->value(),
2753 RelocInfo::CODE_TARGET); 2753 RelocInfo::CODE_TARGET);
2754 } else { 2754 } else {
2755 EmitKeyedCallWithIC(expr, property->key()); 2755 EmitKeyedCallWithIC(expr, property->key());
2756 } 2756 }
2757 } else { 2757 } else {
2758 // Call to an arbitrary expression not handled specially above. 2758 // Call to an arbitrary expression not handled specially above.
2759 { PreservePositionScope scope(masm()->positions_recorder()); 2759 { PreservePositionScope scope(masm()->positions_recorder());
2760 VisitForStackValue(callee); 2760 VisitForStackValue(callee);
2761 } 2761 }
2762 // Load global receiver object. 2762 // Load global receiver object.
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
3347 3347
3348 __ bind(&done); 3348 __ bind(&done);
3349 context()->Plug(rax); 3349 context()->Plug(rax);
3350 } 3350 }
3351 3351
3352 3352
3353 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { 3353 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3354 ZoneList<Expression*>* args = expr->arguments(); 3354 ZoneList<Expression*>* args = expr->arguments();
3355 ASSERT(args->length() == 2); 3355 ASSERT(args->length() == 2);
3356 ASSERT_NE(NULL, args->at(1)->AsLiteral()); 3356 ASSERT_NE(NULL, args->at(1)->AsLiteral());
3357 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->handle())); 3357 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3358 3358
3359 VisitForAccumulatorValue(args->at(0)); // Load the object. 3359 VisitForAccumulatorValue(args->at(0)); // Load the object.
3360 3360
3361 Label runtime, done, not_date_object; 3361 Label runtime, done, not_date_object;
3362 Register object = rax; 3362 Register object = rax;
3363 Register result = rax; 3363 Register result = rax;
3364 Register scratch = rcx; 3364 Register scratch = rcx;
3365 3365
3366 __ JumpIfSmi(object, &not_date_object); 3366 __ JumpIfSmi(object, &not_date_object);
3367 __ CmpObjectType(object, JS_DATE_TYPE, scratch); 3367 __ CmpObjectType(object, JS_DATE_TYPE, scratch);
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
3768 __ CallStub(&stub); 3768 __ CallStub(&stub);
3769 context()->Plug(rax); 3769 context()->Plug(rax);
3770 } 3770 }
3771 3771
3772 3772
3773 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { 3773 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) {
3774 ZoneList<Expression*>* args = expr->arguments(); 3774 ZoneList<Expression*>* args = expr->arguments();
3775 ASSERT_EQ(2, args->length()); 3775 ASSERT_EQ(2, args->length());
3776 3776
3777 ASSERT_NE(NULL, args->at(0)->AsLiteral()); 3777 ASSERT_NE(NULL, args->at(0)->AsLiteral());
3778 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); 3778 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->value()))->value();
3779 3779
3780 Handle<FixedArray> jsfunction_result_caches( 3780 Handle<FixedArray> jsfunction_result_caches(
3781 isolate()->native_context()->jsfunction_result_caches()); 3781 isolate()->native_context()->jsfunction_result_caches());
3782 if (jsfunction_result_caches->length() <= cache_id) { 3782 if (jsfunction_result_caches->length() <= cache_id) {
3783 __ Abort("Attempt to use undefined cache."); 3783 __ Abort("Attempt to use undefined cache.");
3784 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); 3784 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
3785 context()->Plug(rax); 3785 context()->Plug(rax);
3786 return; 3786 return;
3787 } 3787 }
3788 3788
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
4506 } 4506 }
4507 } else { 4507 } else {
4508 // Perform the assignment as if via '='. 4508 // Perform the assignment as if via '='.
4509 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 4509 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
4510 Token::ASSIGN); 4510 Token::ASSIGN);
4511 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 4511 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
4512 context()->Plug(rax); 4512 context()->Plug(rax);
4513 } 4513 }
4514 break; 4514 break;
4515 case NAMED_PROPERTY: { 4515 case NAMED_PROPERTY: {
4516 __ Move(rcx, prop->key()->AsLiteral()->handle()); 4516 __ Move(rcx, prop->key()->AsLiteral()->value());
4517 __ pop(rdx); 4517 __ pop(rdx);
4518 Handle<Code> ic = is_classic_mode() 4518 Handle<Code> ic = is_classic_mode()
4519 ? isolate()->builtins()->StoreIC_Initialize() 4519 ? isolate()->builtins()->StoreIC_Initialize()
4520 : isolate()->builtins()->StoreIC_Initialize_Strict(); 4520 : isolate()->builtins()->StoreIC_Initialize_Strict();
4521 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId()); 4521 CallIC(ic, RelocInfo::CODE_TARGET, expr->CountStoreFeedbackId());
4522 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 4522 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
4523 if (expr->is_postfix()) { 4523 if (expr->is_postfix()) {
4524 if (!context()->IsEffect()) { 4524 if (!context()->IsEffect()) {
4525 context()->PlugTOS(); 4525 context()->PlugTOS();
4526 } 4526 }
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
4909 *context_length = 0; 4909 *context_length = 0;
4910 return previous_; 4910 return previous_;
4911 } 4911 }
4912 4912
4913 4913
4914 #undef __ 4914 #undef __
4915 4915
4916 } } // namespace v8::internal 4916 } } // namespace v8::internal
4917 4917
4918 #endif // V8_TARGET_ARCH_X64 4918 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/typing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698