| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 void* external_function() { return external_function_; } | 467 void* external_function() { return external_function_; } |
| 468 ExternalReference::Type type() { return type_; } | 468 ExternalReference::Type type() { return type_; } |
| 469 | 469 |
| 470 static Redirection* Get(void* external_function, | 470 static Redirection* Get(void* external_function, |
| 471 ExternalReference::Type type) { | 471 ExternalReference::Type type) { |
| 472 Isolate* isolate = Isolate::Current(); | 472 Isolate* isolate = Isolate::Current(); |
| 473 Redirection* current = isolate->simulator_redirection(); | 473 Redirection* current = isolate->simulator_redirection(); |
| 474 for (; current != NULL; current = current->next_) { | 474 for (; current != NULL; current = current->next_) { |
| 475 if (current->external_function_ == external_function) return current; | 475 if (current->external_function_ == external_function) { |
| 476 ASSERT_EQ(current->type(), type); |
| 477 return current; |
| 478 } |
| 476 } | 479 } |
| 477 return new Redirection(external_function, type); | 480 return new Redirection(external_function, type); |
| 478 } | 481 } |
| 479 | 482 |
| 480 static Redirection* FromHltInstruction(Instruction* redirect_call) { | 483 static Redirection* FromHltInstruction(Instruction* redirect_call) { |
| 481 char* addr_of_hlt = reinterpret_cast<char*>(redirect_call); | 484 char* addr_of_hlt = reinterpret_cast<char*>(redirect_call); |
| 482 char* addr_of_redirection = | 485 char* addr_of_redirection = |
| 483 addr_of_hlt - OFFSET_OF(Redirection, redirect_call_); | 486 addr_of_hlt - OFFSET_OF(Redirection, redirect_call_); |
| 484 return reinterpret_cast<Redirection*>(addr_of_redirection); | 487 return reinterpret_cast<Redirection*>(addr_of_redirection); |
| 485 } | 488 } |
| (...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3002 | 3005 |
| 3003 typedef int64_t (*SimulatorRuntimeCompareCall)(double arg1, double arg2); | 3006 typedef int64_t (*SimulatorRuntimeCompareCall)(double arg1, double arg2); |
| 3004 typedef double (*SimulatorRuntimeFPFPCall)(double arg1, double arg2); | 3007 typedef double (*SimulatorRuntimeFPFPCall)(double arg1, double arg2); |
| 3005 typedef double (*SimulatorRuntimeFPCall)(double arg1); | 3008 typedef double (*SimulatorRuntimeFPCall)(double arg1); |
| 3006 typedef double (*SimulatorRuntimeFPIntCall)(double arg1, int32_t arg2); | 3009 typedef double (*SimulatorRuntimeFPIntCall)(double arg1, int32_t arg2); |
| 3007 | 3010 |
| 3008 // This signature supports direct call in to API function native callback | 3011 // This signature supports direct call in to API function native callback |
| 3009 // (refer to InvocationCallback in v8.h). | 3012 // (refer to InvocationCallback in v8.h). |
| 3010 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectApiCall)(int64_t arg0); | 3013 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectApiCall)(int64_t arg0); |
| 3011 typedef void (*SimulatorRuntimeDirectApiCallNew)(int64_t arg0); | 3014 typedef void (*SimulatorRuntimeDirectApiCallNew)(int64_t arg0); |
| 3015 typedef v8::Handle<v8::Value> (*SimulatorRuntimeProfilingApiCall)(int64_t arg0, |
| 3016 int64_t arg1); |
| 3017 typedef void (*SimulatorRuntimeProfilingApiCallNew)(int64_t arg0, int64_t arg1); |
| 3012 | 3018 |
| 3013 // This signature supports direct call to accessor getter callback. | 3019 // This signature supports direct call to accessor getter callback. |
| 3014 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectGetterCall)(int64_t arg0, | 3020 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectGetterCall)(int64_t arg0, |
| 3015 int64_t arg1); | 3021 int64_t arg1); |
| 3016 typedef void (*SimulatorRuntimeDirectGetterCallNew)(int64_t arg0, int64_t arg1); | 3022 typedef void (*SimulatorRuntimeDirectGetterCallNew)(int64_t arg0, int64_t arg1); |
| 3023 typedef v8::Handle<v8::Value> (*SimulatorRuntimeProfilingGetterCall)( |
| 3024 int64_t arg0, int64_t arg1, int64_t arg2); |
| 3025 typedef void (*SimulatorRuntimeProfilingGetterCallNew)( |
| 3026 int64_t arg0, int64_t arg1, int64_t arg2); |
| 3017 | 3027 |
| 3018 void Simulator::VisitException(Instruction* instr) { | 3028 void Simulator::VisitException(Instruction* instr) { |
| 3019 // Define some colour codes to use for log messages. | 3029 // Define some colour codes to use for log messages. |
| 3020 // TODO(jbramley): Find a more elegant way of defining these. | 3030 // TODO(jbramley): Find a more elegant way of defining these. |
| 3021 char const* const clr_normal = (FLAG_log_colour) ? ("\033[m") | 3031 char const* const clr_normal = (FLAG_log_colour) ? ("\033[m") |
| 3022 : (""); | 3032 : (""); |
| 3023 char const* const clr_debug_number = (FLAG_log_colour) ? ("\033[1;33m") | 3033 char const* const clr_debug_number = (FLAG_log_colour) ? ("\033[1;33m") |
| 3024 : (""); | 3034 : (""); |
| 3025 char const* const clr_debug_message = (FLAG_log_colour) ? ("\033[0;33m") | 3035 char const* const clr_debug_message = (FLAG_log_colour) ? ("\033[0;33m") |
| 3026 : (""); | 3036 : (""); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 | 3132 |
| 3123 // SP must be 16 bytes aligned at the call interface. | 3133 // SP must be 16 bytes aligned at the call interface. |
| 3124 bool stack_alignment_exception = ((sp() & 0xf) != 0); | 3134 bool stack_alignment_exception = ((sp() & 0xf) != 0); |
| 3125 if (stack_alignment_exception) { | 3135 if (stack_alignment_exception) { |
| 3126 TraceSim(" with unaligned stack 0x%016" PRIx64 ".\n", sp()); | 3136 TraceSim(" with unaligned stack 0x%016" PRIx64 ".\n", sp()); |
| 3127 ALIGNMENT_EXCEPTION(); | 3137 ALIGNMENT_EXCEPTION(); |
| 3128 } | 3138 } |
| 3129 | 3139 |
| 3130 switch (redirection->type()) { | 3140 switch (redirection->type()) { |
| 3131 default: | 3141 default: |
| 3132 TraceSim(" with unrecognized redirection type."); | 3142 TraceSim("Type: Unknown.\n"); |
| 3133 UNREACHABLE(); | 3143 UNREACHABLE(); |
| 3134 break; | 3144 break; |
| 3135 | 3145 |
| 3146 case ExternalReference::BUILTIN_CALL: { |
| 3147 // MaybeObject* f(v8::internal::Arguments). |
| 3148 TraceSim("Type: BUILTIN_CALL\n"); |
| 3149 SimulatorRuntimeCall target = |
| 3150 reinterpret_cast<SimulatorRuntimeCall>(external); |
| 3151 |
| 3152 // We don't know how many arguments are being passed, but we can |
| 3153 // pass 8 without touching the stack. They will be ignored by the |
| 3154 // host function if they aren't used. |
| 3155 TraceSim("Arguments: " |
| 3156 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " |
| 3157 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " |
| 3158 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " |
| 3159 "0x%016" PRIx64 ", 0x%016" PRIx64, |
| 3160 xreg(0), xreg(1), xreg(2), xreg(3), |
| 3161 xreg(4), xreg(5), xreg(6), xreg(7)); |
| 3162 ObjectPair result = target(xreg(0), xreg(1), xreg(2), xreg(3), |
| 3163 xreg(4), xreg(5), xreg(6), xreg(7)); |
| 3164 TraceSim("Returned: {0x%" PRIx64 ", 0x%" PRIx64"}\n", |
| 3165 result.res0, result.res1); |
| 3166 #ifdef DEBUG |
| 3167 CorruptAllCallerSavedCPURegisters(); |
| 3168 #endif |
| 3169 set_xreg(0, result.res0); |
| 3170 set_xreg(1, result.res1); |
| 3171 break; |
| 3172 } |
| 3173 |
| 3174 case ExternalReference::DIRECT_API_CALL: { |
| 3175 // Handle<Value> f(v8::Arguments&) |
| 3176 TraceSim("Type: DIRECT_API_CALL\n"); |
| 3177 SimulatorRuntimeDirectApiCall target = |
| 3178 reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); |
| 3179 TraceSim("Arguments: 0x%016" PRIx64 "\n", xreg(0)); |
| 3180 v8::Handle<v8::Value> result = target(xreg(0)); |
| 3181 TraceSim("Returned %p\n", reinterpret_cast<void *>(*result)); |
| 3182 #ifdef DEBUG |
| 3183 CorruptAllCallerSavedCPURegisters(); |
| 3184 #endif |
| 3185 set_reg(0, *result); |
| 3186 break; |
| 3187 } |
| 3188 |
| 3189 case ExternalReference::DIRECT_API_CALL_NEW: { |
| 3190 // void f(v8::Arguments&) |
| 3191 TraceSim("Type: DIRECT_API_CALL_NEW\n"); |
| 3192 SimulatorRuntimeDirectApiCallNew target = |
| 3193 reinterpret_cast<SimulatorRuntimeDirectApiCallNew>(external); |
| 3194 TraceSim("Arguments: 0x%016" PRIx64 "\n", xreg(0)); |
| 3195 target(xreg(0)); |
| 3196 TraceSim("No return value."); |
| 3197 #ifdef DEBUG |
| 3198 CorruptAllCallerSavedCPURegisters(); |
| 3199 #endif |
| 3200 break; |
| 3201 } |
| 3202 |
| 3136 case ExternalReference::BUILTIN_COMPARE_CALL: { | 3203 case ExternalReference::BUILTIN_COMPARE_CALL: { |
| 3137 // int f(double, double) | 3204 // int f(double, double) |
| 3205 TraceSim("Type: BUILTIN_COMPARE_CALL\n"); |
| 3138 SimulatorRuntimeCompareCall target = | 3206 SimulatorRuntimeCompareCall target = |
| 3139 reinterpret_cast<SimulatorRuntimeCompareCall>(external); | 3207 reinterpret_cast<SimulatorRuntimeCompareCall>(external); |
| 3140 TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1)); | 3208 TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1)); |
| 3141 int64_t result = target(dreg(0), dreg(1)); | 3209 int64_t result = target(dreg(0), dreg(1)); |
| 3142 TraceSim("Returned: %" PRId64 "\n", result); | 3210 TraceSim("Returned: %" PRId64 "\n", result); |
| 3143 #ifdef DEBUG | 3211 #ifdef DEBUG |
| 3144 CorruptAllCallerSavedCPURegisters(); | 3212 CorruptAllCallerSavedCPURegisters(); |
| 3145 #endif | 3213 #endif |
| 3146 set_xreg(0, result); | 3214 set_xreg(0, result); |
| 3147 break; | 3215 break; |
| 3148 } | 3216 } |
| 3149 | 3217 |
| 3150 case ExternalReference::BUILTIN_FP_FP_CALL: { | 3218 case ExternalReference::BUILTIN_FP_CALL: { |
| 3151 // double f(double, double) | 3219 // double f(double) |
| 3152 SimulatorRuntimeFPFPCall target = | 3220 TraceSim("Type: BUILTIN_FP_CALL\n"); |
| 3153 reinterpret_cast<SimulatorRuntimeFPFPCall>(external); | 3221 SimulatorRuntimeFPCall target = |
| 3154 TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1)); | 3222 reinterpret_cast<SimulatorRuntimeFPCall>(external); |
| 3155 double result = target(dreg(0), dreg(1)); | 3223 TraceSim("Argument: %f\n", dreg(0)); |
| 3224 double result = target(dreg(0)); |
| 3156 TraceSim("Returned: %f\n", result); | 3225 TraceSim("Returned: %f\n", result); |
| 3157 #ifdef DEBUG | 3226 #ifdef DEBUG |
| 3158 CorruptAllCallerSavedCPURegisters(); | 3227 CorruptAllCallerSavedCPURegisters(); |
| 3159 #endif | 3228 #endif |
| 3160 set_dreg(0, result); | 3229 set_dreg(0, result); |
| 3161 break; | 3230 break; |
| 3162 } | 3231 } |
| 3163 | 3232 |
| 3164 case ExternalReference::BUILTIN_FP_CALL: { | 3233 case ExternalReference::BUILTIN_FP_FP_CALL: { |
| 3165 // double f(double) | 3234 // double f(double, double) |
| 3166 SimulatorRuntimeFPCall target = | 3235 TraceSim("Type: BUILTIN_FP_FP_CALL\n"); |
| 3167 reinterpret_cast<SimulatorRuntimeFPCall>(external); | 3236 SimulatorRuntimeFPFPCall target = |
| 3168 TraceSim("Argument: %f\n", dreg(0)); | 3237 reinterpret_cast<SimulatorRuntimeFPFPCall>(external); |
| 3169 double result = target(dreg(0)); | 3238 TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1)); |
| 3239 double result = target(dreg(0), dreg(1)); |
| 3170 TraceSim("Returned: %f\n", result); | 3240 TraceSim("Returned: %f\n", result); |
| 3171 #ifdef DEBUG | 3241 #ifdef DEBUG |
| 3172 CorruptAllCallerSavedCPURegisters(); | 3242 CorruptAllCallerSavedCPURegisters(); |
| 3173 #endif | 3243 #endif |
| 3174 set_dreg(0, result); | 3244 set_dreg(0, result); |
| 3175 break; | 3245 break; |
| 3176 } | 3246 } |
| 3177 | 3247 |
| 3178 case ExternalReference::BUILTIN_FP_INT_CALL: { | 3248 case ExternalReference::BUILTIN_FP_INT_CALL: { |
| 3179 // double f(double, int) | 3249 // double f(double, int) |
| 3250 TraceSim("Type: BUILTIN_FP_INT_CALL\n"); |
| 3180 SimulatorRuntimeFPIntCall target = | 3251 SimulatorRuntimeFPIntCall target = |
| 3181 reinterpret_cast<SimulatorRuntimeFPIntCall>(external); | 3252 reinterpret_cast<SimulatorRuntimeFPIntCall>(external); |
| 3182 TraceSim("Arguments: %f, %d\n", dreg(0), wreg(0)); | 3253 TraceSim("Arguments: %f, %d\n", dreg(0), wreg(0)); |
| 3183 double result = target(dreg(0), wreg(0)); | 3254 double result = target(dreg(0), wreg(0)); |
| 3184 TraceSim("Returned: %f\n", result); | 3255 TraceSim("Returned: %f\n", result); |
| 3185 #ifdef DEBUG | 3256 #ifdef DEBUG |
| 3186 CorruptAllCallerSavedCPURegisters(); | 3257 CorruptAllCallerSavedCPURegisters(); |
| 3187 #endif | 3258 #endif |
| 3188 set_dreg(0, result); | 3259 set_dreg(0, result); |
| 3189 break; | 3260 break; |
| 3190 } | 3261 } |
| 3191 | 3262 |
| 3192 case ExternalReference::DIRECT_API_CALL: { | 3263 case ExternalReference::DIRECT_GETTER_CALL: { |
| 3193 // Handle<Value> f(v8::Arguments&) | 3264 // Handle<value> f(Local<String> property, AccessorInfo& info) |
| 3194 SimulatorRuntimeDirectApiCall target = | 3265 TraceSim("Type: DIRECT_GETTER_CALL\n"); |
| 3195 reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); | 3266 SimulatorRuntimeDirectGetterCall target = |
| 3196 TraceSim("Arguments: 0x%016" PRIx64 "\n", xreg(0)); | 3267 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); |
| 3197 v8::Handle<v8::Value> result = target(xreg(0)); | 3268 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3198 TraceSim("Returned %p\n", reinterpret_cast<void *>(*result)); | 3269 xreg(0), xreg(1)); |
| 3270 v8::Handle<v8::Value> result = target(xreg(0), xreg(1)); |
| 3271 TraceSim("Returned: %p\n", reinterpret_cast<void *>(*result)); |
| 3199 #ifdef DEBUG | 3272 #ifdef DEBUG |
| 3200 CorruptAllCallerSavedCPURegisters(); | 3273 CorruptAllCallerSavedCPURegisters(); |
| 3201 #endif | 3274 #endif |
| 3202 set_reg(0, *result); | 3275 set_reg(0, *result); |
| 3203 break; | 3276 break; |
| 3204 } | 3277 } |
| 3205 | 3278 |
| 3206 case ExternalReference::DIRECT_API_CALL_NEW: { | 3279 case ExternalReference::DIRECT_GETTER_CALL_NEW: { |
| 3207 // void f(v8::Arguments&) | 3280 // void f(Local<String> property, AccessorInfo& info) |
| 3208 SimulatorRuntimeDirectApiCallNew target = | 3281 TraceSim("Type: DIRECT_GETTER_CALL_NEW\n"); |
| 3209 reinterpret_cast<SimulatorRuntimeDirectApiCallNew>(external); | 3282 SimulatorRuntimeDirectGetterCallNew target = |
| 3210 TraceSim("Arguments: 0x%016" PRIx64 "\n", xreg(0)); | 3283 reinterpret_cast<SimulatorRuntimeDirectGetterCallNew>(external); |
| 3211 target(xreg(0)); | 3284 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3285 xreg(0), xreg(1)); |
| 3286 target(xreg(0), xreg(1)); |
| 3212 TraceSim("No return value."); | 3287 TraceSim("No return value."); |
| 3288 #ifdef DEBUG |
| 3289 CorruptAllCallerSavedCPURegisters(); |
| 3290 #endif |
| 3213 break; | 3291 break; |
| 3214 } | 3292 } |
| 3215 | 3293 |
| 3216 case ExternalReference::DIRECT_GETTER_CALL: { | 3294 case ExternalReference::PROFILING_API_CALL: { |
| 3217 // Handle<value> f(Local<String> property, AccessorInfo& info) | 3295 TraceSim("Type: PROFILING_API_CALL\n"); |
| 3218 SimulatorRuntimeDirectGetterCall target = | 3296 // Handle<Value> f(v8::Arguments&, v8::InvocationCallback) |
| 3219 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); | 3297 SimulatorRuntimeProfilingApiCall target = |
| 3298 reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external); |
| 3220 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", | 3299 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3221 xreg(0), xreg(1)); | 3300 xreg(0), xreg(1)); |
| 3222 v8::Handle<v8::Value> result = target(xreg(0), xreg(1)); | 3301 v8::Handle<v8::Value> result = target(xreg(0), xreg(1)); |
| 3223 TraceSim("Returned: %p\n", reinterpret_cast<void *>(*result)); | 3302 TraceSim("Returned: %p\n", reinterpret_cast<void *>(*result)); |
| 3224 #ifdef DEBUG | 3303 #ifdef DEBUG |
| 3225 CorruptAllCallerSavedCPURegisters(); | 3304 CorruptAllCallerSavedCPURegisters(); |
| 3226 #endif | 3305 #endif |
| 3227 set_reg(0, *result); | 3306 set_reg(0, *result); |
| 3228 break; | 3307 break; |
| 3229 } | 3308 } |
| 3230 | 3309 |
| 3231 case ExternalReference::DIRECT_GETTER_CALL_NEW: { | 3310 case ExternalReference::PROFILING_API_CALL_NEW: { |
| 3232 // void f(Local<String> property, AccessorInfo& info) | 3311 // void f(v8::Arguments&, v8::FunctionCallback) |
| 3233 SimulatorRuntimeDirectGetterCallNew target = | 3312 TraceSim("Type: PROFILING_API_CALL_NEW\n"); |
| 3234 reinterpret_cast<SimulatorRuntimeDirectGetterCallNew>(external); | 3313 SimulatorRuntimeProfilingApiCallNew target = |
| 3314 reinterpret_cast<SimulatorRuntimeProfilingApiCallNew>(external); |
| 3235 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", | 3315 TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3236 xreg(0), xreg(1)); | 3316 xreg(0), xreg(1)); |
| 3237 target(xreg(0), xreg(1)); | 3317 target(xreg(0), xreg(1)); |
| 3238 TraceSim("No return value."); | 3318 TraceSim("No return value."); |
| 3319 #ifdef DEBUG |
| 3320 CorruptAllCallerSavedCPURegisters(); |
| 3321 #endif |
| 3239 break; | 3322 break; |
| 3240 } | 3323 } |
| 3241 | 3324 |
| 3242 case ExternalReference::BUILTIN_CALL: { | 3325 case ExternalReference::PROFILING_GETTER_CALL: { |
| 3243 // MaybeObject* f(v8::internal::Arguments). | 3326 // Handle<value> f(Local<String> property, AccessorInfo& info, |
| 3244 SimulatorRuntimeCall target = | 3327 // AccessorGetter getter) |
| 3245 reinterpret_cast<SimulatorRuntimeCall>(external); | 3328 TraceSim("Type: PROFILING_GETTER_CALL\n"); |
| 3246 | 3329 SimulatorRuntimeProfilingGetterCall target = |
| 3247 // We don't know how many arguments are being passed, but we can | 3330 reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external); |
| 3248 // pass 8 without touching the stack. They will be ignored by the | |
| 3249 // host function if they aren't used. | |
| 3250 TraceSim("Arguments: " | 3331 TraceSim("Arguments: " |
| 3251 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " | 3332 "0x%016" PRIx64 ", 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3252 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " | 3333 xreg(0), xreg(1), xreg(2)); |
| 3253 "0x%016" PRIx64 ", 0x%016" PRIx64 ", " | 3334 v8::Handle<v8::Value> result = target(xreg(0), xreg(1), xreg(2)); |
| 3254 "0x%016" PRIx64 ", 0x%016" PRIx64, | 3335 TraceSim("Returned: %p\n", reinterpret_cast<void *>(*result)); |
| 3255 xreg(0), xreg(1), xreg(2), xreg(3), | |
| 3256 xreg(4), xreg(5), xreg(6), xreg(7)); | |
| 3257 ObjectPair result = target(xreg(0), xreg(1), xreg(2), xreg(3), | |
| 3258 xreg(4), xreg(5), xreg(6), xreg(7)); | |
| 3259 TraceSim("Returned: {0x%" PRIx64 ", 0x%" PRIx64"}\n", | |
| 3260 result.res0, result.res1); | |
| 3261 #ifdef DEBUG | 3336 #ifdef DEBUG |
| 3262 CorruptAllCallerSavedCPURegisters(); | 3337 CorruptAllCallerSavedCPURegisters(); |
| 3263 #endif | 3338 #endif |
| 3264 set_xreg(0, result.res0); | 3339 set_reg(0, *result); |
| 3265 set_xreg(1, result.res1); | 3340 break; |
| 3341 } |
| 3342 |
| 3343 case ExternalReference::PROFILING_GETTER_CALL_NEW: { |
| 3344 // void f(Local<String> property, AccessorInfo& info, |
| 3345 // AccessorGetterCallback callback) |
| 3346 TraceSim("Type: PROFILING_GETTER_CALL_NEW\n"); |
| 3347 SimulatorRuntimeProfilingGetterCallNew target = |
| 3348 reinterpret_cast<SimulatorRuntimeProfilingGetterCallNew>( |
| 3349 external); |
| 3350 TraceSim("Arguments: " |
| 3351 "0x%016" PRIx64 ", 0x%016" PRIx64 ", 0x%016" PRIx64 "\n", |
| 3352 xreg(0), xreg(1), xreg(2)); |
| 3353 target(xreg(0), xreg(1), xreg(2)); |
| 3354 TraceSim("No return value."); |
| 3355 #ifdef DEBUG |
| 3356 CorruptAllCallerSavedCPURegisters(); |
| 3357 #endif |
| 3266 break; | 3358 break; |
| 3267 } | 3359 } |
| 3268 } | 3360 } |
| 3269 | 3361 |
| 3270 set_lr(return_address); | 3362 set_lr(return_address); |
| 3271 set_pc(return_address); | 3363 set_pc(return_address); |
| 3272 } else if (instr->ImmException() == kImmExceptionIsPrintf) { | 3364 } else if (instr->ImmException() == kImmExceptionIsPrintf) { |
| 3273 // Read the argument encoded inline in the instruction stream. | 3365 // Read the argument encoded inline in the instruction stream. |
| 3274 uint32_t type; | 3366 uint32_t type; |
| 3275 ASSERT(sizeof(*pc_) == 1); | 3367 ASSERT(sizeof(*pc_) == 1); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3318 default: | 3410 default: |
| 3319 UNIMPLEMENTED(); | 3411 UNIMPLEMENTED(); |
| 3320 } | 3412 } |
| 3321 } | 3413 } |
| 3322 | 3414 |
| 3323 #endif // USE_SIMULATOR | 3415 #endif // USE_SIMULATOR |
| 3324 | 3416 |
| 3325 } } // namespace v8::internal | 3417 } } // namespace v8::internal |
| 3326 | 3418 |
| 3327 #endif // V8_TARGET_ARCH_A64 | 3419 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |