| 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 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2475 for (int i = 0; i < lit->properties()->length(); i++) { | 2475 for (int i = 0; i < lit->properties()->length(); i++) { |
| 2476 ObjectLiteral::Property* property = lit->properties()->at(i); | 2476 ObjectLiteral::Property* property = lit->properties()->at(i); |
| 2477 Expression* value = property->value(); | 2477 Expression* value = property->value(); |
| 2478 | 2478 |
| 2479 if (property->is_static()) { | 2479 if (property->is_static()) { |
| 2480 __ push(Operand(esp, kPointerSize)); // constructor | 2480 __ push(Operand(esp, kPointerSize)); // constructor |
| 2481 } else { | 2481 } else { |
| 2482 __ push(Operand(esp, 0)); // prototype | 2482 __ push(Operand(esp, 0)); // prototype |
| 2483 } | 2483 } |
| 2484 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2484 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 2485 |
| 2486 // The static prototype property is read only. We handle the non computed |
| 2487 // property name case in the parser. Since this is the only case where we |
| 2488 // need to check for an own read only property we special case this so we do |
| 2489 // not need to do this for every property. |
| 2490 if (property->is_static() && property->is_computed_name()) { |
| 2491 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1); |
| 2492 __ push(eax); |
| 2493 } |
| 2494 |
| 2485 VisitForStackValue(value); | 2495 VisitForStackValue(value); |
| 2486 EmitSetHomeObjectIfNeeded(value, 2); | 2496 EmitSetHomeObjectIfNeeded(value, 2); |
| 2487 | 2497 |
| 2488 switch (property->kind()) { | 2498 switch (property->kind()) { |
| 2489 case ObjectLiteral::Property::CONSTANT: | 2499 case ObjectLiteral::Property::CONSTANT: |
| 2490 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2500 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 2491 case ObjectLiteral::Property::PROTOTYPE: | 2501 case ObjectLiteral::Property::PROTOTYPE: |
| 2492 UNREACHABLE(); | 2502 UNREACHABLE(); |
| 2493 case ObjectLiteral::Property::COMPUTED: | 2503 case ObjectLiteral::Property::COMPUTED: |
| 2494 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2504 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
| (...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5374 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5384 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 5375 Assembler::target_address_at(call_target_address, | 5385 Assembler::target_address_at(call_target_address, |
| 5376 unoptimized_code)); | 5386 unoptimized_code)); |
| 5377 return OSR_AFTER_STACK_CHECK; | 5387 return OSR_AFTER_STACK_CHECK; |
| 5378 } | 5388 } |
| 5379 | 5389 |
| 5380 | 5390 |
| 5381 } } // namespace v8::internal | 5391 } } // namespace v8::internal |
| 5382 | 5392 |
| 5383 #endif // V8_TARGET_ARCH_X87 | 5393 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |