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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 VisitStatements(clause->statements()); | 1095 VisitStatements(clause->statements()); |
1096 } | 1096 } |
1097 | 1097 |
1098 __ bind(nested_statement.break_label()); | 1098 __ bind(nested_statement.break_label()); |
1099 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1099 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1100 } | 1100 } |
1101 | 1101 |
1102 | 1102 |
1103 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 1103 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
1104 Comment cmnt(masm_, "[ ForInStatement"); | 1104 Comment cmnt(masm_, "[ ForInStatement"); |
1105 int slot = stmt->ForInFeedbackSlot(); | 1105 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
1106 SetStatementPosition(stmt); | 1106 SetStatementPosition(stmt); |
1107 | 1107 |
1108 Label loop, exit; | 1108 Label loop, exit; |
1109 ForIn loop_statement(this, stmt); | 1109 ForIn loop_statement(this, stmt); |
1110 increment_loop_depth(); | 1110 increment_loop_depth(); |
1111 | 1111 |
1112 // Get the object to enumerate over. If the object is null or undefined, skip | 1112 // Get the object to enumerate over. If the object is null or undefined, skip |
1113 // over the loop. See ECMA-262 version 5, section 12.6.4. | 1113 // over the loop. See ECMA-262 version 5, section 12.6.4. |
1114 VisitForAccumulatorValue(stmt->enumerable()); | 1114 VisitForAccumulatorValue(stmt->enumerable()); |
1115 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 1115 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 __ bind(&no_descriptors); | 1187 __ bind(&no_descriptors); |
1188 __ Drop(1); | 1188 __ Drop(1); |
1189 __ jmp(&exit); | 1189 __ jmp(&exit); |
1190 | 1190 |
1191 // We got a fixed array in register r0. Iterate through that. | 1191 // We got a fixed array in register r0. Iterate through that. |
1192 Label non_proxy; | 1192 Label non_proxy; |
1193 __ bind(&fixed_array); | 1193 __ bind(&fixed_array); |
1194 | 1194 |
1195 __ Move(r1, FeedbackVector()); | 1195 __ Move(r1, FeedbackVector()); |
1196 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1196 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1197 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot))); | 1197 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot.ToInt()))); |
1198 | 1198 |
1199 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1199 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
1200 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1200 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
1201 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1201 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1202 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); | 1202 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); |
1203 __ b(gt, &non_proxy); | 1203 __ b(gt, &non_proxy); |
1204 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1204 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1205 __ bind(&non_proxy); | 1205 __ bind(&non_proxy); |
1206 __ Push(r1, r0); // Smi and array | 1206 __ Push(r1, r0); // Smi and array |
1207 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); | 1207 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 Comment cnmt(masm_, "[ SuperReference "); | 1359 Comment cnmt(masm_, "[ SuperReference "); |
1360 | 1360 |
1361 __ ldr(LoadDescriptor::ReceiverRegister(), | 1361 __ ldr(LoadDescriptor::ReceiverRegister(), |
1362 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1362 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1363 | 1363 |
1364 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); | 1364 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
1365 __ Move(LoadDescriptor::NameRegister(), home_object_symbol); | 1365 __ Move(LoadDescriptor::NameRegister(), home_object_symbol); |
1366 | 1366 |
1367 if (FLAG_vector_ics) { | 1367 if (FLAG_vector_ics) { |
1368 __ mov(VectorLoadICDescriptor::SlotRegister(), | 1368 __ mov(VectorLoadICDescriptor::SlotRegister(), |
1369 Operand(Smi::FromInt(expr->HomeObjectFeedbackSlot()))); | 1369 Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot()))); |
1370 CallLoadIC(NOT_CONTEXTUAL); | 1370 CallLoadIC(NOT_CONTEXTUAL); |
1371 } else { | 1371 } else { |
1372 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); | 1372 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); |
1373 } | 1373 } |
1374 | 1374 |
1375 __ cmp(r0, Operand(isolate()->factory()->undefined_value())); | 1375 __ cmp(r0, Operand(isolate()->factory()->undefined_value())); |
1376 Label done; | 1376 Label done; |
1377 __ b(ne, &done); | 1377 __ b(ne, &done); |
1378 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1378 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
1379 __ bind(&done); | 1379 __ bind(&done); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 // Load next context in chain. | 1425 // Load next context in chain. |
1426 __ ldr(next, ContextOperand(next, Context::PREVIOUS_INDEX)); | 1426 __ ldr(next, ContextOperand(next, Context::PREVIOUS_INDEX)); |
1427 __ b(&loop); | 1427 __ b(&loop); |
1428 __ bind(&fast); | 1428 __ bind(&fast); |
1429 } | 1429 } |
1430 | 1430 |
1431 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1431 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1432 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); | 1432 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); |
1433 if (FLAG_vector_ics) { | 1433 if (FLAG_vector_ics) { |
1434 __ mov(VectorLoadICDescriptor::SlotRegister(), | 1434 __ mov(VectorLoadICDescriptor::SlotRegister(), |
1435 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1435 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1436 } | 1436 } |
1437 | 1437 |
1438 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) | 1438 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
1439 ? NOT_CONTEXTUAL | 1439 ? NOT_CONTEXTUAL |
1440 : CONTEXTUAL; | 1440 : CONTEXTUAL; |
1441 CallLoadIC(mode); | 1441 CallLoadIC(mode); |
1442 } | 1442 } |
1443 | 1443 |
1444 | 1444 |
1445 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1445 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 | 1514 |
1515 // Three cases: global variables, lookup variables, and all other types of | 1515 // Three cases: global variables, lookup variables, and all other types of |
1516 // variables. | 1516 // variables. |
1517 switch (var->location()) { | 1517 switch (var->location()) { |
1518 case Variable::UNALLOCATED: { | 1518 case Variable::UNALLOCATED: { |
1519 Comment cmnt(masm_, "[ Global variable"); | 1519 Comment cmnt(masm_, "[ Global variable"); |
1520 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1520 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1521 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); | 1521 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
1522 if (FLAG_vector_ics) { | 1522 if (FLAG_vector_ics) { |
1523 __ mov(VectorLoadICDescriptor::SlotRegister(), | 1523 __ mov(VectorLoadICDescriptor::SlotRegister(), |
1524 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1524 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1525 } | 1525 } |
1526 CallLoadIC(CONTEXTUAL); | 1526 CallLoadIC(CONTEXTUAL); |
1527 context()->Plug(r0); | 1527 context()->Plug(r0); |
1528 break; | 1528 break; |
1529 } | 1529 } |
1530 | 1530 |
1531 case Variable::PARAMETER: | 1531 case Variable::PARAMETER: |
1532 case Variable::LOCAL: | 1532 case Variable::LOCAL: |
1533 case Variable::CONTEXT: { | 1533 case Variable::CONTEXT: { |
1534 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" | 1534 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2143 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
2144 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter | 2144 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
2145 __ Push(load_name, r3, r0); // "next", iter, received | 2145 __ Push(load_name, r3, r0); // "next", iter, received |
2146 | 2146 |
2147 // result = receiver[f](arg); | 2147 // result = receiver[f](arg); |
2148 __ bind(&l_call); | 2148 __ bind(&l_call); |
2149 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); | 2149 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); |
2150 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); | 2150 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); |
2151 if (FLAG_vector_ics) { | 2151 if (FLAG_vector_ics) { |
2152 __ mov(VectorLoadICDescriptor::SlotRegister(), | 2152 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2153 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); | 2153 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
2154 } | 2154 } |
2155 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2155 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2156 CallIC(ic, TypeFeedbackId::None()); | 2156 CallIC(ic, TypeFeedbackId::None()); |
2157 __ mov(r1, r0); | 2157 __ mov(r1, r0); |
2158 __ str(r1, MemOperand(sp, 2 * kPointerSize)); | 2158 __ str(r1, MemOperand(sp, 2 * kPointerSize)); |
2159 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2159 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
2160 __ CallStub(&stub); | 2160 __ CallStub(&stub); |
2161 | 2161 |
2162 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2162 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2163 __ Drop(1); // The function is still on the stack; drop it. | 2163 __ Drop(1); // The function is still on the stack; drop it. |
2164 | 2164 |
2165 // if (!result.done) goto l_try; | 2165 // if (!result.done) goto l_try; |
2166 __ bind(&l_loop); | 2166 __ bind(&l_loop); |
2167 __ Move(load_receiver, r0); | 2167 __ Move(load_receiver, r0); |
2168 | 2168 |
2169 __ push(load_receiver); // save result | 2169 __ push(load_receiver); // save result |
2170 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 2170 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
2171 if (FLAG_vector_ics) { | 2171 if (FLAG_vector_ics) { |
2172 __ mov(VectorLoadICDescriptor::SlotRegister(), | 2172 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2173 Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); | 2173 Operand(SmiFromSlot(expr->DoneFeedbackSlot()))); |
2174 } | 2174 } |
2175 CallLoadIC(NOT_CONTEXTUAL); // r0=result.done | 2175 CallLoadIC(NOT_CONTEXTUAL); // r0=result.done |
2176 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2176 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
2177 CallIC(bool_ic); | 2177 CallIC(bool_ic); |
2178 __ cmp(r0, Operand(0)); | 2178 __ cmp(r0, Operand(0)); |
2179 __ b(eq, &l_try); | 2179 __ b(eq, &l_try); |
2180 | 2180 |
2181 // result.value | 2181 // result.value |
2182 __ pop(load_receiver); // result | 2182 __ pop(load_receiver); // result |
2183 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 2183 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
2184 if (FLAG_vector_ics) { | 2184 if (FLAG_vector_ics) { |
2185 __ mov(VectorLoadICDescriptor::SlotRegister(), | 2185 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2186 Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); | 2186 Operand(SmiFromSlot(expr->ValueFeedbackSlot()))); |
2187 } | 2187 } |
2188 CallLoadIC(NOT_CONTEXTUAL); // r0=result.value | 2188 CallLoadIC(NOT_CONTEXTUAL); // r0=result.value |
2189 context()->DropAndPlug(2, r0); // drop iter and g | 2189 context()->DropAndPlug(2, r0); // drop iter and g |
2190 break; | 2190 break; |
2191 } | 2191 } |
2192 } | 2192 } |
2193 } | 2193 } |
2194 | 2194 |
2195 | 2195 |
2196 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, | 2196 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 | 2357 |
2358 | 2358 |
2359 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2359 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2360 SetSourcePosition(prop->position()); | 2360 SetSourcePosition(prop->position()); |
2361 Literal* key = prop->key()->AsLiteral(); | 2361 Literal* key = prop->key()->AsLiteral(); |
2362 DCHECK(!prop->IsSuperAccess()); | 2362 DCHECK(!prop->IsSuperAccess()); |
2363 | 2363 |
2364 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2364 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
2365 if (FLAG_vector_ics) { | 2365 if (FLAG_vector_ics) { |
2366 __ mov(VectorLoadICDescriptor::SlotRegister(), | 2366 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2367 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2367 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2368 CallLoadIC(NOT_CONTEXTUAL); | 2368 CallLoadIC(NOT_CONTEXTUAL); |
2369 } else { | 2369 } else { |
2370 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2370 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
2371 } | 2371 } |
2372 } | 2372 } |
2373 | 2373 |
2374 | 2374 |
2375 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2375 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2376 // Stack: receiver, home_object. | 2376 // Stack: receiver, home_object. |
2377 SetSourcePosition(prop->position()); | 2377 SetSourcePosition(prop->position()); |
2378 Literal* key = prop->key()->AsLiteral(); | 2378 Literal* key = prop->key()->AsLiteral(); |
2379 DCHECK(!key->value()->IsSmi()); | 2379 DCHECK(!key->value()->IsSmi()); |
2380 DCHECK(prop->IsSuperAccess()); | 2380 DCHECK(prop->IsSuperAccess()); |
2381 | 2381 |
2382 __ Push(key->value()); | 2382 __ Push(key->value()); |
2383 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2383 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
2384 } | 2384 } |
2385 | 2385 |
2386 | 2386 |
2387 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2387 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2388 SetSourcePosition(prop->position()); | 2388 SetSourcePosition(prop->position()); |
2389 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2389 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2390 if (FLAG_vector_ics) { | 2390 if (FLAG_vector_ics) { |
2391 __ mov(VectorLoadICDescriptor::SlotRegister(), | 2391 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2392 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2392 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2393 CallIC(ic); | 2393 CallIC(ic); |
2394 } else { | 2394 } else { |
2395 CallIC(ic, prop->PropertyFeedbackId()); | 2395 CallIC(ic, prop->PropertyFeedbackId()); |
2396 } | 2396 } |
2397 } | 2397 } |
2398 | 2398 |
2399 | 2399 |
2400 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2400 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2401 // Stack: receiver, home_object, key. | 2401 // Stack: receiver, home_object, key. |
2402 SetSourcePosition(prop->position()); | 2402 SetSourcePosition(prop->position()); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2889 { PreservePositionScope scope(masm()->positions_recorder()); | 2889 { PreservePositionScope scope(masm()->positions_recorder()); |
2890 for (int i = 0; i < arg_count; i++) { | 2890 for (int i = 0; i < arg_count; i++) { |
2891 VisitForStackValue(args->at(i)); | 2891 VisitForStackValue(args->at(i)); |
2892 } | 2892 } |
2893 } | 2893 } |
2894 | 2894 |
2895 // Record source position of the IC call. | 2895 // Record source position of the IC call. |
2896 SetSourcePosition(expr->position()); | 2896 SetSourcePosition(expr->position()); |
2897 Handle<Code> ic = CallIC::initialize_stub( | 2897 Handle<Code> ic = CallIC::initialize_stub( |
2898 isolate(), arg_count, call_type); | 2898 isolate(), arg_count, call_type); |
2899 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); | 2899 __ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackSlot()))); |
2900 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2900 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2901 // Don't assign a type feedback id to the IC, since type feedback is provided | 2901 // Don't assign a type feedback id to the IC, since type feedback is provided |
2902 // by the vector above. | 2902 // by the vector above. |
2903 CallIC(ic); | 2903 CallIC(ic); |
2904 | 2904 |
2905 RecordJSReturnSite(expr); | 2905 RecordJSReturnSite(expr); |
2906 // Restore context register. | 2906 // Restore context register. |
2907 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2907 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2908 context()->DropAndPlug(1, r0); | 2908 context()->DropAndPlug(1, r0); |
2909 } | 2909 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3089 // constructor invocation. | 3089 // constructor invocation. |
3090 SetSourcePosition(expr->position()); | 3090 SetSourcePosition(expr->position()); |
3091 | 3091 |
3092 // Load function and argument count into r1 and r0. | 3092 // Load function and argument count into r1 and r0. |
3093 __ mov(r0, Operand(arg_count)); | 3093 __ mov(r0, Operand(arg_count)); |
3094 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); | 3094 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); |
3095 | 3095 |
3096 // Record call targets in unoptimized code. | 3096 // Record call targets in unoptimized code. |
3097 if (FLAG_pretenuring_call_new) { | 3097 if (FLAG_pretenuring_call_new) { |
3098 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | 3098 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); |
3099 DCHECK(expr->AllocationSiteFeedbackSlot() == | 3099 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == |
3100 expr->CallNewFeedbackSlot() + 1); | 3100 expr->CallNewFeedbackSlot().ToInt() + 1); |
3101 } | 3101 } |
3102 | 3102 |
3103 __ Move(r2, FeedbackVector()); | 3103 __ Move(r2, FeedbackVector()); |
3104 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 3104 __ mov(r3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3105 | 3105 |
3106 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3106 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3107 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3107 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3108 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3108 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3109 context()->Plug(r0); | 3109 context()->Plug(r0); |
3110 } | 3110 } |
3111 | 3111 |
3112 | 3112 |
3113 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3113 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
3114 ZoneList<Expression*>* args = expr->arguments(); | 3114 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4295 // Push the builtins object as the receiver. | 4295 // Push the builtins object as the receiver. |
4296 Register receiver = LoadDescriptor::ReceiverRegister(); | 4296 Register receiver = LoadDescriptor::ReceiverRegister(); |
4297 __ ldr(receiver, GlobalObjectOperand()); | 4297 __ ldr(receiver, GlobalObjectOperand()); |
4298 __ ldr(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); | 4298 __ ldr(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); |
4299 __ push(receiver); | 4299 __ push(receiver); |
4300 | 4300 |
4301 // Load the function from the receiver. | 4301 // Load the function from the receiver. |
4302 __ mov(LoadDescriptor::NameRegister(), Operand(expr->name())); | 4302 __ mov(LoadDescriptor::NameRegister(), Operand(expr->name())); |
4303 if (FLAG_vector_ics) { | 4303 if (FLAG_vector_ics) { |
4304 __ mov(VectorLoadICDescriptor::SlotRegister(), | 4304 __ mov(VectorLoadICDescriptor::SlotRegister(), |
4305 Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); | 4305 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); |
4306 CallLoadIC(NOT_CONTEXTUAL); | 4306 CallLoadIC(NOT_CONTEXTUAL); |
4307 } else { | 4307 } else { |
4308 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 4308 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
4309 } | 4309 } |
4310 | 4310 |
4311 // Push the target function under the receiver. | 4311 // Push the target function under the receiver. |
4312 __ ldr(ip, MemOperand(sp, 0)); | 4312 __ ldr(ip, MemOperand(sp, 0)); |
4313 __ push(ip); | 4313 __ push(ip); |
4314 __ str(r0, MemOperand(sp, kPointerSize)); | 4314 __ str(r0, MemOperand(sp, kPointerSize)); |
4315 | 4315 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4699 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
4700 DCHECK(!context()->IsEffect()); | 4700 DCHECK(!context()->IsEffect()); |
4701 DCHECK(!context()->IsTest()); | 4701 DCHECK(!context()->IsTest()); |
4702 VariableProxy* proxy = expr->AsVariableProxy(); | 4702 VariableProxy* proxy = expr->AsVariableProxy(); |
4703 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4703 if (proxy != NULL && proxy->var()->IsUnallocated()) { |
4704 Comment cmnt(masm_, "[ Global variable"); | 4704 Comment cmnt(masm_, "[ Global variable"); |
4705 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 4705 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
4706 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); | 4706 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
4707 if (FLAG_vector_ics) { | 4707 if (FLAG_vector_ics) { |
4708 __ mov(VectorLoadICDescriptor::SlotRegister(), | 4708 __ mov(VectorLoadICDescriptor::SlotRegister(), |
4709 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 4709 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
4710 } | 4710 } |
4711 // Use a regular load, not a contextual load, to avoid a reference | 4711 // Use a regular load, not a contextual load, to avoid a reference |
4712 // error. | 4712 // error. |
4713 CallLoadIC(NOT_CONTEXTUAL); | 4713 CallLoadIC(NOT_CONTEXTUAL); |
4714 PrepareForBailout(expr, TOS_REG); | 4714 PrepareForBailout(expr, TOS_REG); |
4715 context()->Plug(r0); | 4715 context()->Plug(r0); |
4716 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 4716 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
4717 Comment cmnt(masm_, "[ Lookup slot"); | 4717 Comment cmnt(masm_, "[ Lookup slot"); |
4718 Label done, slow; | 4718 Label done, slow; |
4719 | 4719 |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5199 | 5199 |
5200 DCHECK(interrupt_address == | 5200 DCHECK(interrupt_address == |
5201 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5201 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5202 return OSR_AFTER_STACK_CHECK; | 5202 return OSR_AFTER_STACK_CHECK; |
5203 } | 5203 } |
5204 | 5204 |
5205 | 5205 |
5206 } } // namespace v8::internal | 5206 } } // namespace v8::internal |
5207 | 5207 |
5208 #endif // V8_TARGET_ARCH_ARM | 5208 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |