Changeset 194294 in webkit for trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
- Timestamp:
- Dec 18, 2015, 2:03:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r193603 r194294 117 117 } while (false) 118 118 119 #define RETURN(value) do { \ 120 JSValue rReturnValue = (value); \ 121 CHECK_EXCEPTION(); \ 122 OP(1) = rReturnValue; \ 123 END_IMPL(); \ 124 } while (false) 125 126 #define RETURN_PROFILED(opcode, value) do { \ 127 JSValue rpPeturnValue = (value); \ 128 CHECK_EXCEPTION(); \ 129 OP(1) = rpPeturnValue; \ 130 PROFILE_VALUE(opcode, rpPeturnValue); \ 131 END_IMPL(); \ 132 } while (false) 119 #define RETURN_WITH_PROFILING(value__, profilingAction__) do { \ 120 JSValue returnValue__ = (value__); \ 121 CHECK_EXCEPTION(); \ 122 OP(1) = returnValue__; \ 123 profilingAction__; \ 124 END_IMPL(); \ 125 } while (false) 126 127 #define RETURN(value) \ 128 RETURN_WITH_PROFILING(value, { }) 129 130 #define RETURN_PROFILED(opcode__, value__) \ 131 RETURN_WITH_PROFILING(value__, PROFILE_VALUE(opcode__, returnValue__)) 133 132 134 133 #define PROFILE_VALUE(opcode, value) do { \ 135 134 pc[OPCODE_LENGTH(opcode) - 1].u.profile->m_buckets[0] = \ 136 135 JSValue::encode(value); \ 136 } while (false) 137 138 #define RETURN_WITH_RESULT_PROFILING(value__) \ 139 RETURN_WITH_PROFILING(value__, PROFILE_RESULT(returnValue__)) 140 141 #define PROFILE_RESULT(value__) do { \ 142 CodeBlock* codeBlock = exec->codeBlock(); \ 143 unsigned bytecodeOffset = codeBlock->bytecodeOffset(pc); \ 144 codeBlock->updateResultProfileForBytecodeOffset(bytecodeOffset, value__); \ 137 145 } while (false) 138 146 … … 358 366 359 367 if (v1.isString() && !v2.isObject()) 360 RETURN (jsString(exec, asString(v1), v2.toString(exec)));368 RETURN_WITH_RESULT_PROFILING(jsString(exec, asString(v1), v2.toString(exec))); 361 369 362 370 if (v1.isNumber() && v2.isNumber()) 363 RETURN (jsNumber(v1.asNumber() + v2.asNumber()));364 365 RETURN (jsAddSlowCase(exec, v1, v2));371 RETURN_WITH_RESULT_PROFILING(jsNumber(v1.asNumber() + v2.asNumber())); 372 373 RETURN_WITH_RESULT_PROFILING(jsAddSlowCase(exec, v1, v2)); 366 374 } 367 375 … … 375 383 double a = OP_C(2).jsValue().toNumber(exec); 376 384 double b = OP_C(3).jsValue().toNumber(exec); 377 RETURN (jsNumber(a * b));385 RETURN_WITH_RESULT_PROFILING(jsNumber(a * b)); 378 386 } 379 387 … … 383 391 double a = OP_C(2).jsValue().toNumber(exec); 384 392 double b = OP_C(3).jsValue().toNumber(exec); 385 RETURN (jsNumber(a - b));393 RETURN_WITH_RESULT_PROFILING(jsNumber(a - b)); 386 394 } 387 395 … … 391 399 double a = OP_C(2).jsValue().toNumber(exec); 392 400 double b = OP_C(3).jsValue().toNumber(exec); 393 RETURN (jsNumber(a / b));401 RETURN_WITH_RESULT_PROFILING(jsNumber(a / b)); 394 402 } 395 403
Note:
See TracChangeset
for help on using the changeset viewer.