| 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 __ JumpIfSmi(edx, &invoke, Label::kNear); | 1105 __ JumpIfSmi(edx, &invoke, Label::kNear); |
| 1106 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 1106 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
| 1107 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 1107 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
| 1108 __ cmp(ebx, JS_GLOBAL_OBJECT_TYPE); | 1108 __ cmp(ebx, JS_GLOBAL_OBJECT_TYPE); |
| 1109 __ j(equal, &global, Label::kNear); | 1109 __ j(equal, &global, Label::kNear); |
| 1110 __ cmp(ebx, JS_BUILTINS_OBJECT_TYPE); | 1110 __ cmp(ebx, JS_BUILTINS_OBJECT_TYPE); |
| 1111 __ j(not_equal, &invoke, Label::kNear); | 1111 __ j(not_equal, &invoke, Label::kNear); |
| 1112 | 1112 |
| 1113 // Patch the receiver on the stack. | 1113 // Patch the receiver on the stack. |
| 1114 __ bind(&global); | 1114 __ bind(&global); |
| 1115 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); | 1115 __ mov(Operand(esp, (argc + 1) * kPointerSize), |
| 1116 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); | 1116 masm->isolate()->factory()->undefined_value()); |
| 1117 |
| 1117 __ bind(&invoke); | 1118 __ bind(&invoke); |
| 1118 } | 1119 } |
| 1119 | 1120 |
| 1120 // Invoke the function. | 1121 // Invoke the function. |
| 1121 CallKind call_kind = CallICBase::Contextual::decode(extra_state) | 1122 CallKind call_kind = CallICBase::Contextual::decode(extra_state) |
| 1122 ? CALL_AS_FUNCTION | 1123 ? CALL_AS_FUNCTION |
| 1123 : CALL_AS_METHOD; | 1124 : CALL_AS_METHOD; |
| 1124 ParameterCount actual(argc); | 1125 ParameterCount actual(argc); |
| 1125 __ InvokeFunction(edi, | 1126 __ InvokeFunction(edi, |
| 1126 actual, | 1127 actual, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 Label miss; | 1312 Label miss; |
| 1312 __ JumpIfSmi(ecx, &miss); | 1313 __ JumpIfSmi(ecx, &miss); |
| 1313 Condition cond = masm->IsObjectNameType(ecx, eax, eax); | 1314 Condition cond = masm->IsObjectNameType(ecx, eax, eax); |
| 1314 __ j(NegateCondition(cond), &miss); | 1315 __ j(NegateCondition(cond), &miss); |
| 1315 CallICBase::GenerateNormal(masm, argc); | 1316 CallICBase::GenerateNormal(masm, argc); |
| 1316 __ bind(&miss); | 1317 __ bind(&miss); |
| 1317 GenerateMiss(masm, argc); | 1318 GenerateMiss(masm, argc); |
| 1318 } | 1319 } |
| 1319 | 1320 |
| 1320 | 1321 |
| 1321 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 1322 void LoadIC::GenerateMegamorphic(MacroAssembler* masm, ContextualMode mode) { |
| 1322 // ----------- S t a t e ------------- | 1323 // ----------- S t a t e ------------- |
| 1323 // -- ecx : name | 1324 // -- ecx : name |
| 1324 // -- edx : receiver | 1325 // -- edx : receiver |
| 1325 // -- esp[0] : return address | 1326 // -- esp[0] : return address |
| 1326 // ----------------------------------- | 1327 // ----------------------------------- |
| 1327 | 1328 |
| 1328 // Probe the stub cache. | 1329 // Probe the stub cache. |
| 1330 ExtraICState extra_ic_state = IC::ComputeExtraICState(mode); |
| 1329 Code::Flags flags = Code::ComputeFlags( | 1331 Code::Flags flags = Code::ComputeFlags( |
| 1330 Code::HANDLER, MONOMORPHIC, kNoExtraICState, | 1332 Code::HANDLER, MONOMORPHIC, extra_ic_state, |
| 1331 Code::NORMAL, Code::LOAD_IC); | 1333 Code::NORMAL, Code::LOAD_IC); |
| 1332 masm->isolate()->stub_cache()->GenerateProbe( | 1334 masm->isolate()->stub_cache()->GenerateProbe( |
| 1333 masm, flags, edx, ecx, ebx, eax); | 1335 masm, flags, edx, ecx, ebx, eax); |
| 1334 | 1336 |
| 1335 // Cache miss: Jump to runtime. | 1337 // Cache miss: Jump to runtime. |
| 1336 GenerateMiss(masm); | 1338 GenerateMiss(masm); |
| 1337 } | 1339 } |
| 1338 | 1340 |
| 1339 | 1341 |
| 1340 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 1342 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1678 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
| 1677 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1679 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1678 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1680 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1679 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1681 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1680 } | 1682 } |
| 1681 | 1683 |
| 1682 | 1684 |
| 1683 } } // namespace v8::internal | 1685 } } // namespace v8::internal |
| 1684 | 1686 |
| 1685 #endif // V8_TARGET_ARCH_IA32 | 1687 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |