| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 4); | 2476 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 4); |
| 2477 break; | 2477 break; |
| 2478 | 2478 |
| 2479 case ObjectLiteral::Property::SETTER: | 2479 case ObjectLiteral::Property::SETTER: |
| 2480 __ push(Immediate(Smi::FromInt(DONT_ENUM))); | 2480 __ push(Immediate(Smi::FromInt(DONT_ENUM))); |
| 2481 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); | 2481 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); |
| 2482 break; | 2482 break; |
| 2483 } | 2483 } |
| 2484 } | 2484 } |
| 2485 | 2485 |
| 2486 // prototype | 2486 // Set both the prototype and constructor to have fast properties, and also |
| 2487 __ CallRuntime(Runtime::kToFastProperties, 1); | 2487 // freeze them in strong mode. |
| 2488 | 2488 __ CallRuntime(is_strong(language_mode()) |
| 2489 // constructor | 2489 ? Runtime::kFinalizeClassDefinitionStrong |
| 2490 __ CallRuntime(Runtime::kToFastProperties, 1); | 2490 : Runtime::kFinalizeClassDefinition, |
| 2491 | 2491 2); |
| 2492 if (is_strong(language_mode())) { | |
| 2493 __ mov(scratch, | |
| 2494 FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset)); | |
| 2495 __ push(eax); | |
| 2496 __ Push(scratch); | |
| 2497 // TODO(conradw): It would be more efficient to define the properties with | |
| 2498 // the right attributes the first time round. | |
| 2499 // Freeze the prototype. | |
| 2500 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
| 2501 // Freeze the constructor. | |
| 2502 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
| 2503 } | |
| 2504 } | 2492 } |
| 2505 | 2493 |
| 2506 | 2494 |
| 2507 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2495 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2508 __ pop(edx); | 2496 __ pop(edx); |
| 2509 Handle<Code> code = | 2497 Handle<Code> code = |
| 2510 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2498 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2511 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2499 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2512 CallIC(code, expr->BinaryOperationFeedbackId()); | 2500 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2513 patch_site.EmitPatchInfo(); | 2501 patch_site.EmitPatchInfo(); |
| (...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5341 Assembler::target_address_at(call_target_address, | 5329 Assembler::target_address_at(call_target_address, |
| 5342 unoptimized_code)); | 5330 unoptimized_code)); |
| 5343 return OSR_AFTER_STACK_CHECK; | 5331 return OSR_AFTER_STACK_CHECK; |
| 5344 } | 5332 } |
| 5345 | 5333 |
| 5346 | 5334 |
| 5347 } // namespace internal | 5335 } // namespace internal |
| 5348 } // namespace v8 | 5336 } // namespace v8 |
| 5349 | 5337 |
| 5350 #endif // V8_TARGET_ARCH_IA32 | 5338 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |