| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 4); | 2467 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 4); |
| 2468 break; | 2468 break; |
| 2469 | 2469 |
| 2470 case ObjectLiteral::Property::SETTER: | 2470 case ObjectLiteral::Property::SETTER: |
| 2471 __ push(Immediate(Smi::FromInt(DONT_ENUM))); | 2471 __ push(Immediate(Smi::FromInt(DONT_ENUM))); |
| 2472 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); | 2472 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); |
| 2473 break; | 2473 break; |
| 2474 } | 2474 } |
| 2475 } | 2475 } |
| 2476 | 2476 |
| 2477 // prototype | 2477 // Set both the prototype and constructor to have fast properties, and also |
| 2478 __ CallRuntime(Runtime::kToFastProperties, 1); | 2478 // freeze them in strong mode. |
| 2479 | 2479 __ CallRuntime(is_strong(language_mode()) |
| 2480 // constructor | 2480 ? Runtime::kFinalizeClassDefinitionStrong |
| 2481 __ CallRuntime(Runtime::kToFastProperties, 1); | 2481 : Runtime::kFinalizeClassDefinition, |
| 2482 | 2482 2); |
| 2483 if (is_strong(language_mode())) { | |
| 2484 __ mov(scratch, | |
| 2485 FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset)); | |
| 2486 __ push(eax); | |
| 2487 __ push(scratch); | |
| 2488 // TODO(conradw): It would be more efficient to define the properties with | |
| 2489 // the right attributes the first time round. | |
| 2490 // Freeze the prototype. | |
| 2491 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
| 2492 // Freeze the constructor. | |
| 2493 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
| 2494 } | |
| 2495 } | 2483 } |
| 2496 | 2484 |
| 2497 | 2485 |
| 2498 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2486 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2499 __ pop(edx); | 2487 __ pop(edx); |
| 2500 Handle<Code> code = | 2488 Handle<Code> code = |
| 2501 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2489 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2502 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2490 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2503 CallIC(code, expr->BinaryOperationFeedbackId()); | 2491 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2504 patch_site.EmitPatchInfo(); | 2492 patch_site.EmitPatchInfo(); |
| (...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5332 Assembler::target_address_at(call_target_address, | 5320 Assembler::target_address_at(call_target_address, |
| 5333 unoptimized_code)); | 5321 unoptimized_code)); |
| 5334 return OSR_AFTER_STACK_CHECK; | 5322 return OSR_AFTER_STACK_CHECK; |
| 5335 } | 5323 } |
| 5336 | 5324 |
| 5337 | 5325 |
| 5338 } // namespace internal | 5326 } // namespace internal |
| 5339 } // namespace v8 | 5327 } // namespace v8 |
| 5340 | 5328 |
| 5341 #endif // V8_TARGET_ARCH_X87 | 5329 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |