OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 __ Branch(&fast, eq, temp, Operand(t0)); | 1390 __ Branch(&fast, eq, temp, Operand(t0)); |
1391 // Check that extension is NULL. | 1391 // Check that extension is NULL. |
1392 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX)); | 1392 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX)); |
1393 __ Branch(slow, ne, temp, Operand(zero_reg)); | 1393 __ Branch(slow, ne, temp, Operand(zero_reg)); |
1394 // Load next context in chain. | 1394 // Load next context in chain. |
1395 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); | 1395 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); |
1396 __ Branch(&loop); | 1396 __ Branch(&loop); |
1397 __ bind(&fast); | 1397 __ bind(&fast); |
1398 } | 1398 } |
1399 | 1399 |
1400 __ lw(a0, GlobalObjectOperand()); | 1400 __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
1401 __ li(a2, Operand(var->name())); | 1401 __ li(LoadIC::NameRegister(), Operand(var->name())); |
1402 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) | 1402 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
1403 ? NOT_CONTEXTUAL | 1403 ? NOT_CONTEXTUAL |
1404 : CONTEXTUAL; | 1404 : CONTEXTUAL; |
1405 CallLoadIC(mode); | 1405 CallLoadIC(mode); |
1406 } | 1406 } |
1407 | 1407 |
1408 | 1408 |
1409 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1409 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1410 Label* slow) { | 1410 Label* slow) { |
1411 ASSERT(var->IsContextSlot()); | 1411 ASSERT(var->IsContextSlot()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { | 1473 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
1474 // Record position before possible IC call. | 1474 // Record position before possible IC call. |
1475 SetSourcePosition(proxy->position()); | 1475 SetSourcePosition(proxy->position()); |
1476 Variable* var = proxy->var(); | 1476 Variable* var = proxy->var(); |
1477 | 1477 |
1478 // Three cases: global variables, lookup variables, and all other types of | 1478 // Three cases: global variables, lookup variables, and all other types of |
1479 // variables. | 1479 // variables. |
1480 switch (var->location()) { | 1480 switch (var->location()) { |
1481 case Variable::UNALLOCATED: { | 1481 case Variable::UNALLOCATED: { |
1482 Comment cmnt(masm_, "[ Global variable"); | 1482 Comment cmnt(masm_, "[ Global variable"); |
1483 // Use inline caching. Variable name is passed in a2 and the global | 1483 __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
1484 // object (receiver) in a0. | 1484 __ li(LoadIC::NameRegister(), Operand(var->name())); |
1485 __ lw(a0, GlobalObjectOperand()); | |
1486 __ li(a2, Operand(var->name())); | |
1487 CallLoadIC(CONTEXTUAL); | 1485 CallLoadIC(CONTEXTUAL); |
1488 context()->Plug(v0); | 1486 context()->Plug(v0); |
1489 break; | 1487 break; |
1490 } | 1488 } |
1491 | 1489 |
1492 case Variable::PARAMETER: | 1490 case Variable::PARAMETER: |
1493 case Variable::LOCAL: | 1491 case Variable::LOCAL: |
1494 case Variable::CONTEXT: { | 1492 case Variable::CONTEXT: { |
1495 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" | 1493 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" |
1496 : "[ Stack variable"); | 1494 : "[ Stack variable"); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 } | 2014 } |
2017 | 2015 |
2018 case Yield::DELEGATING: { | 2016 case Yield::DELEGATING: { |
2019 VisitForStackValue(expr->generator_object()); | 2017 VisitForStackValue(expr->generator_object()); |
2020 | 2018 |
2021 // Initial stack layout is as follows: | 2019 // Initial stack layout is as follows: |
2022 // [sp + 1 * kPointerSize] iter | 2020 // [sp + 1 * kPointerSize] iter |
2023 // [sp + 0 * kPointerSize] g | 2021 // [sp + 0 * kPointerSize] g |
2024 | 2022 |
2025 Label l_catch, l_try, l_suspend, l_continuation, l_resume; | 2023 Label l_catch, l_try, l_suspend, l_continuation, l_resume; |
2026 Label l_next, l_call, l_loop; | 2024 Label l_next, l_call; |
2027 // Initial send value is undefined. | 2025 // Initial send value is undefined. |
2028 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); | 2026 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); |
2029 __ Branch(&l_next); | 2027 __ Branch(&l_next); |
2030 | 2028 |
2031 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } | 2029 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } |
2032 __ bind(&l_catch); | 2030 __ bind(&l_catch); |
2033 __ mov(a0, v0); | 2031 __ mov(a0, v0); |
2034 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); | 2032 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); |
2035 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw" | 2033 __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw" |
2036 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2034 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
(...skipping 26 matching lines...) Expand all Loading... |
2063 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2061 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
2064 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2062 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2065 __ pop(v0); // result | 2063 __ pop(v0); // result |
2066 EmitReturnSequence(); | 2064 EmitReturnSequence(); |
2067 __ mov(a0, v0); | 2065 __ mov(a0, v0); |
2068 __ bind(&l_resume); // received in a0 | 2066 __ bind(&l_resume); // received in a0 |
2069 __ PopTryHandler(); | 2067 __ PopTryHandler(); |
2070 | 2068 |
2071 // receiver = iter; f = 'next'; arg = received; | 2069 // receiver = iter; f = 'next'; arg = received; |
2072 __ bind(&l_next); | 2070 __ bind(&l_next); |
| 2071 Register keyedload_receiver = KeyedLoadIC::ReceiverRegister(); |
| 2072 Register keyedload_name = KeyedLoadIC::NameRegister(); |
| 2073 ASSERT(keyedload_receiver.is(a1)); |
| 2074 ASSERT(keyedload_name.is(a0)); |
| 2075 |
2073 __ LoadRoot(a2, Heap::knext_stringRootIndex); // "next" | 2076 __ LoadRoot(a2, Heap::knext_stringRootIndex); // "next" |
2074 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2077 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2075 __ Push(a2, a3, a0); // "next", iter, received | 2078 __ Push(a2, a3, a0); // "next", iter, received |
2076 | 2079 |
2077 // result = receiver[f](arg); | 2080 // result = receiver[f](arg); |
2078 __ bind(&l_call); | 2081 __ bind(&l_call); |
2079 __ lw(a1, MemOperand(sp, kPointerSize)); | 2082 __ lw(keyedload_receiver, MemOperand(sp, kPointerSize)); |
2080 __ lw(a0, MemOperand(sp, 2 * kPointerSize)); | 2083 __ lw(keyedload_name, MemOperand(sp, 2 * kPointerSize)); |
2081 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2084 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2082 CallIC(ic, TypeFeedbackId::None()); | 2085 CallIC(ic, TypeFeedbackId::None()); |
2083 __ mov(a0, v0); | 2086 __ mov(a0, v0); |
2084 __ mov(a1, a0); | 2087 __ mov(a1, a0); |
2085 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); | 2088 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); |
2086 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2089 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
2087 __ CallStub(&stub); | 2090 __ CallStub(&stub); |
2088 | 2091 |
2089 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2092 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2090 __ Drop(1); // The function is still on the stack; drop it. | 2093 __ Drop(1); // The function is still on the stack; drop it. |
2091 | 2094 |
2092 // if (!result.done) goto l_try; | 2095 // if (!result.done) goto l_try; |
2093 __ bind(&l_loop); | 2096 Register load_receiver = LoadIC::ReceiverRegister(); |
2094 __ mov(a0, v0); | 2097 Register load_name = LoadIC::NameRegister(); |
2095 __ push(a0); // save result | 2098 ASSERT(load_receiver.is(a0)); |
2096 __ LoadRoot(a2, Heap::kdone_stringRootIndex); // "done" | 2099 ASSERT(load_name.is(a2)); |
2097 CallLoadIC(NOT_CONTEXTUAL); // result.done in v0 | 2100 |
2098 __ mov(a0, v0); | 2101 __ mov(load_receiver, v0); |
| 2102 __ push(v0); // save result |
| 2103 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
| 2104 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done |
| 2105 __ mov(load_receiver, v0); |
2099 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2106 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
2100 CallIC(bool_ic); | 2107 CallIC(bool_ic); |
2101 __ Branch(&l_try, eq, v0, Operand(zero_reg)); | 2108 __ Branch(&l_try, eq, v0, Operand(zero_reg)); |
2102 | 2109 |
2103 // result.value | 2110 // result.value |
2104 __ pop(a0); // result | 2111 __ pop(load_receiver); // result |
2105 __ LoadRoot(a2, Heap::kvalue_stringRootIndex); // "value" | 2112 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
2106 CallLoadIC(NOT_CONTEXTUAL); // result.value in v0 | 2113 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value |
2107 context()->DropAndPlug(2, v0); // drop iter and g | 2114 context()->DropAndPlug(2, v0); // drop iter and g |
2108 break; | 2115 break; |
2109 } | 2116 } |
2110 } | 2117 } |
2111 } | 2118 } |
2112 | 2119 |
2113 | 2120 |
2114 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, | 2121 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
2115 Expression *value, | 2122 Expression *value, |
2116 JSGeneratorObject::ResumeMode resume_mode) { | 2123 JSGeneratorObject::ResumeMode resume_mode) { |
2117 // The value stays in a0, and is ultimately read by the resumed generator, as | 2124 // The value stays in a0, and is ultimately read by the resumed generator, as |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2258 // Only the value field needs a write barrier, as the other values are in the | 2265 // Only the value field needs a write barrier, as the other values are in the |
2259 // root set. | 2266 // root set. |
2260 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, | 2267 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, |
2261 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); | 2268 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); |
2262 } | 2269 } |
2263 | 2270 |
2264 | 2271 |
2265 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2272 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2266 SetSourcePosition(prop->position()); | 2273 SetSourcePosition(prop->position()); |
2267 Literal* key = prop->key()->AsLiteral(); | 2274 Literal* key = prop->key()->AsLiteral(); |
2268 __ mov(a0, result_register()); | 2275 __ mov(LoadIC::ReceiverRegister(), result_register()); |
2269 __ li(a2, Operand(key->value())); | 2276 __ li(LoadIC::NameRegister(), Operand(key->value())); |
2270 // Call load IC. It has arguments receiver and property name a0 and a2. | 2277 // Call load IC. It has register arguments receiver and property. |
2271 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2278 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
2272 } | 2279 } |
2273 | 2280 |
2274 | 2281 |
2275 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2282 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2276 SetSourcePosition(prop->position()); | 2283 SetSourcePosition(prop->position()); |
2277 __ mov(a0, result_register()); | 2284 __ mov(a0, result_register()); |
2278 // Call keyed load IC. It has arguments key and receiver in a0 and a1. | 2285 // Call keyed load IC. It has register arguments receiver and key. |
2279 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2286 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2280 CallIC(ic, prop->PropertyFeedbackId()); | 2287 CallIC(ic, prop->PropertyFeedbackId()); |
2281 } | 2288 } |
2282 | 2289 |
2283 | 2290 |
2284 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2291 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2285 Token::Value op, | 2292 Token::Value op, |
2286 OverwriteMode mode, | 2293 OverwriteMode mode, |
2287 Expression* left_expr, | 2294 Expression* left_expr, |
2288 Expression* right_expr) { | 2295 Expression* right_expr) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 context()->Plug(v0); | 2573 context()->Plug(v0); |
2567 } | 2574 } |
2568 | 2575 |
2569 | 2576 |
2570 void FullCodeGenerator::VisitProperty(Property* expr) { | 2577 void FullCodeGenerator::VisitProperty(Property* expr) { |
2571 Comment cmnt(masm_, "[ Property"); | 2578 Comment cmnt(masm_, "[ Property"); |
2572 Expression* key = expr->key(); | 2579 Expression* key = expr->key(); |
2573 | 2580 |
2574 if (key->IsPropertyName()) { | 2581 if (key->IsPropertyName()) { |
2575 VisitForAccumulatorValue(expr->obj()); | 2582 VisitForAccumulatorValue(expr->obj()); |
| 2583 ASSERT(a0.is(LoadIC::ReceiverRegister())); |
2576 EmitNamedPropertyLoad(expr); | 2584 EmitNamedPropertyLoad(expr); |
2577 PrepareForBailoutForId(expr->LoadId(), TOS_REG); | 2585 PrepareForBailoutForId(expr->LoadId(), TOS_REG); |
2578 context()->Plug(v0); | 2586 context()->Plug(v0); |
2579 } else { | 2587 } else { |
2580 VisitForStackValue(expr->obj()); | 2588 VisitForStackValue(expr->obj()); |
2581 VisitForAccumulatorValue(expr->key()); | 2589 VisitForAccumulatorValue(expr->key()); |
2582 __ pop(a1); | 2590 ASSERT(a0.is(KeyedLoadIC::NameRegister())); |
| 2591 ASSERT(a1.is(KeyedLoadIC::ReceiverRegister())); |
| 2592 __ pop(KeyedLoadIC::ReceiverRegister()); |
2583 EmitKeyedPropertyLoad(expr); | 2593 EmitKeyedPropertyLoad(expr); |
2584 context()->Plug(v0); | 2594 context()->Plug(v0); |
2585 } | 2595 } |
2586 } | 2596 } |
2587 | 2597 |
2588 | 2598 |
2589 void FullCodeGenerator::CallIC(Handle<Code> code, | 2599 void FullCodeGenerator::CallIC(Handle<Code> code, |
2590 TypeFeedbackId id) { | 2600 TypeFeedbackId id) { |
2591 ic_total_count_++; | 2601 ic_total_count_++; |
2592 __ Call(code, RelocInfo::CODE_TARGET, id); | 2602 __ Call(code, RelocInfo::CODE_TARGET, id); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2624 | 2634 |
2625 EmitCall(expr, call_type); | 2635 EmitCall(expr, call_type); |
2626 } | 2636 } |
2627 | 2637 |
2628 | 2638 |
2629 // Code common for calls using the IC. | 2639 // Code common for calls using the IC. |
2630 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, | 2640 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, |
2631 Expression* key) { | 2641 Expression* key) { |
2632 // Load the key. | 2642 // Load the key. |
2633 VisitForAccumulatorValue(key); | 2643 VisitForAccumulatorValue(key); |
| 2644 ASSERT(a0.is(KeyedLoadIC::NameRegister())); |
2634 | 2645 |
2635 Expression* callee = expr->expression(); | 2646 Expression* callee = expr->expression(); |
2636 | 2647 |
2637 // Load the function from the receiver. | 2648 // Load the function from the receiver. |
2638 ASSERT(callee->IsProperty()); | 2649 ASSERT(callee->IsProperty()); |
2639 __ lw(a1, MemOperand(sp, 0)); | 2650 __ lw(KeyedLoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
2640 EmitKeyedPropertyLoad(callee->AsProperty()); | 2651 EmitKeyedPropertyLoad(callee->AsProperty()); |
2641 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); | 2652 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
2642 | 2653 |
2643 // Push the target function under the receiver. | 2654 // Push the target function under the receiver. |
2644 __ lw(at, MemOperand(sp, 0)); | 2655 __ lw(at, MemOperand(sp, 0)); |
2645 __ push(at); | 2656 __ push(at); |
2646 __ sw(v0, MemOperand(sp, kPointerSize)); | 2657 __ sw(v0, MemOperand(sp, kPointerSize)); |
2647 | 2658 |
2648 EmitCall(expr, CallIC::METHOD); | 2659 EmitCall(expr, CallIC::METHOD); |
2649 } | 2660 } |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4078 | 4089 |
4079 Comment cmnt(masm_, "[ CallRuntime"); | 4090 Comment cmnt(masm_, "[ CallRuntime"); |
4080 ZoneList<Expression*>* args = expr->arguments(); | 4091 ZoneList<Expression*>* args = expr->arguments(); |
4081 int arg_count = args->length(); | 4092 int arg_count = args->length(); |
4082 | 4093 |
4083 if (expr->is_jsruntime()) { | 4094 if (expr->is_jsruntime()) { |
4084 // Push the builtins object as the receiver. | 4095 // Push the builtins object as the receiver. |
4085 __ lw(a0, GlobalObjectOperand()); | 4096 __ lw(a0, GlobalObjectOperand()); |
4086 __ lw(a0, FieldMemOperand(a0, GlobalObject::kBuiltinsOffset)); | 4097 __ lw(a0, FieldMemOperand(a0, GlobalObject::kBuiltinsOffset)); |
4087 __ push(a0); | 4098 __ push(a0); |
| 4099 |
4088 // Load the function from the receiver. | 4100 // Load the function from the receiver. |
4089 __ li(a2, Operand(expr->name())); | 4101 ASSERT(a0.is(LoadIC::ReceiverRegister())); |
| 4102 __ li(LoadIC::NameRegister(), Operand(expr->name())); |
4090 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 4103 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
4091 | 4104 |
4092 // Push the target function under the receiver. | 4105 // Push the target function under the receiver. |
4093 __ lw(at, MemOperand(sp, 0)); | 4106 __ lw(at, MemOperand(sp, 0)); |
4094 __ push(at); | 4107 __ push(at); |
4095 __ sw(v0, MemOperand(sp, kPointerSize)); | 4108 __ sw(v0, MemOperand(sp, kPointerSize)); |
4096 | 4109 |
4097 // Push the arguments ("left-to-right"). | 4110 // Push the arguments ("left-to-right"). |
4098 int arg_count = args->length(); | 4111 int arg_count = args->length(); |
4099 for (int i = 0; i < arg_count; i++) { | 4112 for (int i = 0; i < arg_count; i++) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4263 __ push(at); | 4276 __ push(at); |
4264 } | 4277 } |
4265 if (assign_type == NAMED_PROPERTY) { | 4278 if (assign_type == NAMED_PROPERTY) { |
4266 // Put the object both on the stack and in the accumulator. | 4279 // Put the object both on the stack and in the accumulator. |
4267 VisitForAccumulatorValue(prop->obj()); | 4280 VisitForAccumulatorValue(prop->obj()); |
4268 __ push(v0); | 4281 __ push(v0); |
4269 EmitNamedPropertyLoad(prop); | 4282 EmitNamedPropertyLoad(prop); |
4270 } else { | 4283 } else { |
4271 VisitForStackValue(prop->obj()); | 4284 VisitForStackValue(prop->obj()); |
4272 VisitForAccumulatorValue(prop->key()); | 4285 VisitForAccumulatorValue(prop->key()); |
4273 __ lw(a1, MemOperand(sp, 0)); | 4286 ASSERT(a1.is(KeyedLoadIC::ReceiverRegister())); |
| 4287 __ lw(KeyedLoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
4274 __ push(v0); | 4288 __ push(v0); |
4275 EmitKeyedPropertyLoad(prop); | 4289 EmitKeyedPropertyLoad(prop); |
4276 } | 4290 } |
4277 } | 4291 } |
4278 | 4292 |
4279 // We need a second deoptimization point after loading the value | 4293 // We need a second deoptimization point after loading the value |
4280 // in case evaluating the property load my have a side effect. | 4294 // in case evaluating the property load my have a side effect. |
4281 if (assign_type == VARIABLE) { | 4295 if (assign_type == VARIABLE) { |
4282 PrepareForBailout(expr->expression(), TOS_REG); | 4296 PrepareForBailout(expr->expression(), TOS_REG); |
4283 } else { | 4297 } else { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4416 } | 4430 } |
4417 } | 4431 } |
4418 | 4432 |
4419 | 4433 |
4420 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4434 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
4421 ASSERT(!context()->IsEffect()); | 4435 ASSERT(!context()->IsEffect()); |
4422 ASSERT(!context()->IsTest()); | 4436 ASSERT(!context()->IsTest()); |
4423 VariableProxy* proxy = expr->AsVariableProxy(); | 4437 VariableProxy* proxy = expr->AsVariableProxy(); |
4424 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4438 if (proxy != NULL && proxy->var()->IsUnallocated()) { |
4425 Comment cmnt(masm_, "[ Global variable"); | 4439 Comment cmnt(masm_, "[ Global variable"); |
4426 __ lw(a0, GlobalObjectOperand()); | 4440 __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
4427 __ li(a2, Operand(proxy->name())); | 4441 __ li(LoadIC::NameRegister(), Operand(proxy->name())); |
4428 // Use a regular load, not a contextual load, to avoid a reference | 4442 // Use a regular load, not a contextual load, to avoid a reference |
4429 // error. | 4443 // error. |
4430 CallLoadIC(NOT_CONTEXTUAL); | 4444 CallLoadIC(NOT_CONTEXTUAL); |
4431 PrepareForBailout(expr, TOS_REG); | 4445 PrepareForBailout(expr, TOS_REG); |
4432 context()->Plug(v0); | 4446 context()->Plug(v0); |
4433 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 4447 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
4434 Comment cmnt(masm_, "[ Lookup slot"); | 4448 Comment cmnt(masm_, "[ Lookup slot"); |
4435 Label done, slow; | 4449 Label done, slow; |
4436 | 4450 |
4437 // Generate code for loading from variables potentially shadowed | 4451 // Generate code for loading from variables potentially shadowed |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4854 Assembler::target_address_at(pc_immediate_load_address)) == | 4868 Assembler::target_address_at(pc_immediate_load_address)) == |
4855 reinterpret_cast<uint32_t>( | 4869 reinterpret_cast<uint32_t>( |
4856 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4870 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4857 return OSR_AFTER_STACK_CHECK; | 4871 return OSR_AFTER_STACK_CHECK; |
4858 } | 4872 } |
4859 | 4873 |
4860 | 4874 |
4861 } } // namespace v8::internal | 4875 } } // namespace v8::internal |
4862 | 4876 |
4863 #endif // V8_TARGET_ARCH_MIPS | 4877 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |