| 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 | 328 |
| 336 void InvokeCode(Handle<Code> code, | 329 void InvokeCode(Handle<Code> code, |
| 337 const ParameterCount& expected, | 330 const ParameterCount& expected, |
| 338 const ParameterCount& actual, | 331 const ParameterCount& actual, |
| 339 RelocInfo::Mode rmode, | 332 RelocInfo::Mode rmode, |
| 340 InvokeFlag flag, | 333 InvokeFlag flag, |
| 341 const CallWrapper& call_wrapper, | 334 const CallWrapper& call_wrapper); |
| 342 CallKind call_kind); | |
| 343 | 335 |
| 344 // Invoke the JavaScript function in the given register. Changes the | 336 // Invoke the JavaScript function in the given register. Changes the |
| 345 // current context to the context in the function before invoking. | 337 // current context to the context in the function before invoking. |
| 346 void InvokeFunction(Register function, | 338 void InvokeFunction(Register function, |
| 347 const ParameterCount& actual, | 339 const ParameterCount& actual, |
| 348 InvokeFlag flag, | 340 InvokeFlag flag, |
| 349 const CallWrapper& call_wrapper, | 341 const CallWrapper& call_wrapper); |
| 350 CallKind call_kind); | |
| 351 | 342 |
| 352 void InvokeFunction(Register function, | 343 void InvokeFunction(Register function, |
| 353 const ParameterCount& expected, | 344 const ParameterCount& expected, |
| 354 const ParameterCount& actual, | 345 const ParameterCount& actual, |
| 355 InvokeFlag flag, | 346 InvokeFlag flag, |
| 356 const CallWrapper& call_wrapper, | 347 const CallWrapper& call_wrapper); |
| 357 CallKind call_kind); | |
| 358 | 348 |
| 359 void InvokeFunction(Handle<JSFunction> function, | 349 void InvokeFunction(Handle<JSFunction> function, |
| 360 const ParameterCount& expected, | 350 const ParameterCount& expected, |
| 361 const ParameterCount& actual, | 351 const ParameterCount& actual, |
| 362 InvokeFlag flag, | 352 InvokeFlag flag, |
| 363 const CallWrapper& call_wrapper, | 353 const CallWrapper& call_wrapper); |
| 364 CallKind call_kind); | |
| 365 | 354 |
| 366 // Invoke specified builtin JavaScript function. Adds an entry to | 355 // Invoke specified builtin JavaScript function. Adds an entry to |
| 367 // the unresolved list if the name does not resolve. | 356 // the unresolved list if the name does not resolve. |
| 368 void InvokeBuiltin(Builtins::JavaScript id, | 357 void InvokeBuiltin(Builtins::JavaScript id, |
| 369 InvokeFlag flag, | 358 InvokeFlag flag, |
| 370 const CallWrapper& call_wrapper = NullCallWrapper()); | 359 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 371 | 360 |
| 372 // Store the function for the given builtin in the target register. | 361 // Store the function for the given builtin in the target register. |
| 373 void GetBuiltinFunction(Register target, Builtins::JavaScript id); | 362 void GetBuiltinFunction(Register target, Builtins::JavaScript id); |
| 374 | 363 |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 | 992 |
| 1004 // Helper functions for generating invokes. | 993 // Helper functions for generating invokes. |
| 1005 void InvokePrologue(const ParameterCount& expected, | 994 void InvokePrologue(const ParameterCount& expected, |
| 1006 const ParameterCount& actual, | 995 const ParameterCount& actual, |
| 1007 Handle<Code> code_constant, | 996 Handle<Code> code_constant, |
| 1008 const Operand& code_operand, | 997 const Operand& code_operand, |
| 1009 Label* done, | 998 Label* done, |
| 1010 bool* definitely_mismatches, | 999 bool* definitely_mismatches, |
| 1011 InvokeFlag flag, | 1000 InvokeFlag flag, |
| 1012 Label::Distance done_distance, | 1001 Label::Distance done_distance, |
| 1013 const CallWrapper& call_wrapper = NullCallWrapper(), | 1002 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 1014 CallKind call_kind = CALL_AS_METHOD); | |
| 1015 | 1003 |
| 1016 void EnterExitFramePrologue(); | 1004 void EnterExitFramePrologue(); |
| 1017 void EnterExitFrameEpilogue(int argc, bool save_doubles); | 1005 void EnterExitFrameEpilogue(int argc, bool save_doubles); |
| 1018 | 1006 |
| 1019 void LeaveExitFrameEpilogue(bool restore_context); | 1007 void LeaveExitFrameEpilogue(bool restore_context); |
| 1020 | 1008 |
| 1021 // Allocation support helpers. | 1009 // Allocation support helpers. |
| 1022 void LoadAllocationTopHelper(Register result, | 1010 void LoadAllocationTopHelper(Register result, |
| 1023 Register scratch, | 1011 Register scratch, |
| 1024 AllocationFlags flags); | 1012 AllocationFlags flags); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 } \ | 1121 } \ |
| 1134 masm-> | 1122 masm-> |
| 1135 #else | 1123 #else |
| 1136 #define ACCESS_MASM(masm) masm-> | 1124 #define ACCESS_MASM(masm) masm-> |
| 1137 #endif | 1125 #endif |
| 1138 | 1126 |
| 1139 | 1127 |
| 1140 } } // namespace v8::internal | 1128 } } // namespace v8::internal |
| 1141 | 1129 |
| 1142 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1130 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
| OLD | NEW |