| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 : Translation::kSelfLiteralId; | 374 : Translation::kSelfLiteralId; |
| 375 | 375 |
| 376 switch (environment->frame_type()) { | 376 switch (environment->frame_type()) { |
| 377 case JS_FUNCTION: | 377 case JS_FUNCTION: |
| 378 translation->BeginJSFrame(environment->ast_id(), closure_id, height); | 378 translation->BeginJSFrame(environment->ast_id(), closure_id, height); |
| 379 break; | 379 break; |
| 380 case JS_CONSTRUCT: | 380 case JS_CONSTRUCT: |
| 381 translation->BeginConstructStubFrame(closure_id, translation_size); | 381 translation->BeginConstructStubFrame(closure_id, translation_size); |
| 382 break; | 382 break; |
| 383 case JS_SETTER: | 383 case JS_SETTER: |
| 384 ASSERT(translation_size == 2); | 384 // TODO(svenpanne) Implement me! |
| 385 ASSERT(height == 0); | |
| 386 translation->BeginSetterStubFrame(closure_id); | |
| 387 break; | 385 break; |
| 388 case ARGUMENTS_ADAPTOR: | 386 case ARGUMENTS_ADAPTOR: |
| 389 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); | 387 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
| 390 break; | 388 break; |
| 391 } | 389 } |
| 392 for (int i = 0; i < translation_size; ++i) { | 390 for (int i = 0; i < translation_size; ++i) { |
| 393 LOperand* value = environment->values()->at(i); | 391 LOperand* value = environment->values()->at(i); |
| 394 // spilled_registers_ and spilled_double_registers_ are either | 392 // spilled_registers_ and spilled_double_registers_ are either |
| 395 // both NULL or both set. | 393 // both NULL or both set. |
| 396 if (environment->spilled_registers() != NULL && value != NULL) { | 394 if (environment->spilled_registers() != NULL && value != NULL) { |
| (...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 Condition is_smi = __ CheckSmi(receiver); | 2841 Condition is_smi = __ CheckSmi(receiver); |
| 2844 DeoptimizeIf(is_smi, instr->environment()); | 2842 DeoptimizeIf(is_smi, instr->environment()); |
| 2845 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); | 2843 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); |
| 2846 DeoptimizeIf(below, instr->environment()); | 2844 DeoptimizeIf(below, instr->environment()); |
| 2847 __ jmp(&receiver_ok, Label::kNear); | 2845 __ jmp(&receiver_ok, Label::kNear); |
| 2848 | 2846 |
| 2849 __ bind(&global_object); | 2847 __ bind(&global_object); |
| 2850 // TODO(kmillikin): We have a hydrogen value for the global object. See | 2848 // TODO(kmillikin): We have a hydrogen value for the global object. See |
| 2851 // if it's better to use it than to explicitly fetch it from the context | 2849 // if it's better to use it than to explicitly fetch it from the context |
| 2852 // here. | 2850 // here. |
| 2853 __ movq(receiver, ContextOperand(rsi, Context::GLOBAL_OBJECT_INDEX)); | 2851 __ movq(receiver, ContextOperand(rsi, Context::GLOBAL_INDEX)); |
| 2854 __ movq(receiver, | 2852 __ movq(receiver, |
| 2855 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); | 2853 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); |
| 2856 __ bind(&receiver_ok); | 2854 __ bind(&receiver_ok); |
| 2857 } | 2855 } |
| 2858 | 2856 |
| 2859 | 2857 |
| 2860 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 2858 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
| 2861 Register receiver = ToRegister(instr->receiver()); | 2859 Register receiver = ToRegister(instr->receiver()); |
| 2862 Register function = ToRegister(instr->function()); | 2860 Register function = ToRegister(instr->function()); |
| 2863 Register length = ToRegister(instr->length()); | 2861 Register length = ToRegister(instr->length()); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 Register global_object = rcx; | 3317 Register global_object = rcx; |
| 3320 #else | 3318 #else |
| 3321 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); | 3319 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); |
| 3322 Register global_object = rdi; | 3320 Register global_object = rdi; |
| 3323 #endif | 3321 #endif |
| 3324 | 3322 |
| 3325 static const int kSeedSize = sizeof(uint32_t); | 3323 static const int kSeedSize = sizeof(uint32_t); |
| 3326 STATIC_ASSERT(kPointerSize == 2 * kSeedSize); | 3324 STATIC_ASSERT(kPointerSize == 2 * kSeedSize); |
| 3327 | 3325 |
| 3328 __ movq(global_object, | 3326 __ movq(global_object, |
| 3329 FieldOperand(global_object, GlobalObject::kNativeContextOffset)); | 3327 FieldOperand(global_object, GlobalObject::kGlobalContextOffset)); |
| 3330 static const int kRandomSeedOffset = | 3328 static const int kRandomSeedOffset = |
| 3331 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; | 3329 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; |
| 3332 __ movq(rbx, FieldOperand(global_object, kRandomSeedOffset)); | 3330 __ movq(rbx, FieldOperand(global_object, kRandomSeedOffset)); |
| 3333 // rbx: FixedArray of the native context's random seeds | 3331 // rbx: FixedArray of the global context's random seeds |
| 3334 | 3332 |
| 3335 // Load state[0]. | 3333 // Load state[0]. |
| 3336 __ movl(rax, FieldOperand(rbx, ByteArray::kHeaderSize)); | 3334 __ movl(rax, FieldOperand(rbx, ByteArray::kHeaderSize)); |
| 3337 // If state[0] == 0, call runtime to initialize seeds. | 3335 // If state[0] == 0, call runtime to initialize seeds. |
| 3338 __ testl(rax, rax); | 3336 __ testl(rax, rax); |
| 3339 __ j(zero, deferred->entry()); | 3337 __ j(zero, deferred->entry()); |
| 3340 // Load state[1]. | 3338 // Load state[1]. |
| 3341 __ movl(rcx, FieldOperand(rbx, ByteArray::kHeaderSize + kSeedSize)); | 3339 __ movl(rcx, FieldOperand(rbx, ByteArray::kHeaderSize + kSeedSize)); |
| 3342 | 3340 |
| 3343 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) | 3341 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) |
| (...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5164 FixedArray::kHeaderSize - kPointerSize)); | 5162 FixedArray::kHeaderSize - kPointerSize)); |
| 5165 __ bind(&done); | 5163 __ bind(&done); |
| 5166 } | 5164 } |
| 5167 | 5165 |
| 5168 | 5166 |
| 5169 #undef __ | 5167 #undef __ |
| 5170 | 5168 |
| 5171 } } // namespace v8::internal | 5169 } } // namespace v8::internal |
| 5172 | 5170 |
| 5173 #endif // V8_TARGET_ARCH_X64 | 5171 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |