Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2170 env->deoptimization_index(), | 2170 env->deoptimization_index(), |
| 2171 true); | 2171 true); |
| 2172 v8::internal::ParameterCount actual(rax); | 2172 v8::internal::ParameterCount actual(rax); |
| 2173 __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); | 2173 __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); |
| 2174 } | 2174 } |
| 2175 | 2175 |
| 2176 | 2176 |
| 2177 void LCodeGen::DoPushArgument(LPushArgument* instr) { | 2177 void LCodeGen::DoPushArgument(LPushArgument* instr) { |
| 2178 LOperand* argument = instr->InputAt(0); | 2178 LOperand* argument = instr->InputAt(0); |
| 2179 if (argument->IsConstantOperand()) { | 2179 if (argument->IsConstantOperand()) { |
| 2180 LConstantOperand* const_op = LConstantOperand::cast(argument); | 2180 EmitPushConstantOperand(argument); |
| 2181 Handle<Object> literal = chunk_->LookupLiteral(const_op); | |
| 2182 Representation r = chunk_->LookupLiteralRepresentation(const_op); | |
| 2183 if (r.IsInteger32()) { | |
| 2184 ASSERT(literal->IsNumber()); | |
| 2185 __ push(Immediate(static_cast<int32_t>(literal->Number()))); | |
| 2186 } else if (r.IsDouble()) { | |
| 2187 Abort("unsupported double immediate"); | |
| 2188 } else { | |
| 2189 ASSERT(r.IsTagged()); | |
| 2190 __ Push(literal); | |
| 2191 } | |
| 2192 } else if (argument->IsRegister()) { | 2181 } else if (argument->IsRegister()) { |
| 2193 __ push(ToRegister(argument)); | 2182 __ push(ToRegister(argument)); |
| 2194 } else { | 2183 } else { |
| 2195 ASSERT(!argument->IsDoubleRegister()); | 2184 ASSERT(!argument->IsDoubleRegister()); |
| 2196 __ push(ToOperand(argument)); | 2185 __ push(ToOperand(argument)); |
| 2197 } | 2186 } |
| 2198 } | 2187 } |
| 2199 | 2188 |
| 2200 | 2189 |
| 2201 void LCodeGen::DoContext(LContext* instr) { | 2190 void LCodeGen::DoContext(LContext* instr) { |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3223 __ j(not_equal, &check_frame_marker); | 3212 __ j(not_equal, &check_frame_marker); |
| 3224 __ movq(temp, Operand(rax, StandardFrameConstants::kCallerFPOffset)); | 3213 __ movq(temp, Operand(rax, StandardFrameConstants::kCallerFPOffset)); |
| 3225 | 3214 |
| 3226 // Check the marker in the calling frame. | 3215 // Check the marker in the calling frame. |
| 3227 __ bind(&check_frame_marker); | 3216 __ bind(&check_frame_marker); |
| 3228 __ SmiCompare(Operand(temp, StandardFrameConstants::kMarkerOffset), | 3217 __ SmiCompare(Operand(temp, StandardFrameConstants::kMarkerOffset), |
| 3229 Smi::FromInt(StackFrame::CONSTRUCT)); | 3218 Smi::FromInt(StackFrame::CONSTRUCT)); |
| 3230 } | 3219 } |
| 3231 | 3220 |
| 3232 | 3221 |
| 3222 void LCodeGen::EmitPushConstantOperand(LOperand* operand) { | |
| 3223 ASSERT(operand->IsConstantOperand()); | |
| 3224 LConstantOperand* const_op = LConstantOperand::cast(operand); | |
| 3225 Handle<Object> literal = chunk_->LookupLiteral(const_op); | |
| 3226 Representation r = chunk_->LookupLiteralRepresentation(const_op); | |
| 3227 if (r.IsInteger32()) { | |
| 3228 ASSERT(literal->IsNumber()); | |
| 3229 __ push(Immediate(static_cast<int32_t>(literal->Number()))); | |
| 3230 } else if (r.IsDouble()) { | |
| 3231 Abort("unsupported double immediate"); | |
| 3232 } else { | |
| 3233 ASSERT(r.IsTagged()); | |
| 3234 __ Push(literal); | |
| 3235 } | |
| 3236 } | |
| 3237 | |
| 3238 | |
| 3233 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 3239 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
| 3234 Register input = ToRegister(instr->InputAt(0)); | 3240 Register input = ToRegister(instr->InputAt(0)); |
| 3235 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 3241 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 3236 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 3242 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 3237 Label* true_label = chunk_->GetAssemblyLabel(true_block); | 3243 Label* true_label = chunk_->GetAssemblyLabel(true_block); |
| 3238 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 3244 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
| 3239 | 3245 |
| 3240 Condition final_branch_condition = EmitTypeofIs(true_label, | 3246 Condition final_branch_condition = EmitTypeofIs(true_label, |
| 3241 false_label, | 3247 false_label, |
| 3242 input, | 3248 input, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3315 // call for populating the safepoint data with deoptimization data. | 3321 // call for populating the safepoint data with deoptimization data. |
| 3316 } | 3322 } |
| 3317 | 3323 |
| 3318 | 3324 |
| 3319 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 3325 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
| 3320 DeoptimizeIf(no_condition, instr->environment()); | 3326 DeoptimizeIf(no_condition, instr->environment()); |
| 3321 } | 3327 } |
| 3322 | 3328 |
| 3323 | 3329 |
| 3324 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { | 3330 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { |
| 3325 Abort("Unimplemented: %s", "DoDeleteProperty"); | 3331 LOperand* obj = instr->object(); |
| 3332 LOperand* key = instr->key(); | |
| 3333 // Push object. | |
| 3334 if (obj->IsRegister()) { | |
| 3335 __ push(ToRegister(obj)); | |
| 3336 } else { | |
| 3337 __ push(ToOperand(obj)); | |
| 3338 } | |
| 3339 // Push key. | |
| 3340 if (key->IsConstantOperand()) { | |
| 3341 EmitPushConstantOperand(key); | |
| 3342 } else if (key->IsRegister()) { | |
| 3343 __ push(ToRegister(key)); | |
| 3344 } else { | |
| 3345 __ push(ToOperand(key)); | |
| 3346 } | |
| 3347 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | |
| 3348 LPointerMap* pointers = instr->pointer_map(); | |
| 3349 LEnvironment* env = instr->deoptimization_environment(); | |
| 3350 RecordPosition(pointers->position()); | |
| 3351 RegisterEnvironmentForDeoptimization(env); | |
| 3352 // Create safepoint generator that will also ensure enough space in the | |
| 3353 // reloc info for patching in deoptimization (since this is invoking a | |
| 3354 // builtin) | |
| 3355 SafepointGenerator safepoint_generator(this, | |
| 3356 pointers, | |
| 3357 env->deoptimization_index(), | |
| 3358 true); | |
| 3359 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | |
|
William Hesse
2011/02/23 10:03:12
I thought that rsi was still guaranteed to contain
Mads Ager (chromium)
2011/02/23 10:11:10
You are absolutely right. This is not needed. Than
| |
| 3360 __ Push(Smi::FromInt(strict_mode_flag())); | |
| 3361 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator); | |
| 3326 } | 3362 } |
| 3327 | 3363 |
| 3328 | 3364 |
| 3329 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 3365 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
| 3330 // Perform stack overflow check. | 3366 // Perform stack overflow check. |
| 3331 NearLabel done; | 3367 NearLabel done; |
| 3332 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); | 3368 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); |
| 3333 __ j(above_equal, &done); | 3369 __ j(above_equal, &done); |
| 3334 | 3370 |
| 3335 StackCheckStub stub; | 3371 StackCheckStub stub; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 3352 RegisterEnvironmentForDeoptimization(environment); | 3388 RegisterEnvironmentForDeoptimization(environment); |
| 3353 ASSERT(osr_pc_offset_ == -1); | 3389 ASSERT(osr_pc_offset_ == -1); |
| 3354 osr_pc_offset_ = masm()->pc_offset(); | 3390 osr_pc_offset_ = masm()->pc_offset(); |
| 3355 } | 3391 } |
| 3356 | 3392 |
| 3357 #undef __ | 3393 #undef __ |
| 3358 | 3394 |
| 3359 } } // namespace v8::internal | 3395 } } // namespace v8::internal |
| 3360 | 3396 |
| 3361 #endif // V8_TARGET_ARCH_X64 | 3397 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |