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 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 Literal* key = property->key()->AsLiteral(); | 2437 Literal* key = property->key()->AsLiteral(); |
2438 Expression* value = property->value(); | 2438 Expression* value = property->value(); |
2439 DCHECK(key != NULL); | 2439 DCHECK(key != NULL); |
2440 | 2440 |
2441 if (property->is_static()) { | 2441 if (property->is_static()) { |
2442 __ push(Operand(esp, kPointerSize)); // constructor | 2442 __ push(Operand(esp, kPointerSize)); // constructor |
2443 } else { | 2443 } else { |
2444 __ push(Operand(esp, 0)); // prototype | 2444 __ push(Operand(esp, 0)); // prototype |
2445 } | 2445 } |
2446 VisitForStackValue(key); | 2446 VisitForStackValue(key); |
| 2447 VisitForStackValue(value); |
2447 | 2448 |
2448 switch (property->kind()) { | 2449 switch (property->kind()) { |
2449 case ObjectLiteral::Property::CONSTANT: | 2450 case ObjectLiteral::Property::CONSTANT: |
2450 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2451 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
2451 case ObjectLiteral::Property::COMPUTED: | 2452 case ObjectLiteral::Property::COMPUTED: |
2452 case ObjectLiteral::Property::PROTOTYPE: | 2453 case ObjectLiteral::Property::PROTOTYPE: |
2453 VisitForStackValue(value); | 2454 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
2454 __ push(Immediate(Smi::FromInt(NONE))); | |
2455 __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); | |
2456 break; | 2455 break; |
2457 | 2456 |
2458 case ObjectLiteral::Property::GETTER: | 2457 case ObjectLiteral::Property::GETTER: |
2459 VisitForStackValue(value); | 2458 __ CallRuntime(Runtime::kDefineClassGetter, 3); |
2460 __ push(Immediate(isolate()->factory()->null_value())); | |
2461 __ push(Immediate(Smi::FromInt(NONE))); | |
2462 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | |
2463 break; | 2459 break; |
2464 | 2460 |
2465 case ObjectLiteral::Property::SETTER: | 2461 case ObjectLiteral::Property::SETTER: |
2466 __ push(Immediate(isolate()->factory()->null_value())); | 2462 __ CallRuntime(Runtime::kDefineClassSetter, 3); |
2467 VisitForStackValue(value); | |
2468 __ push(Immediate(Smi::FromInt(NONE))); | |
2469 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | |
2470 break; | 2463 break; |
2471 | 2464 |
2472 default: | 2465 default: |
2473 UNREACHABLE(); | 2466 UNREACHABLE(); |
2474 } | 2467 } |
2475 } | 2468 } |
2476 | 2469 |
2477 // prototype | 2470 // prototype |
2478 __ CallRuntime(Runtime::kToFastProperties, 1); | 2471 __ CallRuntime(Runtime::kToFastProperties, 1); |
2479 | 2472 |
(...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5222 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5215 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5223 Assembler::target_address_at(call_target_address, | 5216 Assembler::target_address_at(call_target_address, |
5224 unoptimized_code)); | 5217 unoptimized_code)); |
5225 return OSR_AFTER_STACK_CHECK; | 5218 return OSR_AFTER_STACK_CHECK; |
5226 } | 5219 } |
5227 | 5220 |
5228 | 5221 |
5229 } } // namespace v8::internal | 5222 } } // namespace v8::internal |
5230 | 5223 |
5231 #endif // V8_TARGET_ARCH_IA32 | 5224 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |