| 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 #if V8_TARGET_ARCH_IA32 |     5 #if V8_TARGET_ARCH_IA32 | 
|     6  |     6  | 
|     7 #include "src/code-factory.h" |     7 #include "src/code-factory.h" | 
|     8 #include "src/codegen.h" |     8 #include "src/codegen.h" | 
|     9 #include "src/deoptimizer.h" |     9 #include "src/deoptimizer.h" | 
|    10 #include "src/full-codegen/full-codegen.h" |    10 #include "src/full-codegen/full-codegen.h" | 
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   277       // Restore the parameters. |   277       // Restore the parameters. | 
|   278       __ pop(edx);  // new.target |   278       __ pop(edx);  // new.target | 
|   279       __ pop(edi);  // Constructor function. |   279       __ pop(edi);  // Constructor function. | 
|   280  |   280  | 
|   281       // Retrieve smi-tagged arguments count from the stack. |   281       // Retrieve smi-tagged arguments count from the stack. | 
|   282       __ mov(eax, Operand(esp, 0)); |   282       __ mov(eax, Operand(esp, 0)); | 
|   283     } |   283     } | 
|   284  |   284  | 
|   285     __ SmiUntag(eax); |   285     __ SmiUntag(eax); | 
|   286  |   286  | 
|   287     // Push new.target onto the construct frame. This is stored just below the |  | 
|   288     // receiver on the stack. |  | 
|   289     __ push(edx); |  | 
|   290  |  | 
|   291     if (create_implicit_receiver) { |   287     if (create_implicit_receiver) { | 
|   292       // Push the allocated receiver to the stack. We need two copies |   288       // Push the allocated receiver to the stack. We need two copies | 
|   293       // because we may have to return the original one and the calling |   289       // because we may have to return the original one and the calling | 
|   294       // conventions dictate that the called function pops the receiver. |   290       // conventions dictate that the called function pops the receiver. | 
|   295       __ push(ebx); |   291       __ push(ebx); | 
|   296       __ push(ebx); |   292       __ push(ebx); | 
|   297     } else { |   293     } else { | 
|   298       __ PushRoot(Heap::kTheHoleValueRootIndex); |   294       __ PushRoot(Heap::kTheHoleValueRootIndex); | 
|   299     } |   295     } | 
|   300  |   296  | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   344       // FIRST_JS_RECEIVER_TYPE, it is not an object in the ECMA sense. |   340       // FIRST_JS_RECEIVER_TYPE, it is not an object in the ECMA sense. | 
|   345       __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx); |   341       __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx); | 
|   346       __ j(above_equal, &exit); |   342       __ j(above_equal, &exit); | 
|   347  |   343  | 
|   348       // Throw away the result of the constructor invocation and use the |   344       // Throw away the result of the constructor invocation and use the | 
|   349       // on-stack receiver as the result. |   345       // on-stack receiver as the result. | 
|   350       __ bind(&use_receiver); |   346       __ bind(&use_receiver); | 
|   351       __ mov(eax, Operand(esp, 0)); |   347       __ mov(eax, Operand(esp, 0)); | 
|   352  |   348  | 
|   353       // Restore the arguments count and leave the construct frame. The |   349       // Restore the arguments count and leave the construct frame. The | 
|   354       // arguments |   350       // arguments count is stored below the receiver. | 
|   355       // count is stored below the reciever and the new.target. |  | 
|   356       __ bind(&exit); |   351       __ bind(&exit); | 
|   357       __ mov(ebx, Operand(esp, 2 * kPointerSize)); |   352       __ mov(ebx, Operand(esp, 1 * kPointerSize)); | 
|   358     } else { |   353     } else { | 
|   359       __ mov(ebx, Operand(esp, kPointerSize)); |   354       __ mov(ebx, Operand(esp, 0)); | 
|   360     } |   355     } | 
|   361  |   356  | 
|   362     // Leave construct frame. |   357     // Leave construct frame. | 
|   363   } |   358   } | 
|   364  |   359  | 
|   365   // Remove caller arguments from the stack and return. |   360   // Remove caller arguments from the stack and return. | 
|   366   STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |   361   STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 
|   367   __ pop(ecx); |   362   __ pop(ecx); | 
|   368   __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize));  // 1 ~ receiver |   363   __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize));  // 1 ~ receiver | 
|   369   __ push(ecx); |   364   __ push(ecx); | 
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1971  |  1966  | 
|  1972   __ bind(&ok); |  1967   __ bind(&ok); | 
|  1973   __ ret(0); |  1968   __ ret(0); | 
|  1974 } |  1969 } | 
|  1975  |  1970  | 
|  1976 #undef __ |  1971 #undef __ | 
|  1977 }  // namespace internal |  1972 }  // namespace internal | 
|  1978 }  // namespace v8 |  1973 }  // namespace v8 | 
|  1979  |  1974  | 
|  1980 #endif  // V8_TARGET_ARCH_IA32 |  1975 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |