| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 void MathPowStub::Generate(MacroAssembler* masm) { | 326 void MathPowStub::Generate(MacroAssembler* masm) { |
| 327 // No SSE2 support | 327 // No SSE2 support |
| 328 UNREACHABLE(); | 328 UNREACHABLE(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 332 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
| 333 Label miss; | 333 Label miss; |
| 334 Register receiver = LoadDescriptor::ReceiverRegister(); | 334 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 335 | 335 |
| 336 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, | 336 if (FLAG_vector_ics) { |
| 337 ebx, &miss); | 337 // With careful management, we won't have to save slot and vector on |
| 338 // the stack. Simply handle the possibly missing case first. |
| 339 // TODO(mvstanton): this code can be more efficient. |
| 340 __ cmp(FieldOperand(receiver, JSFunction::kPrototypeOrInitialMapOffset), |
| 341 Immediate(isolate()->factory()->the_hole_value())); |
| 342 __ j(equal, &miss); |
| 343 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss); |
| 344 __ ret(0); |
| 345 } else { |
| 346 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, |
| 347 ebx, &miss); |
| 348 } |
| 338 __ bind(&miss); | 349 __ bind(&miss); |
| 339 PropertyAccessCompiler::TailCallBuiltin( | 350 PropertyAccessCompiler::TailCallBuiltin( |
| 340 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 351 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 341 } | 352 } |
| 342 | 353 |
| 343 | 354 |
| 344 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { | 355 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { |
| 345 // Return address is on the stack. | 356 // Return address is on the stack. |
| 346 Label slow; | 357 Label slow; |
| 347 | 358 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 370 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 381 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
| 371 } | 382 } |
| 372 | 383 |
| 373 | 384 |
| 374 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 385 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 375 // Return address is on the stack. | 386 // Return address is on the stack. |
| 376 Label miss; | 387 Label miss; |
| 377 | 388 |
| 378 Register receiver = LoadDescriptor::ReceiverRegister(); | 389 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 379 Register index = LoadDescriptor::NameRegister(); | 390 Register index = LoadDescriptor::NameRegister(); |
| 380 Register scratch = ebx; | 391 Register scratch = edi; |
| 381 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 392 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 382 Register result = eax; | 393 Register result = eax; |
| 383 DCHECK(!result.is(scratch)); | 394 DCHECK(!result.is(scratch)); |
| 395 DCHECK(!FLAG_vector_ics || |
| 396 (!scratch.is(VectorLoadICDescriptor::VectorRegister()) && |
| 397 result.is(VectorLoadICDescriptor::SlotRegister()))); |
| 398 |
| 399 // StringCharAtGenerator doesn't use the result register until it's passed |
| 400 // the different miss possibilities. If it did, we would have a conflict |
| 401 // when FLAG_vector_ics is true. |
| 384 | 402 |
| 385 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 403 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 386 &miss, // When not a string. | 404 &miss, // When not a string. |
| 387 &miss, // When not a number. | 405 &miss, // When not a number. |
| 388 &miss, // When index out of range. | 406 &miss, // When index out of range. |
| 389 STRING_INDEX_IS_ARRAY_INDEX, | 407 STRING_INDEX_IS_ARRAY_INDEX, |
| 390 RECEIVER_IS_STRING); | 408 RECEIVER_IS_STRING); |
| 391 char_at_generator.GenerateFast(masm); | 409 char_at_generator.GenerateFast(masm); |
| 392 __ ret(0); | 410 __ ret(0); |
| 393 | 411 |
| (...skipping 4060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4454 Operand(ebp, 7 * kPointerSize), | 4472 Operand(ebp, 7 * kPointerSize), |
| 4455 NULL); | 4473 NULL); |
| 4456 } | 4474 } |
| 4457 | 4475 |
| 4458 | 4476 |
| 4459 #undef __ | 4477 #undef __ |
| 4460 | 4478 |
| 4461 } } // namespace v8::internal | 4479 } } // namespace v8::internal |
| 4462 | 4480 |
| 4463 #endif // V8_TARGET_ARCH_X87 | 4481 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |