| 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 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4370 Property* property = expression_->AsProperty(); | 4370 Property* property = expression_->AsProperty(); |
| 4371 if (property != NULL) { | 4371 if (property != NULL) { |
| 4372 cgen_->CodeForSourcePosition(property->position()); | 4372 cgen_->CodeForSourcePosition(property->position()); |
| 4373 } | 4373 } |
| 4374 | 4374 |
| 4375 switch (type_) { | 4375 switch (type_) { |
| 4376 case SLOT: { | 4376 case SLOT: { |
| 4377 Comment cmnt(masm, "[ Store to Slot"); | 4377 Comment cmnt(masm, "[ Store to Slot"); |
| 4378 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); | 4378 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); |
| 4379 cgen_->StoreToSlot(slot, init_state); | 4379 cgen_->StoreToSlot(slot, init_state); |
| 4380 cgen_->UnloadReference(this); |
| 4380 break; | 4381 break; |
| 4381 } | 4382 } |
| 4382 | 4383 |
| 4383 case NAMED: { | 4384 case NAMED: { |
| 4384 Comment cmnt(masm, "[ Store to named Property"); | 4385 Comment cmnt(masm, "[ Store to named Property"); |
| 4385 // Call the appropriate IC code. | 4386 // Call the appropriate IC code. |
| 4386 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | 4387 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
| 4387 Handle<String> name(GetName()); | 4388 Handle<String> name(GetName()); |
| 4388 | 4389 |
| 4389 Result value(r0); | 4390 Result value(r0); |
| 4390 frame->EmitPop(r0); | 4391 frame->EmitPop(r0); |
| 4391 | 4392 |
| 4392 // Setup the name register. | 4393 // Setup the name register. |
| 4393 Result property_name(r2); | 4394 Result property_name(r2); |
| 4394 __ mov(r2, Operand(name)); | 4395 __ mov(r2, Operand(name)); |
| 4395 frame->CallCodeObject(ic, | 4396 frame->CallCodeObject(ic, |
| 4396 RelocInfo::CODE_TARGET, | 4397 RelocInfo::CODE_TARGET, |
| 4397 &value, | 4398 &value, |
| 4398 &property_name, | 4399 &property_name, |
| 4399 0); | 4400 0); |
| 4400 frame->EmitPush(r0); | 4401 frame->EmitPush(r0); |
| 4402 cgen_->UnloadReference(this); |
| 4401 break; | 4403 break; |
| 4402 } | 4404 } |
| 4403 | 4405 |
| 4404 case KEYED: { | 4406 case KEYED: { |
| 4405 Comment cmnt(masm, "[ Store to keyed Property"); | 4407 Comment cmnt(masm, "[ Store to keyed Property"); |
| 4406 Property* property = expression_->AsProperty(); | 4408 Property* property = expression_->AsProperty(); |
| 4407 ASSERT(property != NULL); | 4409 ASSERT(property != NULL); |
| 4408 cgen_->CodeForSourcePosition(property->position()); | 4410 cgen_->CodeForSourcePosition(property->position()); |
| 4409 | 4411 |
| 4410 // Call IC code. | 4412 // Call IC code. |
| 4411 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); | 4413 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); |
| 4412 // TODO(1222589): Make the IC grab the values from the stack. | 4414 // TODO(1222589): Make the IC grab the values from the stack. |
| 4413 Result value(r0); | 4415 Result value(r0); |
| 4414 frame->EmitPop(r0); // value | 4416 frame->EmitPop(r0); // value |
| 4415 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, &value, 0); | 4417 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, &value, 0); |
| 4416 frame->EmitPush(r0); | 4418 frame->EmitPush(r0); |
| 4419 cgen_->UnloadReference(this); |
| 4417 break; | 4420 break; |
| 4418 } | 4421 } |
| 4419 | 4422 |
| 4420 default: | 4423 default: |
| 4421 UNREACHABLE(); | 4424 UNREACHABLE(); |
| 4422 } | 4425 } |
| 4423 cgen_->UnloadReference(this); | |
| 4424 } | 4426 } |
| 4425 | 4427 |
| 4426 | 4428 |
| 4427 void FastNewClosureStub::Generate(MacroAssembler* masm) { | 4429 void FastNewClosureStub::Generate(MacroAssembler* masm) { |
| 4428 // Clone the boilerplate in new space. Set the context to the | 4430 // Clone the boilerplate in new space. Set the context to the |
| 4429 // current context in cp. | 4431 // current context in cp. |
| 4430 Label gc; | 4432 Label gc; |
| 4431 | 4433 |
| 4432 // Pop the boilerplate function from the stack. | 4434 // Pop the boilerplate function from the stack. |
| 4433 __ pop(r3); | 4435 __ pop(r3); |
| (...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6939 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 6941 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
| 6940 // tagged as a small integer. | 6942 // tagged as a small integer. |
| 6941 __ bind(&runtime); | 6943 __ bind(&runtime); |
| 6942 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 6944 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
| 6943 } | 6945 } |
| 6944 | 6946 |
| 6945 | 6947 |
| 6946 #undef __ | 6948 #undef __ |
| 6947 | 6949 |
| 6948 } } // namespace v8::internal | 6950 } } // namespace v8::internal |
| OLD | NEW |