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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 ExternalReference ref = ExternalReference( | 364 ExternalReference ref = ExternalReference( |
365 IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate()); | 365 IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate()); |
366 __ TailCallExternalReference(ref, 2, 1); | 366 __ TailCallExternalReference(ref, 2, 1); |
367 | 367 |
368 __ bind(&slow); | 368 __ bind(&slow); |
369 PropertyAccessCompiler::TailCallBuiltin( | 369 PropertyAccessCompiler::TailCallBuiltin( |
370 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 370 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
371 } | 371 } |
372 | 372 |
373 | 373 |
| 374 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 375 // Return address is on the stack. |
| 376 Label miss; |
| 377 |
| 378 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 379 Register index = LoadDescriptor::NameRegister(); |
| 380 Register scratch = ebx; |
| 381 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 382 Register result = eax; |
| 383 DCHECK(!result.is(scratch)); |
| 384 |
| 385 // TODO(mvstanton): the generator doesn't need to verify that |
| 386 // receiver is a string map, that is done outside the handler. |
| 387 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 388 &miss, // When not a string. |
| 389 &miss, // When not a number. |
| 390 &miss, // When index out of range. |
| 391 STRING_INDEX_IS_ARRAY_INDEX, |
| 392 RECEIVER_IS_STRING); |
| 393 char_at_generator.GenerateFast(masm); |
| 394 __ ret(0); |
| 395 |
| 396 StubRuntimeCallHelper call_helper; |
| 397 char_at_generator.GenerateSlow(masm, call_helper); |
| 398 |
| 399 __ bind(&miss); |
| 400 PropertyAccessCompiler::TailCallBuiltin( |
| 401 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
| 402 } |
| 403 |
| 404 |
374 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 405 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
375 // The key is in edx and the parameter count is in eax. | 406 // The key is in edx and the parameter count is in eax. |
376 DCHECK(edx.is(ArgumentsAccessReadDescriptor::index())); | 407 DCHECK(edx.is(ArgumentsAccessReadDescriptor::index())); |
377 DCHECK(eax.is(ArgumentsAccessReadDescriptor::parameter_count())); | 408 DCHECK(eax.is(ArgumentsAccessReadDescriptor::parameter_count())); |
378 | 409 |
379 // The displacement is used for skipping the frame pointer on the | 410 // The displacement is used for skipping the frame pointer on the |
380 // stack. It is the offset of the last parameter (if any) relative | 411 // stack. It is the offset of the last parameter (if any) relative |
381 // to the frame pointer. | 412 // to the frame pointer. |
382 static const int kDisplacement = 1 * kPointerSize; | 413 static const int kDisplacement = 1 * kPointerSize; |
383 | 414 |
(...skipping 3979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4363 Operand(ebp, 7 * kPointerSize), | 4394 Operand(ebp, 7 * kPointerSize), |
4364 NULL); | 4395 NULL); |
4365 } | 4396 } |
4366 | 4397 |
4367 | 4398 |
4368 #undef __ | 4399 #undef __ |
4369 | 4400 |
4370 } } // namespace v8::internal | 4401 } } // namespace v8::internal |
4371 | 4402 |
4372 #endif // V8_TARGET_ARCH_X87 | 4403 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |