| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 if (object->IsHeapObject()) { | 304 if (object->IsHeapObject()) { |
| 305 CmpHeapObject(reg, Handle<HeapObject>::cast(object)); | 305 CmpHeapObject(reg, Handle<HeapObject>::cast(object)); |
| 306 } else { | 306 } else { |
| 307 cmp(reg, Immediate(object)); | 307 cmp(reg, Immediate(object)); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 // --------------------------------------------------------------------------- | 311 // --------------------------------------------------------------------------- |
| 312 // JavaScript invokes | 312 // JavaScript invokes |
| 313 | 313 |
| 314 // Set up call kind marking in ecx. The method takes ecx as an | |
| 315 // explicit first parameter to make the code more readable at the | |
| 316 // call sites. | |
| 317 void SetCallKind(Register dst, CallKind kind); | |
| 318 | |
| 319 // Invoke the JavaScript function code by either calling or jumping. | 314 // Invoke the JavaScript function code by either calling or jumping. |
| 320 void InvokeCode(Register code, | 315 void InvokeCode(Register code, |
| 321 const ParameterCount& expected, | 316 const ParameterCount& expected, |
| 322 const ParameterCount& actual, | 317 const ParameterCount& actual, |
| 323 InvokeFlag flag, | 318 InvokeFlag flag, |
| 324 const CallWrapper& call_wrapper, | 319 const CallWrapper& call_wrapper) { |
| 325 CallKind call_kind) { | 320 InvokeCode(Operand(code), expected, actual, flag, call_wrapper); |
| 326 InvokeCode(Operand(code), expected, actual, flag, call_wrapper, call_kind); | |
| 327 } | 321 } |
| 328 | 322 |
| 329 void InvokeCode(const Operand& code, | 323 void InvokeCode(const Operand& code, |
| 330 const ParameterCount& expected, | 324 const ParameterCount& expected, |
| 331 const ParameterCount& actual, | 325 const ParameterCount& actual, |
| 332 InvokeFlag flag, | 326 InvokeFlag flag, |
| 333 const CallWrapper& call_wrapper, | 327 const CallWrapper& call_wrapper); |
| 334 CallKind call_kind); | |
| 335 | |
| 336 void InvokeCode(Handle<Code> code, | |
| 337 const ParameterCount& expected, | |
| 338 const ParameterCount& actual, | |
| 339 RelocInfo::Mode rmode, | |
| 340 InvokeFlag flag, | |
| 341 const CallWrapper& call_wrapper, | |
| 342 CallKind call_kind); | |
| 343 | 328 |
| 344 // Invoke the JavaScript function in the given register. Changes the | 329 // Invoke the JavaScript function in the given register. Changes the |
| 345 // current context to the context in the function before invoking. | 330 // current context to the context in the function before invoking. |
| 346 void InvokeFunction(Register function, | 331 void InvokeFunction(Register function, |
| 347 const ParameterCount& actual, | 332 const ParameterCount& actual, |
| 348 InvokeFlag flag, | 333 InvokeFlag flag, |
| 349 const CallWrapper& call_wrapper, | 334 const CallWrapper& call_wrapper); |
| 350 CallKind call_kind); | |
| 351 | 335 |
| 352 void InvokeFunction(Register function, | 336 void InvokeFunction(Register function, |
| 353 const ParameterCount& expected, | 337 const ParameterCount& expected, |
| 354 const ParameterCount& actual, | 338 const ParameterCount& actual, |
| 355 InvokeFlag flag, | 339 InvokeFlag flag, |
| 356 const CallWrapper& call_wrapper, | 340 const CallWrapper& call_wrapper); |
| 357 CallKind call_kind); | |
| 358 | 341 |
| 359 void InvokeFunction(Handle<JSFunction> function, | 342 void InvokeFunction(Handle<JSFunction> function, |
| 360 const ParameterCount& expected, | 343 const ParameterCount& expected, |
| 361 const ParameterCount& actual, | 344 const ParameterCount& actual, |
| 362 InvokeFlag flag, | 345 InvokeFlag flag, |
| 363 const CallWrapper& call_wrapper, | 346 const CallWrapper& call_wrapper); |
| 364 CallKind call_kind); | |
| 365 | 347 |
| 366 // Invoke specified builtin JavaScript function. Adds an entry to | 348 // Invoke specified builtin JavaScript function. Adds an entry to |
| 367 // the unresolved list if the name does not resolve. | 349 // the unresolved list if the name does not resolve. |
| 368 void InvokeBuiltin(Builtins::JavaScript id, | 350 void InvokeBuiltin(Builtins::JavaScript id, |
| 369 InvokeFlag flag, | 351 InvokeFlag flag, |
| 370 const CallWrapper& call_wrapper = NullCallWrapper()); | 352 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 371 | 353 |
| 372 // Store the function for the given builtin in the target register. | 354 // Store the function for the given builtin in the target register. |
| 373 void GetBuiltinFunction(Register target, Builtins::JavaScript id); | 355 void GetBuiltinFunction(Register target, Builtins::JavaScript id); |
| 374 | 356 |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 | 985 |
| 1004 // Helper functions for generating invokes. | 986 // Helper functions for generating invokes. |
| 1005 void InvokePrologue(const ParameterCount& expected, | 987 void InvokePrologue(const ParameterCount& expected, |
| 1006 const ParameterCount& actual, | 988 const ParameterCount& actual, |
| 1007 Handle<Code> code_constant, | 989 Handle<Code> code_constant, |
| 1008 const Operand& code_operand, | 990 const Operand& code_operand, |
| 1009 Label* done, | 991 Label* done, |
| 1010 bool* definitely_mismatches, | 992 bool* definitely_mismatches, |
| 1011 InvokeFlag flag, | 993 InvokeFlag flag, |
| 1012 Label::Distance done_distance, | 994 Label::Distance done_distance, |
| 1013 const CallWrapper& call_wrapper = NullCallWrapper(), | 995 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 1014 CallKind call_kind = CALL_AS_METHOD); | |
| 1015 | 996 |
| 1016 void EnterExitFramePrologue(); | 997 void EnterExitFramePrologue(); |
| 1017 void EnterExitFrameEpilogue(int argc, bool save_doubles); | 998 void EnterExitFrameEpilogue(int argc, bool save_doubles); |
| 1018 | 999 |
| 1019 void LeaveExitFrameEpilogue(bool restore_context); | 1000 void LeaveExitFrameEpilogue(bool restore_context); |
| 1020 | 1001 |
| 1021 // Allocation support helpers. | 1002 // Allocation support helpers. |
| 1022 void LoadAllocationTopHelper(Register result, | 1003 void LoadAllocationTopHelper(Register result, |
| 1023 Register scratch, | 1004 Register scratch, |
| 1024 AllocationFlags flags); | 1005 AllocationFlags flags); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 } \ | 1114 } \ |
| 1134 masm-> | 1115 masm-> |
| 1135 #else | 1116 #else |
| 1136 #define ACCESS_MASM(masm) masm-> | 1117 #define ACCESS_MASM(masm) masm-> |
| 1137 #endif | 1118 #endif |
| 1138 | 1119 |
| 1139 | 1120 |
| 1140 } } // namespace v8::internal | 1121 } } // namespace v8::internal |
| 1141 | 1122 |
| 1142 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1123 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
| OLD | NEW |