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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 | 1186 |
1187 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 1187 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
1188 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 1188 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
1189 } | 1189 } |
1190 | 1190 |
1191 | 1191 |
1192 // static | 1192 // static |
1193 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, | 1193 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
1194 int field_index) { | 1194 int field_index) { |
1195 // ----------- S t a t e ------------- | 1195 // ----------- S t a t e ------------- |
| 1196 // -- eax : number of arguments |
| 1197 // -- edi : function |
| 1198 // -- esi : context |
1196 // -- esp[0] : return address | 1199 // -- esp[0] : return address |
1197 // -- esp[4] : receiver | 1200 // -- esp[4] : receiver |
1198 // ----------------------------------- | 1201 // ----------------------------------- |
1199 | 1202 |
1200 // 1. Load receiver into eax and check that it's actually a JSDate object. | 1203 // 1. Load receiver into eax and check that it's actually a JSDate object. |
1201 Label receiver_not_date; | 1204 Label receiver_not_date; |
1202 { | 1205 { |
| 1206 __ Move(ecx, eax); // Store argc for builtin frame construction. |
1203 __ mov(eax, Operand(esp, kPointerSize)); | 1207 __ mov(eax, Operand(esp, kPointerSize)); |
1204 __ JumpIfSmi(eax, &receiver_not_date); | 1208 __ JumpIfSmi(eax, &receiver_not_date); |
1205 __ CmpObjectType(eax, JS_DATE_TYPE, ebx); | 1209 __ CmpObjectType(eax, JS_DATE_TYPE, ebx); |
1206 __ j(not_equal, &receiver_not_date); | 1210 __ j(not_equal, &receiver_not_date); |
1207 } | 1211 } |
1208 | 1212 |
1209 // 2. Load the specified date field, falling back to the runtime as necessary. | 1213 // 2. Load the specified date field, falling back to the runtime as necessary. |
1210 if (field_index == JSDate::kDateValue) { | 1214 if (field_index == JSDate::kDateValue) { |
1211 __ mov(eax, FieldOperand(eax, JSDate::kValueOffset)); | 1215 __ mov(eax, FieldOperand(eax, JSDate::kValueOffset)); |
1212 } else { | 1216 } else { |
(...skipping 15 matching lines...) Expand all Loading... |
1228 Immediate(Smi::FromInt(field_index))); | 1232 Immediate(Smi::FromInt(field_index))); |
1229 __ CallCFunction( | 1233 __ CallCFunction( |
1230 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1234 ExternalReference::get_date_field_function(masm->isolate()), 2); |
1231 } | 1235 } |
1232 __ ret(1 * kPointerSize); | 1236 __ ret(1 * kPointerSize); |
1233 | 1237 |
1234 // 3. Raise a TypeError if the receiver is not a date. | 1238 // 3. Raise a TypeError if the receiver is not a date. |
1235 __ bind(&receiver_not_date); | 1239 __ bind(&receiver_not_date); |
1236 { | 1240 { |
1237 FrameScope scope(masm, StackFrame::MANUAL); | 1241 FrameScope scope(masm, StackFrame::MANUAL); |
1238 __ EnterFrame(StackFrame::INTERNAL); | 1242 __ Push(ebp); |
| 1243 __ Move(ebp, esp); |
| 1244 __ Push(esi); |
| 1245 __ Push(edi); |
| 1246 __ SmiTag(ecx); |
| 1247 __ Push(ecx); |
1239 __ CallRuntime(Runtime::kThrowNotDateError); | 1248 __ CallRuntime(Runtime::kThrowNotDateError); |
1240 } | 1249 } |
1241 } | 1250 } |
1242 | 1251 |
1243 // static | 1252 // static |
1244 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1253 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1245 // ----------- S t a t e ------------- | 1254 // ----------- S t a t e ------------- |
1246 // -- eax : argc | 1255 // -- eax : argc |
1247 // -- esp[0] : return address | 1256 // -- esp[0] : return address |
1248 // -- esp[4] : argArray | 1257 // -- esp[4] : argArray |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2972 // And "return" to the OSR entry point of the function. | 2981 // And "return" to the OSR entry point of the function. |
2973 __ ret(0); | 2982 __ ret(0); |
2974 } | 2983 } |
2975 | 2984 |
2976 | 2985 |
2977 #undef __ | 2986 #undef __ |
2978 } // namespace internal | 2987 } // namespace internal |
2979 } // namespace v8 | 2988 } // namespace v8 |
2980 | 2989 |
2981 #endif // V8_TARGET_ARCH_IA32 | 2990 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |